Conversation
…ipeline
Before this change the user-facing flow required several manual steps that
made "run a scan and see the attack chain" impossible without Python
one-liners. Running all 6 targets on pentest-ground.com end-to-end exposed
the breaks:
1. network-recon assumed bare `nmap` on PATH — the deployment only has
`nmap-mcp` via Docker.
2. No profile existed for Java app servers like WebLogic — web-quick
missed WebLogic-specific nuclei templates (weblogic, oracle, java, …).
3. `pentest-ground.com:6379` was rejected as an unknown target type;
`_is_network_target` only matched IP:port, never hostname:port.
4. After a scan completed, findings landed in scans.db but nothing moved
them into engagements.db's `findings` table, so chain rebuild,
reports, and the dashboard all reported zero data.
5. Chain CLI defaulted to `~/.opentools/engagements.db` while the rest of
the CLI used `<repo>/engagements/opentools.db` — findings written by
one were invisible to the other.
## Changes
### Targeting (target.py + planner.py)
- `_is_network_target` now accepts `hostname:port` (dot-separated hostname
+ numeric port 1-65535). Enables TCP service targets like Redis.
- New `{target_port}` placeholder in planner template substitution.
Defaults to `1-10000` when no port is specified so nmap `-p ` doesn't
produce an empty flag.
### Profiles (profiles/network_recon.yaml + profiles/app_server.yaml)
- network-recon: now `docker exec nmap-mcp` with `{target_host}` /
`{target_port}`. Works against Redis, SSH, any TCP service.
- app-server: NEW profile targeting WebLogic/Oracle/Tomcat/JBoss —
whatweb fingerprint + nuclei tagged templates + nikto.
### Engagement bridge (scanner/engagement_bridge.py + scanner/scan_cli.py)
- `import_scan_findings` converts RawFinding rows into engagement
Finding records, deduping by (scan_id, tool, title, file_path).
- `scan run -e <engagement>` automatically calls the bridge after
terminal state is persisted. Output reports imported count.
- The engagement ref resolves by id / id-prefix / name — matches how
the rest of the CLI accepts engagement references.
### DB path unification (chain/cli.py)
- `_default_db_path` now prefers `<plugin_dir>/../../engagements/opentools.db`
(matching main CLI) and falls back to `~/.opentools/engagements.db`
only when discovery fails.
### .gitignore
- Narrowed `profiles/` rule to `/profiles/` so the root-level profiling
directory is still ignored but scanner profile YAMLs are tracked.
## Live verification
All six pentest-ground.com targets scanned with automatic engagement
import, chain rebuild, and kill-chain path queries:
DVWA (web-quick) 138 findings
DVGA (web-quick) 31 findings
RestFlaw (web-quick) 40 findings
GuardianLeaks (web-quick) 48 findings
ShadowLogic (app-server) 35 findings ← CVE-2023-21839 CRITICAL
CipherHeart (network-recon) 1 finding (Redis TCP)
Total: 293 auto-imported → chain rebuild → 179 entities, 3819 relations.
`chain query preset external-to-internal` surfaces the WebLogic RCE
chain; `chain path domain:pentest-ground.com → url:…LoginForm.jsp`
yields the full attack progression (login panel detect → admin RCE →
server RCE).
## Tests
33 existing CLI tests still pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the user-facing flow
scan → chain rebuild → kill chain queryfully automated. Before this PR, the pipeline broke in multiple places that required manual Python bridging to produce a single kill-chain result.Bugs fixed
~/.opentools/engagements.db, main CLI uses<repo>/engagements/opentools.db.gitignorehadprofiles/as profiling output rule/profiles/New:
app-serverprofileLive test results (after this PR, zero manual steps)
Test plan
external-to-internalpreset surfaces WebLogic RCEchain pathtraces the full kill chain for WebLogic🤖 Generated with Claude Code