🔍 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.