Skip to content

A simple Python-based TCP port scanner that allows you to scan one or more target IP addresses or domain names for open ports within a specified range. This tool provides information about open ports, including service banners and potential vulnerabilities.

Notifications You must be signed in to change notification settings

pannagkumaar/PortScanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Port Scanner

A simple Python-based TCP port scanner that allows you to scan one or more target IP addresses or domain names for open ports within a specified range. This tool provides information about open ports, including service banners and potential vulnerabilities.

Table of Contents

Features

  • Scan one or more target IP addresses or domain names for open ports.
  • Specify a port range to scan or scan all available ports.
  • Retrieve service banners and service versions for open ports.
  • Detect known vulnerabilities for specific services (e.g., FTP, SSH).
  • Multithreaded scanning for faster results.
  • Save scan results to a JSON file.
  • Optional verbose output.

Tech Stack

This project is built using the following technologies and Python libraries:

  • Python 3.x: The core programming language used for development.
  • argparse: Python library for parsing command-line arguments.
  • socket: Python library for low-level network programming.
  • threading: Python library for multithreading.
  • json: Python library for working with JSON data.
  • tqdm: Python library for displaying progress bars.
  • termcolor: Python library for adding color to terminal text.
  • IPython: Interactive computing in Python (for interactive use, not required for the core functionality).

These libraries and tools are used to create a robust and efficient port scanning utility that simplifies the process of identifying open ports and gathering information about the services running on them.

Getting Started

Prerequisites

  • Python 3.x
  • pip (Python package manager)

Installation

  1. Clone the repository:

    git clone https://github.com/pannagkumaar/PortScanner.git
    
  2. Navigate to the project directory:

    cd port-scanner
  3. Install the required Python packages:

    pip install -r requirements.txt 

Usage

python port_scanner.py -t <targets> [-p <port-range>] [-T <timeout>] [-n <num-threads>] [-o <output>] [-v]

Options

  • -t, --targets: Specify the target IP addresses or domain names (required).
  • -p, --port-range: Specify the port range to scan (e.g., 1-100 or all). Default is 1-100.
  • -T, --timeout: Specify the timeout value in seconds. Default is 1.0 seconds.
  • -n, --num-threads: Specify the number of threads to use for scanning. Default is 10.
  • -o, --output: Specify an output file to save results to (e.g., output.json).
  • -v, --verbose: Enable verbose output.

Examples

  1. Scan a single target for open ports (default port range):
python port_scanner.py -t 192.168.1.1
  1. Scan multiple targets with a custom port range and save results to a file:
 python port_scanner.py -t example.com 192.168.1.1 -p 1-65535 -o results.json
  1. Enable verbose output:
python port_scanner.py -t 192.168.1.1 -v

Purpose

The purpose of this project is to provide a simple yet effective TCP port scanning tool that allows users to scan one or more target IP addresses or domain names for open ports. It is designed to be versatile, fast, and informative, providing essential information about open ports, service banners, and potential vulnerabilities. Whether you are a network administrator, a security professional, or a curious individual, this tool can help you identify open ports on your network and gather valuable insights about the services running on them.

About

A simple Python-based TCP port scanner that allows you to scan one or more target IP addresses or domain names for open ports within a specified range. This tool provides information about open ports, including service banners and potential vulnerabilities.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages