π Advanced Nmap Service Scanner – Bash Script
This blog post introduces a powerful Bash script designed to automate and streamline network service scanning using Nmap. The script uses service-specific plugins, checks only open ports, logs results with timestamps, and outputs color-coded terminal feedback.
π View it on GitHub: github.com/ElusiveHacker/Tanker
π Features
- ✅ Scans only open ports for efficiency
- π Uses Nmap plugins/scripts tailored to each service
- π¨ Color-coded terminal output:
- π‘ Yellow for open ports
- π΅ Blue for closed/filtered ports
- π Start and end time displayed and logged
- π Total scan duration shown in the report
- π️ Full report saved in
scan_report.txt
⚙️ Requirements
- A Linux/Unix system with
bash
installed - Nmap installed and in your
$PATH
π¦ Services Scanned
The script includes a pre-configured list of commonly scanned services:
Service | Port | Protocol | Nmap Script(s) |
---|---|---|---|
telnet | 23 | TCP | telnet-ntlm-info |
ssh | 22 | TCP | ssh2-enum-algos |
msrpc | 135 | TCP | msrpc-enum |
nbstat | 137 | TCP | nbstat |
ldap | 389 | TCP | ldap-rootdse |
http | 80 | TCP | http-headers |
smtp | 25 | TCP | smtp-open-relay, smtp-strangeport |
wsman | 5985 | TCP | http-headers |
π ️ How to Use
1️⃣ Give execute permission and run the script:
chmod +x nmap_service_scanner.sh
./nmap_service_scanner.sh
2️⃣ When prompted, enter a valid IP or CIDR:
Enter an IP address or CIDR range: 192.168.1.0/24
π Output & Report
- π₯️ Terminal output is color-coded for quick review
- π All detailed results (including plugin output) are saved to
scan_report.txt
- ⏱️ Includes:
- Start time
- End time
- Total duration in seconds
π Notes
➡️ UDP scans are slower and depend on the defined services. You can extend or modify the service list directly inside the script.
π§π» About
This tool was developed to simplify focused Nmap scanning for sysadmins, security testers, and red teams. Feel free to fork, improve, or suggest enhancements!
π GitHub Repository: github.com/ElusiveHacker/Tanker
π License
This project is licensed under the MIT License.