PyExec
Enhanced version of Impacket-PsExec
PyExec is a tool similar to Impacket-PsExec, but with a distinct functionality: instead of uploading a malicious binary, it allows the execution of any binary file that is available on both the local and remote systems.
1.1. What is Impacket-PsExec?
Impacket-PsExec is a tool from the Impacket suite that allows remote command execution or binary loading on Windows systems. PsExec replicates the functionality of the Sysinternals PsExec tool, which is widely used for the remote administration of Windows systems.
1.2. How does Impacket-PsExec work?
SMB Connection: Uses the SMB (Server Message Block) protocol to connect to the remote system.
Binary Upload: Uploads a malicious binary (typically
psexecsvc.exe
) to the remote system in a temporary folder.Binary Execution: This binary is executed with administrative permissions to enable the requested command execution.
Binary Deletion: Once executed, the binary is deleted to reduce traces, although it may still be detected by security solutions.
1.3. Limitations of Impacket-PsExec
Detection: Uploading a malicious binary makes it more susceptible to detection by antivirus or EDR (Endpoint Detection and Response) solutions.
1.4. Differences between PyExec and Impacket-PsExec
No Binary Upload: PyExec does not upload binaries to the remote system, significantly reducing the likelihood of detection by security solutions.
Flexibility: PyExec allows the execution of binaries that already exist on the remote system or even local commands, while Impacket-PsExec depends on the
psexecsvc.exe
binary.Specific Use: PyExec is designed to be stealthier in highly monitored environments, such as in advanced penetration testing or Red Team scenarios.
Features
Remote Command Execution
No Binary Uploads
Executes Local and Remote Binaries
Stealthy Design for Advanced Penetration Testing
Note
This binary has been tested against:
CrowdStrike
BitDefender
Sophos
Trend Micro
Avast, and other antivirus solutions
Successfully bypassing them all.
Last updated