Skip to main content

IPv4 address scanner for collecting address information.Scan or get the IPv4 address from the IPv6 host

Project description

🐍 SnakeScan: Reliable Port Scanner in Python

A versatile and efficient Python library designed for comprehensive network port scanning.

PyPI

MIT License

Python 3.7+

Status: Stable

SnakeScan provides a flexible and powerful solution for network administrators, security professionals, and developers who need robust port scanning capabilities. From basic port checking to advanced, multi-threaded subnet analysis, SnakeScan provides the tools you need for effective network assessment.

Important Note: The following documentation describes potential features that are partially implemented in SnakeScan. Functionality related to custom port dictionaries is available, but has narrowly specialized implementations in its current state. Descriptions here are intended to demonstrate a more complete implementation and may not fully match the library's current narrowly specialized capabilities.

⚙️ Key features:

  • Flexible port specification: Define target ports as individual values, ranges, or via pre-configured sets.

  • Multi-threaded architecture: Accelerate scanning operations with parallel processing for rapid analysis.

  • IP address information retrieval: Obtain detailed information about target IP addresses, supporting both IPv4 and IPv6.

  • Real-time port monitoring: Use the Watcher class to continuously monitor the status of important ports.

  • Concise command-line interface and API: Easily integrate SnakeScan into workflows via command-line or programmatic access.

  • UDP port scanning: Built-in support for scanning UDP ports.

  • Customizable port dictionaries: Add your own port descriptions from JSON files and easily revert to the default set. (Functionality is present, has narrowly specialized implementations. See details below).

⬇️ Installation:

Install SnakeScan using pip:

bash

pip install SnakeScan

⌨️ Command-line usage:

💡 Attribute reference:

  • -p: Specify target ports to scan (single port or range). Note: Range excludes the lower bound in the first entry. For example: To scan from port 80 to 443 specify the range as 79-443. Examples: snake -p 80,443 or snake -p 80,3437,8080,20-30,79-443

  • -u: Enable UDP port scanning. Example: snake -p 53 -u

  • -h: Show the full list of available command-line attributes and their descriptions. Example: snake -h or snake -help

  • -sp: Start scanning using the predefined common port set with ProcessPoolExecutor. Example: snake -sp

  • -v: Display the current version of the SnakeScan library. Example: snake -v

  • -gs: Retrieve the SSL/TLS certificate from the specified web server. Example: snake www.google.com -gs (Requires a valid hostname to avoid connection errors.)

  • -t: Enable multi-threading to improve scanning performance. Example: snake -t

  • -ch: Scan a subnet to discover active IP addresses on the network. Example: snake -ch

  • -l: Display your public IP address (requires active internet connection). Example: snake -l

  • -i: Show detailed information about a specific IP address (supports both IPv4 and IPv6). Example: snake www.google.com -i

  • -d: Specify the path to a JSON file containing TCP port definitions, and optionally a path to a second JSON file containing UDP port definitions. Note: When using this argument for the first time, the paths to the JSON files must be specified with each command execution, separated by a comma. After the first use, SnakeScan may remember these paths for subsequent scans. Functionality is present, has narrowly specialized implementations. See details below.

    Example: snake -d /путь/к/tcp_ports.json,/путь/к/udp_ports.json (if you want to specify both TCP and UDP, if TCP only: snake -d /путь/к/tcp_ports.json)

    Subsequent Use: After initial use, you can simply use the -d flag without file paths and SnakeScan may use previously defined JSON files. Functionality is present, has narrowly specialized implementations. See details below.

    Example (after initial setup): snake -d (may use previously saved paths)

    JSON file format: The JSON file must be formatted as a dictionary where the keys are port numbers (as strings) and the values are the corresponding service names or descriptions.

    {
    
        "53": "DNS",
    
        "80": "HTTP",
    
        "443": "HTTPS"
    
    }
    
  • -dr: Reset custom port dictionaries to their default state and revert to the standard SnakeScan port definitions. This functionality relies on internal mechanisms that are still under development. Functionality is present, has narrowly specialized implementations. See details below. Example: snake -dr

💻 Python Code Integration:

⏱️ Watcher class: Real-time port status

The Watcher class allows you to continuously monitor the specified port.

python

from SnakeScan import Watcher

watcher = Watcher("localhost", 53, 2) # Host, port, check interval (in seconds)

watcher.start() # Start monitoring!

Watcher Methods:

  • Watcher.start() - Start the port monitoring process.

  • Watcher.stop() - End the port monitoring process.


Last updated: 1.8.1 (Added initial support for custom port dictionaries and standard SnakeScan ports. Note: This functionality is still under development and may exhibit unexpected behavior.) Functionality is present, has narrowly specialized implementations. See details below.


Details on the narrowly specialized functionality of custom port dictionaries:

  • The -d flag can load port definitions from a JSON file.

  • The -dr flag attempts to revert to the default port definitions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snakescan-1.8.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file snakescan-1.8.1-py3-none-any.whl.

File metadata

  • Download URL: snakescan-1.8.1-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for snakescan-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1001f5b5c940f1044b2fb6f6c1213da822773d5872d275ed03ee8d0222a4ba2b
MD5 d7208b81a675c2c17735a0cdf6cb82a6
BLAKE2b-256 31e3c1c57c1a2045d43a3a9366bedc48f63bc0098fd275251584988b012f7048

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page