![Kali Linux:An Ethical Hacker's Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/772/36698772/b_36698772.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it...
Let's perform the following steps:
- Nmap is already installed in Kali Linux. We can type the following command to start it and see all the options that are available:
nmap -h
The following screenshot shows the output of the preceding command:
![](https://epubservercos.yuewen.com/E581D7/19470380608818806/epubprivate/OEBPS/Images/87c79e93-a725-4548-a356-46ce4051398a.png?sign=1739282605-yUh36yvS9a9zSuUSP2utJPQlzLBapIOP-0-ec4de9159f293d8df81381396e21c50f)
- To perform a basic scan, we can 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/E581D7/19470380608818806/epubprivate/OEBPS/Images/c984cebf-2d7f-498c-96b4-d1299f3f0b93.png?sign=1739282605-5fRxzZuTk09mNkVTQSYu7kXMzrx8fFZC-0-944e60bfe48a25db3c505a445305b879)
Here, -Pn implies that we do not check whether the host is up or not by performing a ping request first; -sV is used to list all the running services on the open ports that we found.
- Another flag we can use is -A. This automatically performs OS detection, version detection, script scanning, and traceroute. The command is as follows:
nmap -A -Pn x.x.x.x
- To scan an IP range or multiple IPs, we can use the following command:
nmap -A -Pn x.x.x.0/24