Production-ready pentest recon CLI — speed first.
Project description
NetScout
Production-ready pentest recon CLI — speed first.
NetScout is a fast, async network reconnaissance tool designed for penetration testers and security professionals. It discovers live hosts, checks ports, grabs banners, fingerprints OS, and exports results — all with minimal packets and maximum parallelism.
Features
- Blazing fast — async I/O with semaphore-gated concurrency (default 150 threads)
- Multi-CIDR input — CIDR, single IP, ranges, hostnames, file input, or interactive prompt
- Smart discovery — nmap ping sweep (preferred) with asyncio TCP/ICMP fallback
- Port scanning — async TCP connect with banner grabbing
- OS fingerprinting — zero-cost TTL heuristic + optional deep nmap -O
- Service detection — nmap -sV with intensity 0 (single probe per port)
- Script scanning — nmap default scripts on demand
- Rich terminal UI — live progress dashboard with hacker aesthetics
- Multi-format export — txt, json, csv, gnmap (auto-detected from extension)
- Graceful degradation — works without nmap, without root, behind firewalls
Installation
The easiest way to install and configure netscout (and its dependencies like nmap) on macOS and Linux is using our automated script:
curl -sL https://raw.githubusercontent.com/RamKansal/netscout/main/install.sh | bash
Alternatively, you can manually use pipx (Recommended for Linux) or pip:
# Recommended for modern Linux (Ubuntu 24.04+, Debian 12+)
pipx install netscout
pip install -U netscout
Requirements
- Python ≥ 3.10
- nmap (optional but recommended for full functionality)
Quick Start
# Scan a single subnet
netscout 10.10.10.0/24
# Multiple ranges with port check
netscout 10.10.10.0/24 172.20.0.0/16 --port 22 80 443 8080
# Fast enum (OS + banner + DNS, zero extra packets)
netscout 192.168.1.0/24 --enum
# Deep scan with export
netscout 10.10.10.0/24 --deep --fast -o results.json
# Read targets from file
netscout --targets-file ranges.txt --enum -o scan.csv
# Interactive mode (no args)
netscout
Usage
netscout [OPTIONS] [TARGET ...]
Targets (positional, or interactive prompt if omitted):
10.10.10.0/24 Single CIDR
10.10.10.0/24 172.20.0.0/16 Multiple CIDRs
10.10.10.1-50 Range shorthand
10.10.10.5 Single IP
--targets-file FILE One target per line
Discovery:
--tcp TCP fallback for ICMP-dark hosts
--ports TEXT Ports for TCP fallback probe (default: 22,80,443,445,3389)
--threads INT Concurrent threads (default: 150)
--timeout FLOAT Timeout per probe in seconds (default: 1.0)
--fast Use nmap T5 + max-parallelism (fastest, noisier)
Enumeration:
--port INT [INT ...] Check if specific port(s) are open on live hosts
--os Guess OS via TTL (zero extra packets)
--services Service version detection (nmap -sV intensity 0)
--scripts Run nmap default scripts (slow, explicit only)
--enum All fast enum: OS + banner + DNS (recommended)
--deep Full nmap -O -sV on live hosts (slowest, most info)
Output:
-o, --output FILE Save results (auto-format: .txt .json .csv .gnmap)
--no-color Disable colors (for piping)
-v, --verbose Show dead hosts
-q, --quiet Only print IP:PORT, no UI chrome
--no-banner Suppress ASCII banner
--force Scan ranges > 65536 hosts
Architecture
netscout/
├── main.py # CLI entrypoint + interactive prompt
├── scanner.py # Async ping sweep + TCP SYN probe
├── cidr.py # Multi-CIDR parsing, expansion, dedup
├── enumerator.py # Port check, OS fingerprint, banner grab
├── resolver.py # DNS forward/reverse with cache
├── output.py # Rich terminal UI: live dashboard, summary
├── exporter.py # txt / json / csv / gnmap output
├── tests/
├── pyproject.toml
└── README.md
Speed Optimizations
- Single nmap call per phase — never loops nmap per-host
- Semaphore-gated async for all socket ops
- Zero duplicate probes — cached results, never re-probe same IP
- Randomised scan order — shuffles IPs to evade rate limiting
- Connect timeout 0.5s for TCP port checks
- Batch hostname resolution before scan starts
- Progress bar at max 20fps — rendering never slows down scanning
Graceful Degradation
| Condition | Behaviour |
|---|---|
| No nmap | Warns once, falls back to asyncio TCP/ICMP |
| No root/sudo | Skips raw socket features, uses connect() |
| ICMP blocked | Auto-enables TCP fallback silently |
| KeyboardInterrupt | Prints partial results + summary, clean exit |
| All errors | Go to stderr; results to stdout (pipeable) |
Output Formats
Quiet mode (-q)
10.10.10.5:22
10.10.10.5:80
10.10.10.12:445
JSON (-o results.json)
{
"total_hosts": 256,
"alive_hosts": 12,
"results": [
{
"ip": "10.10.10.5",
"hostname": "htb-target.local",
"os_guess": "Linux/Unix",
"open_ports": [22, 80, 443],
"ports": {
"22": {"state": "open", "service": "ssh", "banner": "SSH-2.0-OpenSSH_8.9"}
}
}
]
}
Development
pip install -e ".[dev]"
pytest --cov=netscout
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netscout-1.1.7.tar.gz.
File metadata
- Download URL: netscout-1.1.7.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
953d759d07521b81d4b9b5f1a97fd8dcfdd3313ba34ad4ad0113df45b5ea1b4a
|
|
| MD5 |
c0a001617d25b91747b1c13cb83e6079
|
|
| BLAKE2b-256 |
32a050aa2d6acdb3bdeeb460a99561ddced3bcb151fbd89a9043a8601a5dcf3d
|
Provenance
The following attestation bundles were made for netscout-1.1.7.tar.gz:
Publisher:
publish.yml on RamKansal/netscout
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netscout-1.1.7.tar.gz -
Subject digest:
953d759d07521b81d4b9b5f1a97fd8dcfdd3313ba34ad4ad0113df45b5ea1b4a - Sigstore transparency entry: 1235756527
- Sigstore integration time:
-
Permalink:
RamKansal/netscout@03330568b8009c429dd4c38bb27120f5dbfaecb5 -
Branch / Tag:
refs/tags/v1.1.7 - Owner: https://github.com/RamKansal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03330568b8009c429dd4c38bb27120f5dbfaecb5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file netscout-1.1.7-py3-none-any.whl.
File metadata
- Download URL: netscout-1.1.7-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a3c8925d16cb620e4050a0fe62a56d185cfba4c153bbc9daea0dbff1da711dd
|
|
| MD5 |
1ffb1848030f78f8d4ca5cc9ec770684
|
|
| BLAKE2b-256 |
c30b454352f8cf26bd676a1ca0a8474cb2174f69d767186a91ddeefb823e1227
|
Provenance
The following attestation bundles were made for netscout-1.1.7-py3-none-any.whl:
Publisher:
publish.yml on RamKansal/netscout
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netscout-1.1.7-py3-none-any.whl -
Subject digest:
8a3c8925d16cb620e4050a0fe62a56d185cfba4c153bbc9daea0dbff1da711dd - Sigstore transparency entry: 1235756558
- Sigstore integration time:
-
Permalink:
RamKansal/netscout@03330568b8009c429dd4c38bb27120f5dbfaecb5 -
Branch / Tag:
refs/tags/v1.1.7 - Owner: https://github.com/RamKansal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03330568b8009c429dd4c38bb27120f5dbfaecb5 -
Trigger Event:
push
-
Statement type: