Metasploit can not only use the third-party scanner nmap, etc., in its auxiliary module also contains several built-in port scanners.
View the port scanning tools provided by the Metasploit framework:
msf > Search portscanmatching modules================ Name Disclosure Date Rank Description----------- -----------------------auxiliary/scanner/http/wordpress_pingback_access normal WordPress PINGB Ack Locator auxiliary/scanner/natpmp/natpmp_portscan normal NAT-PMP External Port scanner A Uxiliary/scanner/portscan/ack normal TCP ack Firewall scanner Auxiliary/scanner/por Tscan/ftpbounce normal FTP Bounce Port Scanner Auxiliary/scanner/portscan/syn Normal TCP SYN Port Scanner auxiliary/scanner/portscan/tcp Normal TCP port Scanner auxiliary/scanner/portscan/xmas normal TCP "Xmas" Port Sca Nner
Use Metasploit's SYN port scanner to perform a simple scan of a single host:
MSF > Use Scanner/portscan/syn
Set the Rhost parameter to 192.168.119.132, the number of threads is 50
RHOSTS = 192.168.119.132msf auxiliary (SYN) > Set THREADS 50THREADS = 50msf auxiliary (SYN) > run[*] TCP OPEN 192.168.119.132:80[*] TCP Open 192.168.119.132:135[*] TCP open 192.168.119.132:139[*] TCP open 192.168.119.132:1433[*] TCP Open 192.168.119.132:2383[*] TCP open 192.168.119.132:3306[*] TCP Open 192.168.119.132:3389[*] scanned 1 of 1 hosts ( 100% complete) [*] Auxiliary module execution completed