How to do it...

Starting Nmap from Metasploit is easy:

  1. Launch msfconsole and type in nmap to display the list of scan options that Nmap provides:
msf > nmap
  1. The TCP connect [-sT] scan is the most basic and default scan type in Nmap. It follows the three-way handshake process to detect the open ports on the target machine. Let's perform this scan on one of our targets:
msf > nmap -sT 192.168.216.10[*] exec: nmap -sT 192.168.216.10Starting Nmap 7.60 ( https://nmap.org ) at 2017-10-19 08:53 EDTNmap scan report for 192.168.216.10Host is up (0.49s latency).Not shown: 976 closed portsPORT STATE SERVICE22/tcp open ssh135/tcp open msrpc139/tcp open netbios-ssn....49158/tcp open unknown49159/tcp open unknownMAC Address: 00:0C:29:38:B3:A9 (VMware) ...

Get Metasploit Penetration Testing Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.