Add search Engine _ Driftnet#678
Conversation
WalkthroughSupport for the Driftnet search engine was added throughout the project. This includes a new agent for Driftnet queries, integration into command-line options, API key management, provider configuration, rate limiting, and updated documentation. All changes are additive, introducing Driftnet as a fully supported search engine without altering existing functionality. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant DriftnetAgent
participant DriftnetAPI
User->>CLI: Run with --driftnet or -df query
CLI->>DriftnetAgent: Initialize agent with API key
DriftnetAgent->>DriftnetAPI: Send query (IP/CIDR or search term)
DriftnetAPI-->>DriftnetAgent: Return paginated results
DriftnetAgent->>CLI: Stream results (IP, ports, hostnames)
CLI->>User: Display Driftnet results
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (4)
uncover.go (1)
195-196: Keep AllAgents() list sorted for readabilityOptional: appending new engines at the end makes diffs larger over time. Consider alphabetical ordering next time.
runner/options.go (1)
95-96: Fix typo “drfitnet” in help stringMinor but user-visible typo in the flag description.
- flagSet.StringSliceVarP(&options.Driftnet, "driftnet", "df", nil, "search query for drfitnet (example: -driftnet 'query.txt')", goflags.FileStringSliceOptions), + flagSet.StringSliceVarP(&options.Driftnet, "driftnet", "df", nil, "search query for driftnet (example: -driftnet 'query.txt')", goflags.FileStringSliceOptions),README.md (2)
169-195: Consistent environment-variable nameYou used
DRIFTNET_API_KEY(👍). After fixing the YAML typo above everything will align.🧰 Tools
🪛 LanguageTool
[uncategorized] ~174-~174: You might be missing the article “the” here.
Context: ...iple keys/credentials are specified for same provider in the config file, random key...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~174-~174: You might be missing the article “a” here.
Context: ...d for same provider in the config file, random key will be used for each execution. a...(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~175-~175: Possible missing comma found.
Context: ...m key will be used for each execution. alternatively you can also set the API key as environ...(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~176-~176: A comma might be missing here.
Context: ...used for each execution. alternatively you can also set the API key as environment...(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~176-~176: You might be missing the article “an” here.
Context: ...atively you can also set the API key as environment variable in your bash profile. ```yaml...(AI_EN_LECTOR_MISSING_DETERMINER_AN)
382-416: Section header & examples contain the same typoOccurrences of “drfitnet” should be “driftnet” to avoid confusion in copy-paste examples.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
README.md(8 hunks)runner/options.go(7 hunks)sources/agent/driftnet/driftnet.go(1 hunks)sources/agent/driftnet/response.go(1 hunks)sources/keys.go(2 hunks)sources/provider.go(4 hunks)sources/session.go(1 hunks)uncover.go(3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
uncover.go (2)
sources/agent/driftnet/driftnet.go (1)
Agent(43-43)sources/agent.go (1)
Agent(8-11)
🔇 Additional comments (7)
sources/keys.go (1)
22-23: Addition looks correct – field aligns with existing naming pattern
DriftnetTokenis added consistently with the other*Tokenfields and is also accounted for inEmpty(). No issues spotted.sources/session.go (1)
34-35: Double-check Driftnet’s permitted request rate
MaxCount: 5, Duration: time.Secondmeans up to 5 req/s. Please confirm this is within Driftnet’s published limits; overshooting will quickly burn through quotas or trigger 429s.uncover.go (1)
89-91: Agent registration looks fineThe new switch-case branch correctly instantiates
&driftnet.Agent{}. EnsureAgent.Name()returns"driftnet"(lower-case) to stay in sync with the key checks elsewhere.runner/options.go (1)
63-64: Good – new flag wired into Options structNo functional concerns here.
README.md (1)
52-53: Nice – Driftnet added to supported enginesDocumentation updated correctly.
sources/provider.go (1)
124-127: LGTM – integration matches existing providersKey selection logic mirrors the other providers and should work as expected.
sources/agent/driftnet/response.go (1)
1-54: Structs look fineTypes accurately map the API payloads and use correct JSON tags.
|
@dogancanbakir, believe this is somewhat expected, let us know if you need anything else here. |
dogancanbakir
left a comment
There was a problem hiding this comment.
LGTM
$ go run . -driftnet 'field=product-tag:jira'
__ ______ _________ _ _____ _____
/ / / / __ \/ ___/ __ \ | / / _ \/ ___/
/ /_/ / / / / /__/ /_/ / |/ / __/ /
\__,_/_/ /_/\___/\____/|___/\___/_/
projectdiscovery.io
[INF] Current uncover version v1.0.10 (latest)
5.x.255.x:443
5.x.255.x:443
...
$ echo 8.8.8.8/20 | go run . -e driftnet
__ ______ _________ _ _____ _____
/ / / / __ \/ ___/ __ \ | / / _ \/ ___/
/ /_/ / / / / /__/ /_/ / |/ / __/ /
\__,_/_/ /_/\___/\____/|___/\___/_/
projectdiscovery.io
[INF] Current uncover version v1.0.10 (latest)
8.8.1.106:22
8.8.1.106:22
....
Adds search engine Driftnet as requested in #676
Ref: https://driftnet.io/
API Guide: https://driftnet.io/api-docs/getting-started
Summary by CodeRabbit
New Features
Documentation