Skip to main content

Unlock the potential of your network with this powerful IPv4 address scanner. Easily scan IP address ranges, identify active hosts, and even extract IPv4 addresses from IPv6 environments. Enhance your network monitoring, troubleshooting, and security analysis!

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 Distribution

snakescan-1.8.3.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

snakescan-1.8.3-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file snakescan-1.8.3.tar.gz.

File metadata

  • Download URL: snakescan-1.8.3.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.5

File hashes

Hashes for snakescan-1.8.3.tar.gz
Algorithm Hash digest
SHA256 8d44a036e8fa7eb17c6b7f1cc2192cab2c05799c8847123eba05df78e7cc526a
MD5 e473e677cfb724a6c96dcb9eb9ca00e8
BLAKE2b-256 e4badd982086c3a4eef83db33fea9b0a40da3c2dca2bcb34339920363717ce64

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for snakescan-1.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0453c118b2514f82765b0a111e6a6a40aef076143b0c27a887b574e3f5762ad9
MD5 1c6b500eb08cfcdc7912d52895e9e07b
BLAKE2b-256 cd8bcfcc1fec4df2cdf9050d134b782d297497e76d736ef7fe812a53539814a2

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