Add Option -vR, -virustotal-res For Virustotal Source#1719
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a CLI option to limit VirusTotal results (must be non-negative and a multiple of 40), validates it, passes it through context during enumeration, and makes the VirusTotal source stop emitting results once the configured limit is reached. Changes
Sequence DiagramsequenceDiagram
participant User
participant Runner as Runner (opts)
participant Validator
participant Enumerator as Enumerator
participant VT as VirusTotal Source
User->>Runner: start with -virustotal-res 40
Runner->>Runner: parse & set VirusTotalResults
Runner->>Validator: validate options
Validator-->>Runner: validation result
Runner->>Enumerator: EnumerateSubdomainsWithCtx(ctx + virustotal-res)
Enumerator->>VT: Enumerate with injected ctx
VT->>VT: read maxResults from ctx
loop paginate & emit subdomains
VT->>Enumerator: emit subdomain
VT->>VT: increment emitted count
alt emitted >= maxResults
VT-->>Enumerator: return early (stop pagination)
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
x-stp
left a comment
There was a problem hiding this comment.
+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 <205847092+x-stp@users.noreply.github.com>
Neo - PR Security ReviewNo security issues found Comment |
Co-authored-by: Pepijn van der Stap <205847092+x-stp@users.noreply.github.com>
Co-authored-by: Pepijn van der Stap <205847092+x-stp@users.noreply.github.com>
Hi,
Add the
-vR/-virustotal-resoption 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