![Kali Linux:An Ethical Hacker's Cookbook](https://wfqqreader-1252317822.image.myqcloud.com/cover/618/36700618/b_36700618.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it...
The following is the recipe for using Nmap:
- Nmap is already installed in Kali Linux. We can type the following command to start it and see all the options available:
nmap -h
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/364BC0/19470402501612306/epubprivate/OEBPS/Images/045da05e-ce64-4018-b197-2c5c551809e6.png?sign=1738955840-nKUXCt8CLNFdCCwrWwSkvrKv94Sh3DNr-0-148a8729c4224ecce0adc155c3c8e008)
- To perform a basic scan we use the following command:
nmap -sV -Pn x.x.x.x
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/364BC0/19470402501612306/epubprivate/OEBPS/Images/3273298a-1a37-4b34-ac5f-a459ff060532.png?sign=1738955840-wClVd9aJ1N54GQkodsRizB2TO3j5qYyH-0-8f7245040f26f47f29bb9cf89e80e08e)
- -Pn implies that we do not check whether the host is up or not by performing a ping request first. The -sV parameter is to list all the running services on the found open ports.
- Another flag we can use is -A, which automatically performs OS detection, version detection, script scanning, and traceroute. The command is:
nmap -A -Pn x.x.x.x
- To scan an IP range or multiple IPs, we can use this command:
nmap -A -Pn x.x.x.0/24