-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Added pugrecon.com as a subdomains source #1585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughThe changes introduce a new passive subdomain enumeration source called "pugrecon" to the codebase. This involves implementing the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SubscrapingFramework
participant PugreconSource
participant PugreconAPI
User->>SubscrapingFramework: Initiate subdomain enumeration
SubscrapingFramework->>PugreconSource: Run(domain, session)
PugreconSource->>PugreconAPI: POST /api/v1/domain/query with domain
PugreconAPI-->>PugreconSource: JSON response with subdomains or error
PugreconSource->>SubscrapingFramework: Emit results or errors via channel
SubscrapingFramework->>User: Return aggregated results
Poem
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
v2/pkg/subscraping/sources/pugrecon/pugrecon.go (1)
103-106
: Consider logging non-error messagesThe code currently has a placeholder for handling non-error messages but doesn't do anything with them. Consider logging these messages at debug level to help with troubleshooting.
if response.Message != "" && !response.Limited { // Handle potential non-error messages, except rate limit info - // Log or handle message if needed, but don't treat as hard error unless necessary + session.LogDebug(s.Name(), fmt.Sprintf("API message: %s", response.Message)) }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
v2/pkg/passive/sources.go
(3 hunks)v2/pkg/passive/sources_test.go
(1 hunks)v2/pkg/runner/options.go
(1 hunks)v2/pkg/subscraping/sources/pugrecon/pugrecon.go
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
v2/pkg/passive/sources.go (3)
v2/pkg/subscraping/sources/pugrecon/pugrecon.go (1)
Source
(30-36)v2/pkg/subscraping/sources/digitalyama/digitalyama.go (1)
Source
(14-20)v2/pkg/subscraping/types.go (1)
Source
(37-62)
🔇 Additional comments (7)
v2/pkg/passive/sources_test.go (1)
37-37
: Correctly added pugrecon to the expected sources listThe addition of "pugrecon" to the expectedAllSources list ensures that tests validate the integration of the new source. This change aligns with the addition of the pugrecon source in the main codebase.
v2/pkg/runner/options.go (1)
247-247
: Properly configured rate limit for pugreconThe rate limit of 10 requests per second for pugrecon is appropriate for an external API integration. This will help prevent excessive requests that could lead to API abuse or throttling.
v2/pkg/passive/sources.go (2)
23-23
: Import order adjusted correctlyThe import for digitalyama was moved earlier and pugrecon was added in the appropriate alphabetical position, maintaining the import organization pattern.
Also applies to: 38-38
81-81
: Successfully integrated pugrecon sourceThe pugrecon source is correctly added to the AllSources array, making it available for subdomain enumeration alongside existing sources.
v2/pkg/subscraping/sources/pugrecon/pugrecon.go (3)
15-27
: Well-structured API response typesThe types for parsing the pugrecon API response are clearly defined with appropriate JSON tags, making the code more maintainable and easier to understand.
39-116
: Robust implementation of the Run methodThe Run method follows best practices with:
- Proper error handling with detailed error messages
- Clean resource management (closing response bodies)
- Appropriate use of context for request cancellation
- Good error reporting to calling code
Good job handling edge cases like API errors and rate limiting.
118-151
: Source interface properly implementedAll required methods from the Source interface are correctly implemented:
- Name() returns the correct source identifier
- IsDefault() returns false, making it non-default
- HasRecursiveSupport() returns false, which is appropriate
- NeedsKey() returns true, as the source requires API keys
- Statistics() properly returns tracked operation statistics
This ensures proper integration with the subscraping framework.
Thanks so much for your contribution @c3l3si4n ! :) |
@c3l3si4n Thanks for the PR! Could you check the lint errs? $ go run . -d tesla.com -s pugrecon
__ _____ __
_______ __/ /_ / __(_)___ ____/ /__ _____
/ ___/ / / / __ \/ /_/ / __ \/ __ / _ \/ ___/
(__ ) /_/ / /_/ / __/ / / / / /_/ / __/ /
/____/\__,_/_.___/_/ /_/_/ /_/\__,_/\___/_/
projectdiscovery.io
[INF] Current subfinder version v2.7.1 (latest)
[INF] Loading provider config from /Users/dogancanbakir/Library/Application Support/subfinder/provider-config.yaml
[INF] Enumerating subdomains for tesla.com
npuapt-eng.use1.vn.cloud.tesla.com
model3.tesla.com
...
npuapt-prd.use1.vn.cloud.tesla.com
[INF] Found 40 subdomains for tesla.com in 1 second 23 milliseconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a comment
Documentation at https://gist.github.com/c3l3si4n/68ac06ebe85f8c0b821800432c7f89a6
Summary by CodeRabbit
New Features
Bug Fixes
Chores