Skip to content

Port scanner fremework is port scanner written in python that uses the nmap module to facilitate the process of learning port scanning and network programming in Python.

Notifications You must be signed in to change notification settings

lilocruz/portscanner-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Port scanner fremework is port scanner written in python that uses the nmap module to facilitate the process of learning port scanning and network programming in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages