When conducting network reconnaissance or penetration testing, efficiency is key. NmapAutomator is a powerful tool that automates and streamlines the process of network scanning, allowing security professionals to focus on actual penetration testing rather than spending time on repetitive scanning tasks. This comprehensive guide on Network Reconnaissance explores what NmapAutomator is, how to set it up, and how to effectively use it for various scanning scenarios. NmapAutomator is a POSIX-compatible shell script designed to automate various types of network scanning tasks. As the name suggests, it’s built on top of the popular Nmap scanning tool but extends its functionality by integrating multiple other security tools like Nikto, GoBuster, and more.
The main goal of this script is to automate the process of enumeration and reconnaissance that is run every time, allowing security professionals to focus their attention on real penetration testing.
NmapAutomator ensures two important benefits:
This means that once initial ports are found (typically in 5-10 seconds), you can start manually investigating those ports while letting the rest of the scanning run in the background with no further interaction required.
NmapAutomator Network Reconnaissance offers various scan types to suit different needs:
It’s important to note that NmapAutomator is a reconnaissance tool and does not perform any exploitation.
With the recon option, NmapAutomator automatically recommends and runs the best reconnaissance tools for each discovered port. If a recommended tool is missing from your system, NmapAutomator will suggest how to install it.
NmapAutomator is 100% POSIX compatible, allowing it to run on any sh shell and any Unix-based machine (even a 10-year-old router). This makes NmapAutomator ideal for lateral movement reconnaissance.
If you want to run NmapAutomator on a remote machine, you can download a static Nmap binary and transfer it to the remote machine. You can then use the -s/–static-nmap option to specify the path to the static Nmap binary.
NmapAutomator offers a Remote Mode (activated with the -r/–remote flag) designed to run using POSIX shell commands only, without relying on external tools. This mode is still under development, with certain scan types currently supported.
Before we can use NmapAutomator, we need to install it and its dependencies.
NmapAutomator requires certain tools like ffuf, which can be installed with:
sudo apt update sudo apt install ffuf -y
Alternatively, you can use Gobuster (v3.0 or higher):
sudo apt update sudo apt install gobuster -y
Other reconnaissance tools used by NmapAutomator include:
Most of these tools should be installed by default in Parrot OS and Kali Linux. If any recommended tool is missing, NmapAutomator will automatically omit it and notify the user.
To install NmapAutomator, run the following commands:
git clone https://github.com/21y4d/nmapAutomator.git sudo ln -s $(pwd)/nmapAutomator/nmapAutomator.sh /usr/local/bin/
To ensure full functionality, especially for the Vulnerability scan mode, you should install additional components:
tar -C /usr/local -xzf go1.13.6.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go get github.com/OJ/gobuster
apt install libwhisker2-perl nikto
git clone https://github.com/vulnersCom/nmap-vulners.git cp *.nse /usr/share/nmap/scripts nmap --script-updatedb
To see all available options, run:
./nmapAutomator.sh -h
This will display the usage information:
Usage: nmapAutomator.sh -H/--host <TARGET-IP> -t/--type <TYPE> Optional: [-r/--remote <REMOTE MODE>] [-d/--dns <DNS SERVER>] [-o/--output <OUTPUT DIRECTORY>] [-s/--static-nmap <STATIC NMAP PATH>]
Here are some example commands:
./nmapAutomator.sh --host 10.1.1.1 --type All ./nmapAutomator.sh -H 10.1.1.1 -t Basic ./nmapAutomator.sh -H academy.htb -t Recon -d 1.1.1.1 ./nmapAutomator.sh -H 10.10.10.10 -t network -s ./nmap
Let’s explore some practical use cases for NmapAutomator.
When you need to quickly check a web server, the Port scan type is ideal:
./nmapAutomator.sh 192.168.1.10 Port
This will identify open ports within seconds, allowing you to immediately start investigating while more detailed scans run in the background.
For a thorough security assessment, the All scan type provides comprehensive coverage:
./nmapAutomator.sh 192.168.1.10 All
This will run all available scan types, providing a complete picture of the target’s security posture. The scan takes about 20-30 minutes but delivers extensive results.
When specifically looking for vulnerabilities, use the Vulns scan type:
./nmapAutomator.sh 192.168.1.10 Vulns
This performs a CVE scan and Nmap Vulns scan on all discovered ports, helping identify potential security issues.
For detailed information about services running on a target, use the Script scan type:
./nmapAutomator.sh 192.168.1.10 Script
This runs script scans on discovered ports, providing detailed information about running services.
If you’re on a system where you don’t have sudo privileges, you can still run most scan types except UDP:
./nmapAutomator.sh 192.168.1.10 Full
If you need to scan from a remote system with limited tools, use the Remote Mode:
./nmapAutomator.sh -H 192.168.1.10 -t Port -r
This uses POSIX shell commands only, making it suitable for systems with limited tool availability.
While NmapAutomator is a powerful tool, it’s important to be aware of its limitations:
NmapAutomator is an excellent tool for security professionals and enthusiasts looking to streamline their reconnaissance process. By automating common scanning tasks, it allows you to focus on analyzing results and actual penetration testing rather than manually running multiple commands. Whether you’re conducting a quick check or a comprehensive security assessment, NmapAutomator provides options to suit your needs. Its POSIX compatibility makes it versatile across different systems, and its integration with other security tools enhances its capabilities beyond basic port scanning. By incorporating NmapAutomator into your security toolkit, you can significantly increase your efficiency and effectiveness in discovering and assessing potential security vulnerabilities.