The Port Scanner Framework is a Python-based tool that performs port scanning and OS detection on target systems. It allows you to scan multiple targets, specify port ranges, and perform OS detection if needed.
- Port scanning: Scans specified targets for open ports.
- Port ranges: Supports specifying individual ports, multiple ports, and port ranges.
- OS detection: Provides the option to perform OS detection during the scan.
- Colorful output: Highlights scan results and detected OS information with colors.
- Tabulated results: Displays scan results and detected OS in a formatted table.
- JSON input: Accepts a JSON file as input with targets, ports, and OS parameters.
- Root privilege check: Validates if the scanner is running as root (superuser).
- Python 3.x
- nmap module (pip install python-nmap)
- colorama module (pip install colorama)
- tabulate module (pip install tabulate)
- Clone the repository:
git clone https://github.com/lilocruz/portscanner-framework
- Install the dependencies
pip install -r requirements.txt
- Create a JSON file with the targets to scan
[
{
"target": "192.168.1.1",
"ports": ["80", "443", "8080-8090"],
"os_detection": true
},
{
"target": "192.168.1.2",
"ports": ["22", "3389"],
"os_detection": false
}
]
- Run the scanner
sudo python psf.py -h
usage: psf.py [-h] [-f FILE] [-t TARGET] [-p PORTS]
Port Scanner Framework by Michael Cruz Sanchez
options:
-h, --help show this help message and exit
-f FILE, --file FILE JSON file containing targets, ports, and OS parameters
-t TARGET, --target TARGET
Target IP address
-p PORTS, --ports PORTS
Ports to scan (e.g., 80,443 or 1-1024)
sudo python psf.py -f file.json
sudo python psf.py -t 192.168.1.2 -p 22
sudo python psf.py -t 192.168.1.2 -p 1-100
- View the scan results The scan results will be displayed in the console, providing information about open ports, detected OS, and any vulnerabilities found.
Scanning target: <IP>
Open ports found on <IP>:
╒════════╤═══════════╕
│ Port │ Service │
╞════════╪═══════════╡
│ 22 │ ssh │
├────────┼───────────┤
│ 80 │ http │
╘════════╧═══════════╛
Scanning target: <IP>
Open ports found on <IP>:
╒════════╤═══════════╕
│ Port │ Service │
╞════════╪═══════════╡
│ 22 │ ssh │
╘════════╧═══════════╛
Detected OS:
╒══════════════════╤════════════╕
│ OS │ Accuracy │
╞══════════════════╪════════════╡
│ Linux 4.15 - 5.6 │ 100 │
╘══════════════════╧════════════╛
This project is licensed under the GPLv3+ License.