Skip to content

Latest commit

 

History

History
121 lines (88 loc) · 3.3 KB

README.md

File metadata and controls

121 lines (88 loc) · 3.3 KB

Port Scanner Framework

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.

Features

  • 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).

Prerequisites

  • Python 3.x
  • nmap module (pip install python-nmap)
  • colorama module (pip install colorama)
  • tabulate module (pip install tabulate)

Usage

  1. Clone the repository:
git clone https://github.com/lilocruz/portscanner-framework
  1. Install the dependencies
pip install -r requirements.txt
  1. 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
  }
]
  1. 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
  1. View the scan results The scan results will be displayed in the console, providing information about open ports, detected OS, and any vulnerabilities found.

Sample Output

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 │
╘══════════════════╧════════════╛

License

This project is licensed under the GPLv3+ License.