A CLI reconnaissance framework that chains the passive and active information gathering steps a penetration tester runs at the start of an authorized engagement, and reports every finding against the corresponding OWASP WSTG "Information Gathering" test case (WSTG-INFO-01 … 10).
It is an orchestration tool for well known, documented recon techniques. It contains no exploits, no credential attacks and no evasion capability.
Run this tool only against systems you have explicit written authorization to test.
Every module here sends traffic to a named target or asks a third party about one. Doing that to a system you neither own nor are contracted to test is illegal access. In Indonesia that is an offense under UU ITE Pasal 30 (Undang-Undang No. 11/2008, amended by No. 19/2016, on Electronic Information and Transactions), with penalties under Pasal 46 of up to 8 years' imprisonment and/or a fine of up to IDR 800,000,000. Equivalent law applies elsewhere: the US Computer Fraud and Abuse Act, the UK Computer Misuse Act 1990, and so on. "I was only doing recon" is not a defense: port scanning and enumeration are the access attempts these statutes describe.
A signed scope document is what separates this tool from a crime. The authorization gate below is only the technical reminder.
This framework deliberately contains no Tor support, no proxy chaining, no source address or MAC spoofing, and no timing based evasion. Authorized testing must be attributable: the client's blue team has to be able to tell your traffic apart from a real intrusion happening in the same window. Every design decision here follows from that.
| # | Module | File | WSTG coverage | Touches the target? |
|---|---|---|---|---|
| 1 | Passive subdomain enumeration via certificate transparency (crt.sh) | recon/subdomain_enum.py |
INFO-01 | No, queries a public log |
| 2 | Service/version fingerprinting (nmap -sV -T2) |
recon/service_scan.py |
INFO-02, INFO-04 | Yes |
| 3 | Search engine discovery ("Google dorking") | recon/osint_dork.py |
INFO-01, INFO-03, INFO-05 | No, queries a search engine |
| 4 | Webserver metafile & response header review | recon/webleak_check.py |
INFO-02, INFO-03, INFO-05, INFO-08, INFO-09 | Yes |
| 5 | Report generator (JSON + Markdown + HTML) | recon/report.py |
all of the above | No |
Supporting code: recon/authorization.py (the gate and scope engine),
recon/audit.py (audit trail and source identity detection), recon/net.py
(rate limited, audited HTTP), recon/wstg.py (the WSTG catalogue and the
shared Finding type). main.py is the CLI that wires them together.
This was built first, and everything else is built behind it. A scan cannot start unless both conditions hold:
1. A scope.txt file listing the authorized targets, one per line.
An empty or missing scope file is fatal. An empty scope is not an
authorization.
2. The operator types this string, exactly, at runtime:
I CONFIRM I HAVE WRITTEN AUTHORIZATION TO TEST THIS TARGET
No case folding, no fuzzy match, no y/n shortcut, and no --force flag or
environment variable that skips it. Anything else and the tool exits without
sending a single packet.
Before prompting, the gate prints the parsed scope back to you along with the scope file's SHA-256, so you confirm what you are actually about to scan rather than what you think is in the file.
require_authorization() is the only function that can construct an
AuthorizationToken. Its __init__ requires a sentinel object private to the
module. Every scanning function takes that token as a required argument and
calls token.allow(target) immediately before each request.
So the "don't scan out of scope" rule is not a convention someone has to remember. A module physically cannot run without a token, and a token cannot exist without a human having read the scope file and typed the phrase.
Scope is rechecked before every single request, not once per run:
- Subdomains discovered partway through a scan are new targets, and get checked like any other. crt.sh routinely returns hostnames belonging to other parties (shared certificates, acquired brands, look alike domains).
- Redirects are not followed automatically. A redirect can point at a host outside the engagement, and following it blindly would send authorized test traffic to an unauthorized system.
- Anything that fails the check is written to the report and the audit log as
out of scope, not tested, with the reason, and it is never quietly dropped. The client sees what was found, and sees that it was left alone.
Requires Python 3.8+, and nmap on PATH for module 2.
git clone https://github.com/Wu-Falin/recon-framework.git
cd recon-framework
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt # requests is the only dependency
sudo apt install nmap # Debian, Ubuntu, KaliEverything else is standard library: argparse, subprocess, xml.etree,
ipaddress, hashlib, socket, uuid.
scope.txt should be a straight transcription of the target list in your
signed authorization letter or rules of engagement, nothing more. One entry
per line; blank lines and # comments are ignored.
# Engagement ACME-2026-01, authorized 2026-01-10 .. 2026-01-24
example.com # exact hostname
*.example.com # any subdomain (see note below)
192.0.2.10 # a single IP address
192.0.2.0/24 # a CIDR range
*.example.com does not cover the apex example.com. If the apex is
authorized, list it on its own line. Defaulting to "refuse" is the safe
failure: a missing entry costs you a rerun, an overly broad wildcard costs
you an unauthorized scan.
A ready to copy annotated template is in scope.example.txt,
and a filled in sample using reserved documentation domains is in
examples/scope.txt.
.gitignoreexcludes/scope.txt,/reports/and*.jsonlso a real engagement's target list and results never end up in version control.
# See exactly what would run. It sends nothing, contacts nothing,
# and therefore never opens the authorization gate:
python3 main.py --scope scope.txt --dry-run
# Passive modules only. No traffic reaches the target at all:
python3 main.py --scope scope.txt --modules subdomains,dorks
# Full recon pass, with engagement details recorded in the report header:
python3 main.py --scope scope.txt \
--operator "J. Tester" \
--engagement "ACME-2026-01" \
--output-dir reports/acme| Option | Purpose |
|---|---|
--modules subdomains,services,dorks,web |
Pick a subset (default: all) |
--dry-run |
Print the plan and exit; sends nothing |
--nmap-timing -T0|-T1|-T2 |
Timing template. -T3 and faster are rejected |
--nmap-ports "-p 80,443" |
Port selection (default --top-ports 100) |
--nmap-extra=-Pn |
Extra nmap argument (use the = form so argparse doesn't claim the flag); dangerous flags are refused |
--delay 2.0 |
Minimum seconds between HTTP requests (default 1.0) |
--max-hosts 25 |
Cap on hosts handed to the active modules |
--search-engine google|bing|duckduckgo |
Which engine the dork URLs point at |
--google-api-key / --google-cx |
Optional, for the official Custom Search API |
--verbose |
Echo each audit entry as it is written |
Exit codes: 0 success · 1 a module failed · 2 refused (gate or unsafe
option) · 130 interrupted (a partial report is still written).
| Default | Reason |
|---|---|
nmap timing -T2 ("polite"); -T3/-T4/-T5 refused |
Aggressive timing is what turns a scan into an accidental denial of service against fragile equipment |
--top-ports 100, not nmap's default 1000 |
Less traffic, and enough to characterise a host at the recon stage |
-A, -O, --script, --min-rate, --max-parallelism refused |
They reach past information gathering, or risk DoS |
-f, -D, -S, --spoof-mac, --data-length, --proxies refused |
Evasion and spoofing destroy attributability, and a decoy scan forges traffic from third parties |
| 1 second between HTTP requests by default | Nothing here should look like, or become, a load test |
| Redirects not followed | The destination may be out of scope |
| Target response bodies capped at 2 MB | A hostile or broken server can't exhaust the testing machine |
| Search results are never scraped | Automating Google's web interface breaches its Terms of Service, gets the source IP blocked by CAPTCHA, and produces evidence a client can challenge. Module 3 emits clickable URLs for manual review, or uses the official Custom Search JSON API if you supply your own key |
Honest, self identifying User-Agent |
The target's operations team can pick this traffic out of their logs immediately |
Every outbound request is written to a JSON Lines audit log as it happens, logged before it is sent, so an interrupted scan still leaves a complete record of what went out:
{"timestamp":"2026-01-15T09:04:12Z","event":"network.passive","target":"example.com","detail":"GET https://crt.sh/?q=%25.example.com&output=json (provider=crt.sh)","provider":"crt.sh","attempt":1}
{"timestamp":"2026-01-15T09:04:19Z","event":"scope.refused","target":"example.net","detail":"out of scope, not tested: not listed in scope file"}
{"timestamp":"2026-01-15T09:05:02Z","event":"network.command","target":"www.example.com","detail":"nmap -sV -T2 --open --top-ports 100 ...","argv":["nmap","-sV","-T2","..."]}Events: session.start · network.request · network.response ·
network.passive · network.command · network.error · scope.refused ·
scan.refused · scan.capped · session.end.
This is the record an authorization document implicitly asks for. When a client asks six weeks later whether a particular probe at 09:04 was you, you can answer with a timestamped file instead of a recollection.
The report header also declares the source machine's IP address, MAC address, interface and hostname, detected automatically at runtime. Declaring the origin of the traffic is normal engagement practice: it is what lets a SOC separate your authorized testing from a genuine intrusion in the same window, and it is why anonymising the source would defeat the purpose.
Each run writes three files: .json (machine readable, and the input to the
next phase), .md (for the engagement write up) and .html (self contained,
no external CSS or JS, so it survives being emailed).
The report is organised by WSTG test case, not by tool. That is the central design decision, and it is worth being explicit about why.
A client cannot act on "here is my nmap output, here is my subdomain list." They can act on:
WSTG-INFO-02 — Fingerprint Web Server
[LOW] www.example.com:443 discloses nginx 1.18.0
An exact version number lets an attacker map the host to published
vulnerabilities offline. Suppress or genericise the banner.
WSTG-INFO-03 — Review Webserver Metafiles for Information Leakage
[LOW] www.example.com publishes robots.txt with 3 disallowed path(s)
/admin/, /backup/, /internal-api/
Structuring a report this way does three things that a report shaped around tools cannot:
-
It proves methodology coverage. The client sees that a recognised, published checklist was worked through, not that someone ran their favourite tools in whatever order occurred to them. If the engagement is ever reviewed, disputed, or repeated by a different tester, the WSTG code is the common reference.
-
It separates "tested, found nothing" from "not tested". Every WSTG-INFO code appears in the report even when it produced no findings, marked with how it was actually covered in that run:
Coverage Meaning Automated — ranThe module ran. Zero findings means zero findings. Not run in this scanThe responsible module was not selected. Not the same as "nothing found". Attempted — module reported an errorThe module ran and failed, so the test case was not completed. Manual — not automated by this toolNeeds a human. Those are four different statements and a client is entitled to know which one they are reading. This framework automates INFO-01, 02, 03, 04, 05, 08 and 09; INFO-06 (application entry points), INFO-07 (execution paths) and INFO-10 (application architecture) require a human and are reported as such.
-
It makes findings comparable across engagements and across testers. "WSTG-INFO-02" means the same thing to every reader; "the nmap section" does not.
This is the same reason real reports are written against a methodology (WSTG, PTES, or the OSSTMM) rather than as an appendix of raw tool output.
examples/sample-report.md ·
examples/sample-report.json ·
examples/sample-report.html
Sanitized, using RFC 2606 reserved domains (example.com) and RFC 5737
reserved addresses (192.0.2.0/24), which can never belong to a real
organisation. Regenerate them with:
python3 examples/generate_sample_report.py # sends no trafficThat script feeds hand written module output through the real report renderer, so the committed sample stays in step with the actual output format instead of drifting into a stale mockup.
Stated plainly, because a recon tool that overstates its coverage is worse than no tool:
- Certificate transparency is not exhaustive. It only shows hosts that have had a publicly trusted TLS certificate issued. Internal only and self signed hosts will not appear. crt.sh is also frequently overloaded and will time out; the report records that as an error rather than as "no results".
- Scope is matched by name, not by resolved address. A hostname that is in scope but whose DNS record has been repointed at third party infrastructure will still be scanned. Confirm ownership of the resolved addresses before an active run.
- The web module checks default ports only (443 then 80). Web services on other ports show up in the nmap results but are not reviewed for metafiles.
- No IPv6 in the active path. IPv6 literals parse and match scope correctly, but the modules have only been exercised over IPv4.
- INFO-06, INFO-07 and INFO-10 are not automated, by design. They need a tester's judgement, and the report says so rather than leaving them blank.
--dry-runskips the confirmation prompt. It sends nothing and contacts nothing, so it never constructs an authorization token and therefore cannot reach a scanning module. It is a planning aid, not a scan.
recon-framework/
├── main.py CLI entry point and the gate call
├── recon/
│ ├── __init__.py version + the legal notice
│ ├── authorization.py scope engine, gate, AuthorizationToken
│ ├── audit.py JSONL audit log, source IP/MAC detection
│ ├── net.py rate limited, audited HTTP with scope checks
│ ├── wstg.py WSTG catalogue + the Finding type
│ ├── subdomain_enum.py module 1 (WSTG-INFO-01)
│ ├── service_scan.py module 2 (WSTG-INFO-02, 04)
│ ├── osint_dork.py module 3 (WSTG-INFO-01, 03, 05)
│ ├── webleak_check.py module 4 (WSTG-INFO-02, 03, 05, 08, 09)
│ └── report.py module 5 (JSON / Markdown / HTML)
├── examples/
│ ├── scope.txt filled in sample scope
│ ├── generate_sample_report.py regenerates the sample (no traffic)
│ └── sample-report.{json,md,html} sanitized example output
├── scope.example.txt annotated template
├── test_recon.py tests for the gate, scope and nmap guard
├── requirements.txt
└── README.md
python3 -m unittest -v test_recon37 tests covering the properties this README claims: the gate refuses every
near miss of the confirmation phrase, AuthorizationToken cannot be
constructed outside the gate, look alike domains (example.com.attacker.net)
and hosts wrapped in a URL do not match a wildcard scope entry, every dangerous
nmap flag is refused, nmap XML parses correctly, a module that never ran is not
reported as "tested", and text supplied by the target is escaped before it
reaches the HTML report.
Written as a portfolio project for a junior penetration testing role. It demonstrates recon orchestration, reporting mapped to a methodology, and, the part that actually matters in this line of work, building the authorization boundary into the tool rather than relying on the operator to remember it.
Do not run it against anything you are not authorized to test.