The Python Nmap Tool is a command-line utility designed for educational purposes to demonstrate how to interact with nmap using Python. By utilizing the python-nmap library, this tool allows users to perform various network scans to identify open ports, detect vulnerabilities, and monitor network health. This README will guide you through the installation, usage, and functionality of the tool.
- IP Scanner: Scan individual IP addresses or ranges for open ports.
- Security Vulnerability Scanner: Identify potential security vulnerabilities on a specified IP address.
- Custom Service Detection Tool: Detect specific services running on an IP address.
- Network Health Monitor: Evaluate the health of a network by scanning an IP range.
To get started with the Python Nmap Tool, follow these steps:
-
Clone the Repository
Clone the repository to your local machine using Git:
git clone https://github.com/AbdullahZeynel/Python-nmap.git cd Python-nmap -
Create and Activate a Virtual Environment
It is highly recommended to use a virtual environment to manage dependencies:
python3 -m venv myenv source myenv/bin/activate # On Windows, use `myenv\Scripts\activate`
-
Install Required Packages
Install the necessary Python packages listed in
requirements.txt:pip install -r requirements.txt
To use the Python Nmap Tool, follow these instructions:
-
Run the Tool
Execute the tool using Python:
python nmapPython.py
-
Main Menu Options
After running the tool, you will be presented with the main menu. Here’s a breakdown of each option:
- IP Scanner: This option allows you to scan for open ports on a single IP address, an IP range, or specific ports.
- Security Vulnerability Scanner: Use this to check for known security vulnerabilities on an IP address.
- Custom Service Detection Tool: Detect and report on specific services running on an IP address.
- Network Health Monitor: Assess the health of a network by scanning a range of IP addresses.
-
Scan a Single IP Address
- Prompt: Enter the IP address to scan.
- Description: Scans ports 1-1024 on the specified IP address. This is useful for identifying which ports are open and potentially vulnerable on a single machine.
Enter the IP address to scan: 192.168.1.1 -
Scan an IP Range
- Prompt: Enter the IP range in the format
startIP-endIP. - Description: Scans all IP addresses within the specified range for open ports. This can help in identifying vulnerabilities across a subnet.
Enter the IP range to scan (e.g., 192.168.1.1-192.168.1.10): 192.168.1.1-192.168.1.10 - Prompt: Enter the IP range in the format
-
Scan Specific Ports
- Prompt: Enter the IP address and the ports to scan.
- Description: Scans specific ports on the given IP address. Useful for targeting particular services or vulnerabilities.
Enter the IP address to scan: 192.168.1.1 Enter the ports to scan (e.g., 22, 80, 443): 22,80,443 -
Security Vulnerability Scan
- Prompt: Enter the IP address to scan for vulnerabilities.
- Description: Uses
nmap's vulnerability scanning scripts to identify known security issues on the IP address.
Enter the IP address to scan for vulnerabilities: 192.168.1.1 -
Custom Service Detection
- Prompt: Enter the IP address and services to detect (comma-separated).
- Description: Detects specified services running on the IP address. The services are identified using
nmap's script engine.
Enter the IP address to detect services: 192.168.1.1 Enter the services to detect (comma-separated, e.g., http, ftp): http,ftp -
Network Health Monitoring
- Prompt: Enter the IP range to monitor network health.
- Description: Checks the network health of the specified IP range using
nmap's network health script.
Enter the IP range to monitor network health (e.g., 192.168.1.1-192.168.1.10): 192.168.1.1-192.168.1.10
- Permissions: Ensure you have the appropriate permissions to scan the networks or IP addresses. Unauthorized scanning can be illegal and unethical.
- Usage: This tool is intended for educational purposes to help understand
nmapfunctionality through Python. Always use it responsibly. - Dependencies: The tool relies on
python-nmapandnmapitself. Make surenmapis installed on your system.