Skip to content

Add Option -vR, -virustotal-res For Virustotal Source - #1719

Merged
Mzack9999 merged 7 commits into
projectdiscovery:devfrom
Bundy01:dev
Jul 2, 2026
Merged

Mzack9999 merged 7 commits into
projectdiscovery:devfrom
Bundy01:dev

Conversation

@Bundy01

@Bundy01 Bundy01 commented Jan 29, 2026 •

Copy link
Copy Markdown
Contributor

Hi,

Add the -vR/-virustotal-res option to limit the results. Without adding the option or -vR 0, the current behaviour is preferred (for testing a host or for premium users).

Since the API limitation, it is no longer possible to scan a file with Virustotal.
This PR fixes this by limiting the number of results and corrects the API's 429 error.

Close #1718. See also #1562 and #1705.

I would have liked to add the commented option #virustotal-res with a short description in the config.yaml file automatically, but I did not understand the “goflags” repository.

Regards.

Summary by CodeRabbit

  • New Features
    • Added a --max-results / -mr configuration option (and max-results in YAML) to cap how many results each source emits during passive subdomain enumeration.
    • Uses 0 to mean “no limit”; negative values are rejected.
  • Bug Fixes / Improvements
    • The per-source cap is now enforced during paginated enumeration (including VirusTotal), stopping further pagination once the limit is reached.
  • Documentation
    • Updated the README usage/flags section to document the new max-results option and its per-source behavior.

@coderabbitai

coderabbitai Bot commented Jan 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 52ec62a2-6498-44c2-a724-e4c6d531e079

📥 Commits

Reviewing files that changed from the base of the PR and between deae253 and 1b8a46c.

📒 Files selected for processing (3)
  • pkg/passive/passive.go
  • pkg/runner/options.go
  • pkg/subscraping/types.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/passive/passive.go
  • pkg/runner/options.go
  • pkg/subscraping/types.go

Walkthrough

Adds a max-results option, validates it, propagates it through passive enumeration, documents it, and uses it to stop VirusTotal pagination after the configured number of results.

Changes

Max results configuration and validation

Layer / File(s) Summary
Option parsing and validation
pkg/runner/options.go, pkg/runner/validate.go, README.md
Adds Options.MaxResults, exposes --max-results/-mr, documents the flag, and rejects negative values.
Passive session propagation
pkg/runner/enumerate.go, pkg/passive/passive.go, pkg/subscraping/types.go
Passes the configured limit into passive enumeration and stores it on the subscraping session.
VirusTotal pagination limit
pkg/subscraping/sources/virustotal/virustotal.go
Reads the session limit, tracks emitted results, and returns early when the limit is reached.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Poem

🐰 I set a limit, hop by hop,
The subdomain stream knows when to stop.
Forty or zero, the rules are clear,
Fewer results, less rabbit toil here.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change by adding a VirusTotal result-limit option.
Linked Issues check ✅ Passed The PR adds a configurable max-results limit that VirusTotal honors to reduce requests and rate-limit errors.
Out of Scope Changes check ✅ Passed The changes stay focused on the new max-results option and its VirusTotal integration, with only supporting docs and validation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

Comment thread pkg/runner/enumerate.go Resolved
Comment thread pkg/runner/validate.go Resolved

@x-stp x-stp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 nice one to clean up, seen it happen on my personal key and simply never bothered to rbanch for it, I left some suggestions as you defined VirustotalResultsCtxKey but neither side uses it; it's a clean way to key through the values though.

cheers,

Co-authored-by: Pepijn van der Stap  <[email protected]>
@neo-by-projectdiscovery-dev

neo-by-projectdiscovery-dev Bot commented Apr 18, 2026 •

Copy link
Copy Markdown

Neo - PR Security Review

No security issues found

Comment @pdneo help for available commands. · Open in Neo

@dogancanbakir
dogancanbakir requested a review from Mzack9999 July 1, 2026 08:57
@Mzack9999
Mzack9999 merged commit cdb3279 into projectdiscovery:dev Jul 2, 2026
9 checks passed
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
subfinder 2.15.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed

### 🎉 New Features
* Added shodanct passive source by @dogancanbakir in projectdiscovery/subfinder#1796
* Added Option `-vR`, `-virustotal-res` for VirusTotal source by @Bundy01 in projectdiscovery/subfinder#1719
* Added machine-readable source listing with `-ls -oJ` by @Gerijacki in projectdiscovery/subfinder#1812

### 🐞 Bug Fixes
* Fixed source leaks by @Mzack9999 in projectdiscovery/subfinder#1801
* Fixed drain source channels on cancel so source goroutines exit instead of leaking on a blocked send by @Mzack9999 in projectdiscovery/subfinder#1799
* Fixed crtsh's query by dropping unused certificate metadata from SQL query by @ChrisJr404 in projectdiscovery/subfinder#1787
* Fixed VirusTotal source by capping pagination and providing clearer 429 message by @ChrisJr404 in projectdiscovery/subfinder#1788
* Fixed Anubis source by switching subdomain API to anubisdb.com by @jatinder14 in projectdiscovery/subfinder#1815

### Other Changes
* Fixed lint issues by @dogancanbakir in projectdiscovery/subfinder#1820
* Refactored loadFromFile to use bufio.Scanner by @nandaanomi in projectdiscovery/subfinder#1791


## New Contributors
* @ChrisJr404 made their first contribution in projectdiscovery/subfinder#1787
* @Bundy01 made their first contribution in projectdiscovery/subfinder#1719
* @nandaanomi made their first contribution in projectdiscovery/subfinder#1791
* @jatinder14 made their first contribution in projectdiscovery/subfinder#1815
* @Gerijacki made their first contribution in projectdiscovery/subfinder#1812

**Full Changelog**: https://github.com/projectdiscovery/subfinder/compare/v2.14.0...v2.15.0</pre>
  <p>View the full release notes at <a href="https://github.com/projectdiscovery/subfinder/releases/tag/v2.15.0">https://github.com/projectdiscovery/subfinder/releases/tag/v2.15.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!16007
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.

Limiting Results With the Free Virustotal API

3 participants