Skip to content

feat: add scanmalware search agent - #750

Open
jonaslejon wants to merge 1 commit into
projectdiscovery:devfrom
jonaslejon:feat/scanmalware
Open

jonaslejon wants to merge 1 commit into
projectdiscovery:devfrom
jonaslejon:feat/scanmalware

Conversation

@jonaslejon

Copy link
Copy Markdown

Proposed changes

Adds ScanMalware as a search agent. No API key: the API is
anonymous, so it works on a fresh install with no config. The query is SMQL, ScanMalware's own
syntax, passed through unchanged the way fofa and shodan pass theirs.

uncover -scanmalware 'domain:*.example.com'
uncover -scanmalware 'url:https://example.com/login'
uncover -scanmalware 'asn:15169 AND country:DE'

Two things for review:

  • It returns URLs and hostnames, not ip:port. The archive records what a browser saw, and a
    scan resolves several addresses, so there is no single listening service. Host and Url are
    set, IP/Port left empty, which runner.go already handles by falling back to host;
    nerdydata sets the same subset.
  • One change outside the agent. shodan-idb was the only keyless engine and is named as a
    literal in two places. I replaced those with an anonymousAgents set; happy to use two literals
    instead if you'd rather keep the diff minimal.

Proof

go build, go test ./... and golangci-lint run --timeout=30m ./... clean on dev with Go
1.24.6, matching what CI installs from go.mod. Measured from an empty $HOME, no config:

domain:*.stripe.com        32 results   1.61s
asn:15169 AND country:DE   92 results   2.03s
has:malware                94 results   3.82s

Seven tests, each first run against a deliberately broken build to confirm it fails. That is how
the cancellation test got rewritten: the first version drained the channel, so it passed even with
sources.SendResult swapped for a plain results <- r.

Checklist

  • Pull request is created against the dev branch
  • All checks passed
  • I have added tests that prove my feature works
  • I have added necessary documentation (README engine list, -e help, -scanmalware/-sm flag)

Disclosure: I run ScanMalware, so this is a vendor-submitted source. Flagging it up front
rather than leaving it to be found in review.

ScanMalware searches an archive of sandboxed URL scans. The API is anonymous,
so the agent works on a fresh install with no provider config; the query is
SMQL, passed through unchanged the way the fofa and shodan agents pass theirs.

The archive records what a browser saw, so results carry Host and Url rather
than ip:port, which runner.go already handles by falling back to the host
field, as it does for nerdydata.

shodan-idb was the only keyless engine and was named as a string literal in
two places. Those become an anonymousAgents set so a second keyless engine
does not need a third and fourth literal.
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a636a87a-a044-4a6f-ad1e-b4612f6f4a43

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

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.

1 participant