Skip to content

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

c3l3si4n
Copy link

@c3l3si4n c3l3si4n commented May 2, 2025

Documentation at https://gist.github.com/c3l3si4n/68ac06ebe85f8c0b821800432c7f89a6

Summary by CodeRabbit

  • New Features

    • Added support for the "pugrecon" source in passive subdomain enumeration, enabling users to discover subdomains using this new provider.
  • Bug Fixes

    • Updated test cases to include "pugrecon" in the expected list of passive sources.
  • Chores

    • Set a default rate limit for the "pugrecon" provider to ensure optimal request handling.

Copy link

coderabbitai bot commented May 2, 2025

Walkthrough

The changes introduce a new passive subdomain enumeration source called "pugrecon" to the codebase. This involves implementing the pugrecon source with its own logic for making API requests, handling responses, and integrating with the existing subscraping framework. The AllSources array is updated to include the new source, and the import order is adjusted. The test suite is updated to expect "pugrecon" as an available source, and a default rate limit entry for "pugrecon" is added to the configuration.

Changes

File(s) Change Summary
v2/pkg/passive/sources.go Added pugrecon to imports and the AllSources array; reordered digitalyama import and entry.
v2/pkg/passive/sources_test.go Updated expectedAllSources to include "pugrecon".
v2/pkg/runner/options.go Added default rate limit configuration for "pugrecon" (10 requests/sec).
v2/pkg/subscraping/sources/pugrecon/pugrecon.go New file implementing the pugrecon subscraping source, including API logic and metadata methods.

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
Loading

Poem

In the warren of code, a new friend appears,
"Pugrecon" hops in, greeted with cheers!
With keys and requests, it sniffs out domains,
Joining the sources, expanding our gains.
Now rabbits can find, with even more might,
Subdomains that hide, both day and night!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 messages

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between 678fbc8 and 42d4a79.

📒 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 list

The 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 pugrecon

The 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 correctly

The 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 source

The 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 types

The 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 method

The 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 implemented

All 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.

@GeorginaReeder
Copy link

Thanks so much for your contribution @c3l3si4n ! :)

@dogancanbakir
Copy link
Member

dogancanbakir commented May 17, 2025

@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

Copy link
Member

@dogancanbakir dogancanbakir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a comment

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.

3 participants