pynmap is a Python script that wraps Nmap to perform network scans on IP ranges or CIDR notations, with options for scanning specific ports and additional Nmap options. The results are saved to individual files named after each IP address.
Features
- Scan single IP addresses or IP ranges in CIDR notation.
- Scan specific ports or all ports (
-p-
). - Pass additional Nmap options to customize the scan.
- Save scan results to files named after each IP address.
Prerequisites
- Nmap: Ensure Nmap is installed on your system. You can check if it’s installed by running
nmap --version
in your terminal. - Python 3.12: This script is compatible with Python 3.12.
Installation
- Install Nmap: Follow instructions from the Nmap official website to install Nmap on your system.
- Install Python Dependencies: The script uses Python’s
subprocess
module, which is part of the standard library, so no additional Python packages are required.
Usage
Command-Line Arguments
ip_range
: The IP address range or CIDR notation to scan (e.g.,192.168.1.1-192.168.1.10
or192.168.1.0/24
).--port_range
: The port range to scan (e.g.,22-80
). Default is-p-
for scanning all ports.--options
: Additional Nmap options (e.g.,-sS -T4
).
Examples
- Scan a specific IP range with a custom port range and Nmap options:
- Scan an IP range with default port range (all ports) and custom Nmap options::
- Scan a single IP address with default port range and no additional options::
Project Links
- GitHub Repository: https://github.com/xyligo/pynmap
- Documentation: Available in the repository with detailed guides and examples.
Contributing
Contributions are welcome! You can contribute by:
- Reporting bugs and issues
- Suggesting new features
- Submitting pull requests
For more details, please refer to the contribution guidelines on the GitHub repository.
License
Pynmap is licensed under the MIT License. See the LICENSE file for more information.