Hack-Dhe-Net: authorized-scope pentest lab - core 4-step method, CVSS ranking, AI council, study kit
203
π A complete penetration-testing methodology as running code β the core 4-step workflow, the 9 extended practices, and the AI integration from the study document β where every assessment runs only against registered, authorized scope, verification never disrupts a service, and a real CVSS 3.1 engine ranks findings by business risk.
π¨βπ» By Darion Kellar Β· π MIT License Β· π Python stdlib only, zero dependencies Β· π·οΈ v1.0.0
β οΈ Disclaimer: This repository is intended for education and for assessing systems you own or are explicitly authorized to test. The scope registry is enforced in code: unregistered targets are refused before any packet is sent.
| Layer | Technology |
|---|---|
| π Language | Python 3.12, standard library only |
| π Scanning | socket connect scans, threaded; UDP probes |
| π Detection | Banner grabbing + HTTP HEAD probe |
| π Web checks | http.client directory discovery |
| π TLS | ssl handshake, certificate parsing |
| π Scoring | Hand-built CVSS 3.1 engine (official formula) |
| π§ͺ Lab target | http.server + raw-socket fixture services |
| π§ Brains | Gemini Argon 4 (decider) Β· Google Flow (automation) Β· Muse (advisor) |
| π³ Container | Docker (python:3.12-slim) |
| β Tests | pytest (bare pytest, root conftest) |
Hack-Dhe-Net began as a Gemini study document: a "Master Documentation Overview" of how a penetration test is actually run β Part 1, a core 4-step methodology (find open ports, understand services, discover vulnerabilities, determine exploitability safely); Part 2, the extended practices that make an assessment complete (OS fingerprinting, banner grabbing, directory brute-forcing, credential testing, topology and trust mapping, cryptographic posture, CVSS prioritization, documentation and rules of engagement); Part 3, advanced AI integration (Gemini Flow workflow automation, Gemini Argon 4 extended thinking); and a three-tab study checklist, with a repository layout of docs/, scripts/ and outputs/. This project implements all of it as one running system β and adds the guardrail the document itself demands: assessments operate strictly within authorized scopes, enforced by a scope registry that refuses unregistered targets in code.
python main.py demo).The pipeline (hackdhenet/pipeline.py) runs the methodology in order. The scope gate resolves the target against the registry and stops the run if it is not authorized. The scanner connects to candidate ports and grabs banners; the fingerprint module estimates the OS from reply TTL and banner hints. Web services get directory discovery; TLS services get a posture evaluation. Banners are cross-referenced against the offline CVE set, and FTP services get a single anonymous-login probe. Every candidate finding carries a CVSS vector, scored by the CVSS engine (the official FIRST formula, verified against canonical vectors: 9.8, 7.5, 10.0) and multiplied by business context into a priority. Findings, the trust map and the command log render into the report. The council β Argon 4 deciding, Flow ordering, Muse advising with no authority β holds 12 action classes (exploit execution, brute force, out-of-scope scanning, and friends) before they can ever run.
The study document most people would leave as notes is here as a working pipeline: scan β detect β cross-reference β verify safely β score β report, end to end, against a lab target that really answers.
git clone https://github.com/credkellar/Hack-Dhe-Net.gitcd Hack-Dhe-Netpython3 --version (3.10+; developed on 3.12).pip install pytestpython main.py checks β expect CHECKS: 24/24 passed.python main.py demopython main.py checklistpython main.py register 192.168.1.50 my lab boxpython main.py assess 192.168.1.50docker build -t hack-dhe-net . && docker run --rm hack-dhe-netImagine you hire a guard to check your house. First, the guard writes down which houses he is allowed to check β he never checks a stranger's house. Then he walks around your house and writes down every door and window (the ports). He reads the labels on the doors to learn who made them (the banners). If a label names an old lock that burglars know how to open, he writes that down too (the CVE list). He gently tries the front gate once to see if it is unlocked for anybody (the anonymous test) β he never tries to break anything. He gives every problem a danger score, but he also thinks about what is inside: a broken lock on the candy jar matters less than one on the safe. At the end he hands you a neat report with everything he did written down, step by step. That is this project.
Hack-Dhe-Net/
βββ main.py # ποΈ CLI entry point
βββ conftest.py # π§ͺ root path fix for bare pytest
βββ pyproject.toml # π¦ package metadata
βββ Dockerfile # π³ container build
βββ hackdhenet/
β βββ scope.py # π RoE + authorized scope registry
β βββ fixture.py # π§ͺ leaky lab target (HTTP/FTP/SSH)
β βββ scanner.py # π ports + banner/service detection
β βββ fingerprint.py # π₯οΈ OS estimate (TTL + hints)
β βββ webdir.py # ποΈ directory discovery
β βββ tlscheck.py # π TLS posture evaluation
β βββ vulndb.py # π offline CVE cross-reference
β βββ credcheck.py # π credential-risk seat
β βββ topology.py # πΊοΈ topology + trust mapping
β βββ cvss.py # π CVSS 3.1 engine + prioritization
β βββ checklist.py # β
study checklist data
β βββ pipeline.py # π¬ the assessment pipeline + report
β βββ brains/ # π§ argon4 Β· flowseat Β· muse Β· council
βββ docs/ # π 01 core workflow Β· 02 extra practices Β· 03 AI orchestration
βββ scripts/ # π οΈ port-scanner.py Β· recon-pipeline.sh
βββ outputs/ # π where reports land
βββ tests/ # π§ͺ pytest suite
main.pyflowchart TD
A["python main.py"] --> B{"Command?"}
B -->|demo| C["Fixture + full pipeline"]
B -->|assess| D["Registered-host assessment"]
B -->|scan / tls / cvss| E["Single-step tools"]
B -->|checklist / scope| F["Study + RoE views"]
B -->|checks| G["24 self-checks"]
hackdhenet/scope.pyflowchart TD
A["Target named"] --> B{"In the registry?"}
B -->|yes| C["Resolved IP released"]
B -->|no| D["ScopeError - RoE HOLD"]
C --> E["Run is logged"]
hackdhenet/fixture.pyflowchart TD
A["start_fixture"] --> B["HTTP: Apache/2.4.49 banner + leaky paths"]
A --> C["FTP: ProFTPD 1.3.5 + anonymous login"]
A --> D["SSH banner: OpenSSH_7.4"]
B --> E["127.0.0.1 ephemeral ports"]
C --> E
D --> E
hackdhenet/scanner.pyflowchart LR
A["Candidate ports"] --> B["Threaded connect scan"]
B --> C["Open ports"]
C --> D["Passive banner read"]
D -->|silent| E["HTTP HEAD probe"]
D --> F["Service + product"]
E --> F
hackdhenet/fingerprint.pyflowchart TD
A["Host + services"] --> B["Ping TTL"]
A --> C["Banner hints"]
B --> D{"TTL family"}
D -->|64| E["Linux / Unix-like"]
D -->|128| F["Windows"]
C --> G["Estimate + confidence label"]
E --> G
F --> G
hackdhenet/webdir.pyflowchart LR
A["Wordlist: 10 paths"] --> B["GET each path"]
B --> C{"Status?"}
C -->|200| D["Accessible"]
C -->|401| E["Auth required"]
C -->|403| F["Exists, forbidden"]
C -->|404| G["Skipped"]
hackdhenet/tlscheck.pyflowchart TD
A["Host + port"] --> B["TLS handshake"]
B --> C["Protocol + cipher"]
B --> D["Certificate fields"]
D --> E{"Flags?"}
E -->|expired / legacy / self-signed| F["Posture flags"]
E -->|clean| G["No flags raised"]
hackdhenet/vulndb.pyflowchart LR
A["Service banners"] --> B["Offline CVE reference set"]
B --> C{"Match?"}
C -->|yes| D["Candidate finding + vector"]
C -->|no| E["Version-disclosure check"]
E --> F["Info finding"]
hackdhenet/credcheck.pyflowchart TD
A["FTP service"] --> B["USER anonymous / PASS / QUIT"]
B --> C{"Accepted?"}
C -->|230| D["Anonymous-login finding"]
A2["Web portals"] --> E["Plaintext HTTP?"]
E -->|yes| F["Portal exposure finding"]
G["Password guessing"] --> H["HOLD - external tools only"]
hackdhenet/topology.pyflowchart TD
A["Scope hosts"] --> B["Map builder"]
C["Assessment runs"] --> B
B --> D["Nodes + edges"]
B --> E["Trust warnings"]
D --> F["Mermaid trust map"]
hackdhenet/cvss.pyflowchart LR
A["CVSS vector"] --> B["Parse metrics"]
B --> C["Official 3.1 formula + roundup"]
C --> D["Base score + severity"]
D --> E["x criticality x exposure"]
E --> F["Priority ranking"]
hackdhenet/checklist.pyflowchart TD
A["3 groups / 14 items"] --> B["Progress state"]
B --> C["Core Workflow"]
B --> D["Extra Practices"]
B --> E["Google AI Tools"]
C --> F["Percent complete"]
D --> F
E --> F
hackdhenet/pipeline.pyflowchart TD
A["Scope gate"] --> B["Ports"] --> C["Services"] --> D["OS estimate"]
D --> E["Directories + TLS"] --> F["CVE cross-reference"] --> G["Credential-risk probes"]
G --> H["CVSS + business priority"] --> I["Report + command log + trust map"]
hackdhenet/brains/argon4.pyflowchart TD
A["Proposed action"] --> B{"HOLD action?"}
B -->|yes| C["HOLD - refused"]
B -->|no| D["PROCEED"]
A --> E["Thinking tier: 2048 / 8192 / 32768"]
hackdhenet/brains/flowseat.pyflowchart LR
A["Assessment Flow"] --> B["10 named steps"]
B --> C["Scope gate first"]
C --> D["Report last"]
hackdhenet/brains/council.pyflowchart TD
A["Action"] --> B["Argon 4 decides"]
B --> C["Flow orders the steps"]
B --> D["Muse advises - authority none"]
C --> E["Strictest verdict wins"]
D --> E
scripts/port-scanner.pyflowchart LR
A["Host + ports"] --> B["Scope check"]
B --> C["scanner.detect_services"]
C --> D["Printed services"]
| # | Action on HOLD | Why |
|---|---|---|
| 1 | scan_outside_scope | Target is not in the authorized scope registry |
| 2 | exploit_execution | Running exploit code is never part of safe verification |
| 3 | disruptive_testing | No denial of service, no service disruption |
| 4 | credential_bruteforce | Password guessing is external and separately authorized |
| 5 | anonymous_write_test | The safe probe stops at login |
| 6 | data_exfiltration | Removing data is not assessment |
| 7 | persistence_or_implant | Nothing is left behind on a target |
| 8 | scope_expansion_mid_run | New targets are registered before a new run |
| 9 | unlogged_assessment | Every run writes its command log |
| 10 | finding_falsification | Findings are reported as observed |
| 11 | mass_udp_scan | Only named UDP ports are probed |
| 12 | advisor_override | Advice tightens; it never loosens a HOLD |
11 findings, top two CRITICAL 9.8: Apache httpd 2.4.49 path traversal / possible RCE [CVE-2021-41773] and ProFTPD 1.3.5 mod_copy [CVE-2015-3306]; then anonymous FTP accepted, OpenSSH 7.4 user enumeration [CVE-2018-15473], /backup.zip and /.git/HEAD exposed, two plaintext login portals, and three version disclosures. Verification: pytest 6 passed, CHECKS 24/24, hold-demo exit 2.
nmap -O study item, not stack interrogation.GEMINI_API_KEY, MODEL_API_KEY); offline they run the deterministic local logic in brains/. Live model calls are the operator's step.MIT Β© 2026 Darion Kellar
Content type
Image
Digest
sha256:f8a0a3618β¦
Size
48.6 MB
Last updated
about 14 hours ago
docker pull credkellar/hack-dhe-net