- Nmap 6:Network exploration and security auditing Cookbook
- Paulino Calderon Pale
- 403字
- 2021-08-05 18:31:03
Comparing scan results with Ndiff
Ndiff was designed to address the issues of using diff with two XML scan results. It compares files by removing false positives and producing a more readable output, which is perfect for anyone who needs to keep a track of the scan results.
This recipe describes how to compare two Nmap scans to detect the changes in a host.
Getting ready
Ndiff requires two Nmap XML files to work, so make sure you have previously saved the scan results of the same host. If you haven't, you can always scan your own network, deactivate a service, and scan again to get these two test files. To save the results of an Nmap scan into an XML file use -oX <filename>
.
How to do it...
- Open your terminal.
- Enter the following command:
$ ndiff FILE1 FILE2
- The output returns all the differences between
FILE1
andFILE2
. New lines are shown after a plus sign. The lines that were removed onFILE2
are displayed after a negative sign.
How it works...
Ndiff uses the first file as a base to compare against the second one. It displays the state differences for host, port, services, and OS detection.
There's more...
If you prefer Zenmap, you can use the following steps instead:
- Launch Zenmap.
- Click on Tools on the main toolbar.
- Click on Compare Results (Ctrl + D).
- Select the first file by clicking on Open in the section named A scan.
- Select the second file by clicking on Open in the section named B scan.
A human readable format is returned by default. However, Ndiff can return the differences in XML format, if preferred, by using the flag --xml
.
See also
- The Monitoring servers remotely with Nmap and Ndiff recipe
- The Managing multiple scanning profiles with Zenmap recipe
- The Geo-locating an IP address recipe in Chapter 3, Gathering Additional Host Information
- The Getting information from WHOIS records recipe in Chapter 3, Gathering Additional Host Information
- The Fingerprinting the operative system of a host recipe in Chapter 3, Gathering Additional Host Information
- The Discovering UDP services recipe in Chapter 3, Gathering Additional Host Information
- The Detecting possible XST vulnerabilities recipe in Chapter 4, Auditing Web Servers
- DevSecOps敏捷安全
- CTF實戰:技術、解題與進階
- Securing Blockchain Networks like Ethereum and Hyperledger Fabric
- 黑客大曝光:無線網絡安全(原書第3版)
- 工業物聯網安全
- Testing and Securing Android Studio Applications
- 解密彩虹團隊非凡實戰能力:企業安全體系建設(共5冊)
- Falco云原生安全:Falco原理、實踐與擴展
- 信息安全等級保護測評與整改指導手冊
- 信息安全導論(第2版)
- Kali Linux高級滲透測試(原書第4版)
- 華為Anti-DDoS技術漫談
- 交換機·路由器·防火墻(第2版)
- Web安全攻防從入門到精通
- Android Application Security Essentials