A lean, production-quality network reconnaissance CLI tool with an optional local web dashboard. Built for authorized security testing on private infrastructure and authorized targets.
Current Version: 0.1.0
- Port Scanning — TCP connect scans on common ports (top 100 by default) with concurrent connection handling
- Service Identification — Service detection by port number and optional banner grabbing
- DNS Enumeration — A/AAAA/MX/NS/TXT/CNAME/SOA record resolution, subdomain bruteforcing, and zone transfer detection
- Risk Annotation — Flagging of well-known risky services (FTP, Telnet, RDP, unauth databases, etc.)
- Multiple Report Formats — JSON, CSV, and Markdown output for both CLI and web dashboard
- Local Web Dashboard — Optional Flask-based local dashboard for interactive scanning (127.0.0.1-only, no auth required)
- Type hints on all public functions
- Comprehensive Google-style docstrings
- Structured data returned from core modules (no direct printing from scanner/dns_enum)
- Full unit test coverage with mocked network calls
- Required:
dnspython,flask - Optional:
scapy(for SYN scans),rich(for pretty output) - Core CLI (
scan,dns,fullcommands) works without Flask
The project maintains strict separation between layers:
CLI (main.py) ─┐
├─→ Core Modules ──→ Reporter ──→ Output (JSON/CSV/MD)
Web (app.py) ──┘ (scanner.py)
└─→ (dns_enum.py)
Both CLI and web dashboard use the same core scanning and DNS modules. The web layer is purely a presentation layer—it imports and calls the same functions the CLI uses.
Authorized Use Only
- Startup banner on both CLI and web dashboard reminding users of legal requirements
- Automatic checks prevent scanning non-private/non-loopback targets without explicit
--confirm-authorizedflag (CLI) or checkbox acknowledgment (web) - This mirrors best practices from tools like nmap — a legal safeguard, not a technical restriction
Local-Only Web Dashboard
- Binds to
127.0.0.1by default (loopback-only) - No authentication system (single-user, local tool)
- No CORS or public deployment support
- No persistent database (session history only, cleared on restart)
- Designed as an interactive local tool, not a hosted service
- Python 3.9+
- pip or conda
git clone <repo>
cd netrecon
pip install -e .For SYN scanning and rich terminal output:
pip install -e ".[extras]"For development (tests):
pip install -e ".[dev]"Scan the top 100 ports on a target:
netrecon scan 192.168.1.1 -o reports/scan1Scan a specific port range:
netrecon scan 192.168.1.1 --ports 80,443,8080 -o reports/scan2Scan the top 1000 ports with custom timeout:
netrecon scan 192.168.1.1 --top-ports 1000 --timeout 2.0 -o reports/scan3Scan a network (CIDR):
netrecon scan 192.168.1.0/24 --confirm-authorized -o reports/networkEnumerate DNS records:
netrecon dns example.com -o reports/dns1Bruteforce subdomains:
netrecon dns example.com --wordlist wordlists/subdomains-small.txt -o reports/dns2Attempt zone transfer:
netrecon dns example.com --zone-transfer -o reports/dns3Run a complete reconnaissance pipeline (discovery → port scan → DNS):
netrecon full example.com --confirm-authorized -o reports/full_exampleGenerate reports in multiple formats:
netrecon scan 192.168.1.1 --format all -o reports/Supported formats:
json— Structured JSON outputcsv— Flat CSV table of open portsmarkdown— Human-readable markdown report (portfolio-friendly)all— Generate all three formats
Launch the local web dashboard:
netrecon webThis will:
- Print the authorization banner
- Start the Flask server on
127.0.0.1:5000 - Automatically open your browser (use
--no-browserto skip)
Then:
- Enter a target (IP, CIDR, or domain)
- Choose port range (top 100 or top 1000)
- Optionally enable DNS enumeration
- Check the authorization box
- Click "Start Scan"
Results can be viewed in-browser or downloaded as JSON/CSV/Markdown.
This tool is designed for authorized security testing only. Unauthorized access to computer networks is illegal in most jurisdictions. Before using this tool:
- Get Written Permission — Ensure you have explicit written authorization from the network owner or administrator
- Understand the Law — Unauthorized network scanning may violate laws like the Computer Fraud and Abuse Act (CFAA) in the US and similar laws globally
- Test on Your Own Infrastructure — Use this tool on networks you own or have authority to test
- Respect Scope — Only scan targets explicitly authorized in your testing agreement
- Report Findings Responsibly — If you discover security issues, disclose them responsibly to the affected organization
The tool includes safeguards (authorization banners, confirmation flags) as a reminder, not as a complete legal safeguard. You are responsible for ensuring legal compliance.
Common authorized use cases:
- Testing your own infrastructure
- Penetration testing under contract
- Educational labs and CTF competitions (with explicit permission)
- Security research on systems you own or have permission to test
┌────────────────────────────────────────────────────────┐
│ netrecon/ │
│ ├── __init__.py │
│ ├── main.py (CLI entrypoint, argparse) │
│ ├── config.py (defaults, port lists) │
│ ├── utils.py (validation, logging) │
│ ├── scanner.py (port scanning, host disco.) │
│ ├── dns_enum.py (DNS resolution, bruteforce) │
│ ├── reporter.py (ScanResult, report formats) │
│ └── web/ │
│ ├── app.py (Flask factory, routes) │
│ ├── templates/ (Jinja2 templates) │
│ │ ├── base.html (layout) │
│ │ ├── index.html (scan form) │
│ │ ├── results.html (results display) │
│ │ └── history.html (past scans) │
│ └── static/ │
│ └── style.css (responsive styling) │
│ │
├── tests/ │
│ ├── test_scanner.py (port scan logic) │
│ ├── test_dns_enum.py (DNS functions) │
│ ├── test_reporter.py (report generation) │
│ └── test_web.py (Flask routes, mocked scans) │
│ │
├── wordlists/ │
│ └── subdomains-small.txt (for bruteforcing) │
│ │
├── reports/ (gitignored, output dir) │
├── pyproject.toml (project metadata, deps) │
├── README.md (this file) │
└── .gitignore (ignore compiled, reports) │
- Scanner Module → Returns
{port: state}dict, never prints - DNS Module → Returns
{record_type: [values]}dict - Reporter Module → Consumes dicts, generates structured
ScanResult - CLI → Formats and prints results, writes files
- Web → Passes
ScanResultto Jinja2 templates for rendering
This separation ensures:
- Core logic is testable without I/O
- Both CLI and web reuse the same scanning code
- Adding new output formats is trivial (add a method to reporter.py)
- No cross-module dependencies or circular imports
Run all tests:
pytestRun tests with coverage:
pytest --cov=netreconRun a specific test file:
pytest tests/test_scanner.py -v- scanner.py — Port scanning, banner grabbing, service identification (mocked sockets)
- dns_enum.py — DNS resolution, subdomain bruteforce, zone transfer (mocked DNS resolver)
- reporter.py — ScanResult creation, report generation (JSON/CSV/MD)
- web/app.py — Flask routes, form validation, result rendering (test client, mocked scanner)
All tests use unittest.mock to mock network calls — the test suite runs completely offline.
Enable verbose logging:
netrecon -v scan 192.168.1.1Suppress non-error output:
netrecon -q scan 192.168.1.1- No active vulnerability scanning (port/service discovery only)
- SYN scans require root privileges and scapy (opt-in via
--synflag, currently not implemented) - Long-running scans (full port range, large CIDR blocks) may timeout on the web UI — CLI is recommended for large scans
- Scan history is in-memory only (cleared on restart)
- No multi-user support or authentication on web dashboard
- No scheduled/automated scans
These are intentionally out of scope for v1. The tool is designed to be lean and focused on core reconnaissance functionality.
- WebSocket-based progress updates for long scans
- Persistent scan history (SQLite)
- SYN scan support with privilege escalation prompts
- Vulnerability database lookups for discovered services
- Massscan integration for high-speed scanning
- Multi-user web interface with authentication
- Automated scan scheduling and reporting
- Integration with external APIs (Shodan, VirusTotal, etc.)
MIT License
This is a portfolio project. If you'd like to suggest improvements or report bugs, please open an issue or submit a PR.
This tool is provided for authorized security testing and educational purposes only. Users are solely responsible for complying with all applicable laws and regulations. The author is not responsible for misuse of this tool.