Skip to content

feat(cli): add manus-agent exploit-search subcommand for unified exploit database search - #127

Open
manus-use wants to merge 1 commit into
mainfrom
feat/cli-exploit-search
Open

feat(cli): add manus-agent exploit-search subcommand for unified exploit database search#127
manus-use wants to merge 1 commit into
mainfrom
feat/cli-exploit-search

Conversation

@manus-use

Copy link
Copy Markdown
Owner

Summary

Adds a new exploit-search CLI subcommand that queries both Exploit-DB and Packet Storm Security in a single command, presenting a unified view of public exploits for a CVE ID or keyword.

What it does

manus-agent exploit-search CVE-2024-3094
manus-agent exploit-search CVE-2024-3094 --sources exploitdb,packetstorm
manus-agent exploit-search "apache struts" --max-results 10
manus-agent exploit-search CVE-2024-3094 --output json
  • Queries both exploit databases by default (configurable via --sources)
  • Supports both CVE IDs and free-text keyword queries
  • --max-results N controls per-source limit (default: 5, max: 20)
  • Graceful partial failure: if one source errors, the other still returns results (exit 0)
  • Exit 1 only when ALL sources fail
  • Text and JSON output formats

Refactoring

Also refactors search_exploit_db.py and search_packetstorm.py to extract reusable library functions:

  • fetch_exploitdb(query, *, max_results=5) → structured dict
  • fetch_packetstorm(query, *, max_results=5) → structured dict

These functions return a clean {"source": ..., "query": ..., "exploits": [...], "error": ...} structure that both the Strands tool entry points and the CLI can consume. The Strands tool interfaces are fully backward-compatible.

Tests

28 new tests in tests/test_cli_exploit_search.py:

  • TestFetchExploitdb (5 tests): unit tests for the extracted library function
  • TestFetchPacketstorm (5 tests): unit tests for the extracted library function
  • TestExploitSearchCLI (12 tests): CLI subcommand integration tests (text/json output, source filtering, error handling, partial failure, max-results, help flag)
  • TestStrandsToolCompat (6 tests): backward compatibility verification for the refactored Strands tool entry points

All tests are 100% mocked (no real HTTP calls). Full suite: 1186 passed, 0 failures.

Files changed

  • src/manus_agent/tools/search_exploit_db.py — refactored: extracted fetch_exploitdb() + kept Strands tool compat
  • src/manus_agent/tools/search_packetstorm.py — refactored: extracted fetch_packetstorm() + kept Strands tool compat
  • src/manus_agent/cli.py — added exploit-search subcommand (+120 lines: parser, runner, _SUBCOMMANDS, main dispatch)
  • README.md — added TOC entry + CLI reference section
  • tests/test_cli_exploit_search.py — new test file (28 tests)

Open PRs checked for overlap (none)

Checked all 48 open PRs: #51, #53, #54, #58, #60, #64, #65, #67, #74–90, #96, #98, #100, #103–126.

No existing open or merged PR provides a dedicated exploit-search CLI subcommand.

…oit database search

Adds a new `exploit-search` CLI subcommand that queries both Exploit-DB and
Packet Storm Security in a single command, presenting a unified view of
public exploits for a CVE ID or keyword.

Also refactors search_exploit_db.py and search_packetstorm.py to extract
reusable library functions (fetch_exploitdb, fetch_packetstorm) that can be
called by both the Strands tool entry points and the CLI directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant