Mechanism-based detections + cut default-exclude false-positive noise#1
Open
joaopege1 wants to merge 1 commit into
Open
Mechanism-based detections + cut default-exclude false-positive noise#1joaopege1 wants to merge 1 commit into
joaopege1 wants to merge 1 commit into
Conversation
Mechanism detections (catch techniques, not just known strings): - fake-font: a font-extension file whose bytes are text/script (the loader disguise). HIGH; reads only the first 16 bytes so it runs even past the content-size cap and needs no signature update for new loaders. - vscode-autorun combo: a tasks.json/settings.json that runs on folderOpen is LOW; one that also fetches/executes a remote payload is HIGH. A bare https URL ($schema) is not treated as a fetch signal. - exfil-archive-name: the user$host_YYMMDD_HHMMSS#hash.zip naming (MEDIUM). Default-exclude noise (all restored by --no-default-excludes): - Skip the scanner's own cargo target/ tree (build artifacts + the test corpus of deliberately-malicious fixtures), inferred from the running binary's path; None for an installed binary so real files aren't hidden. - Skip Chromium/Electron/VS Code app-data caches (Cache_Data, Code Cache, GPUCache, Dawn*Cache, IndexedDB, Service Worker, blob_storage, workspaceStorage) and *.vscdb state stores. These echo indicators you have viewed, typed, or discussed, never an executable payload. Integration tests drive the real binary with --no-default-excludes since the fixtures live under target/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two complementary improvements that move the scanner from pure string-matching toward behaviour-based detection with far less noise.
1. Mechanism-based detections (catch techniques, not just known strings)
fake-font— a.woff2/.woff/.ttf/...file whose bytes are actually text/script (the PolinRider loader disguise). HIGH. Reads only the first 16 bytes, so it runs even past the content-size cap and needs no signature update when the loader mutates.vscode-autoruncombo — atasks.json/settings.jsonthat runs onfolderOpenis LOW (legit VS Code feature); one that also fetches/executes a remote payload is HIGH. A barehttpsURL (e.g.$schema) is deliberately not treated as a fetch signal.exfil-archive-name— the campaign's staged-exfil naminguser$host_YYMMDD_HHMMSS#hash.zip(MEDIUM).2. Cut default-exclude false-positive noise
A full-
/scan was flagging ~70 hits that were all records that quote indicators, never payloads. Now skipped by default (restored with--no-default-excludes):target/tree (build artifacts + the deliberately-malicious test corpus), inferred from the running binary's path. ReturnsNonefor an installed binary so real files are never hidden.Cache_Data,Code Cache,GPUCache,Dawn*Cache,IndexedDB,Service Worker,blob_storage,workspaceStorage— and*.vscdbstate stores. These echo indicators you've viewed, typed, or discussed in Slack/VS Code, never an executable payload. (A bareCacheis intentionally not skipped — projects use it.)Testing
tests/heuristics.rs: each detection has a positive case (must flag) and a benign look-alike (must stay clean). Tests drive the real binary with--no-default-excludessince fixtures live undertarget/.cargo test(6 pass),cargo fmt --check,cargo clippyall clean.state.vscdb, and the tool's owntarget/tmpcorpus now scan CLEAN by default and reappear under--no-default-excludes.🤖 Generated with Claude Code