Metasploit scanners
TCP port scanner
use auxiliary/scanner/portscan/tcp
set RHOSTS 192.180.108.3
set verbose false
set ports 1-1000
exploit
Upload a Nmap Binary and use it to scan the target
Check the static binaries available in the "/usr/bin/" directory.
Command:

Step 1: Background the Metasploit session and create a bash port scanning script.
Press CTRL+z to background the Metasploit session.
Using the script provided at [https://catonmat.net/tcp-port-scanner-in-bash] as a reference, create a bash script to scan the first 1000 ports
Command:
Save the script as bash-port-scanner.sh

Step 2: Foreground the Metasploit session and switch to the meterpreter session.
Press "fg" and press enter to foreground the Metasploit session.
Command:

Step 3: Upload the nmap static binary and the bash port scanner script to the target machine.
Command:

Step 4: Make the binary and script executable and use the bash script to scan the second target machine.
Command:

Three ports are open on the target machine, ports 21, 22 and 80.
Step 5: Using the nmap binary, scan the target machine for open ports.
Command:

The services running on the target machine are FTP, SSH and HTTP.
Last updated