Repository navigation
Releases
v1.2.0
Driven by a second hunt, through fake cheat and airdrop lure repos: nine more malicious repositories across five campaigns, including a GitHub Pages redirector kit shared by a crypto claimer and an Adobe impersonation. This release teaches the scanner the delivery-side patterns that hunt exposed.
- New structural check: REDIRECTOR (High). Fires when a single HTML or JavaScript file combines all three signals of the remote-config redirector kit: a fetch() call with a literal URL or an XMLHttpRequest being opened, an atob() base64 decode, and a location redirect assignment (window.location, location.href, location.replace). One or two signals never fire. The check runs on loose files and on HTML and JavaScript entries inside zip archives, and is covered end to end by a synthetic kit fixture in the test suite.
- SS099 extended. File-host lure links now also match direct-download paths with no archive extension (/file/, /directdownload/, /download/ segments and download query parameters), and URL shorteners (cutt.ly, bit.ly, tinyurl.com, rb.gy) match when the same line also carries a download signal: the words download, installer or setup, or an archive extension. A bare shortener link still does not fire.
- Oversize archives are no longer skipped silently. A zip over the scan size cap now produces an ARCHIVE-UNREADABLE info finding stating it was not inspected due to size; the oversize skip counter still records the skip.
- New pattern rule (100 total, up from 99): SS100 (Medium) antivirus-disable instruction. Mentions in a detection context ("detected by Windows Defender") do not fire.
- 197 tests (up from 177).
What v1.2 still cannot do: judge the intent of an encrypted payload whose strings decrypt only at runtime, follow a redirector or fetch its remote config to see where it leads, inspect encrypted archives, open archives nested inside other archives, or inspect non-ZIP archive formats.
SecretSweep v1.1.0
SecretSweep v1.1.0 is driven by a real find: a malicious repository (a token-claim lure aimed at owners of compromised wallets) whose entire payload sat inside a zip that v1.0 skipped as an opaque binary. The zip held a launcher script (Launcher.cmd), a bundled LuaJIT executable, and a 296 KB single-line script payload disguised as icon.txt. v1.0 saw none of it. v1.1 was built so that it would.
Archive inspection (the headline fix)
Worktree scans now open zip archives (detected by extension or PK header) instead of skipping them:
- Text-like entries are scanned with the normal rule engine. Findings are reported as
archive.zip!/entry-name, so the entry can be located. - A dedicated structural warning, ARCHIVE-EXEC (High), fires when an archive contains an executable (
.exe,.dll,.scr,.com,.msi,.sys) together with a launcher or script file (.cmd,.bat,.ps1,.vbs,.jsand relatives), or with a large single-line text file of 50 KB or more, the disguised-script shape the real payload used. Document and source archives without executables do not trigger it. Run against a synthetic reconstruction of the hunt scenario, this warning names the executable, the launcher, and the single-line file. - Corrupt or encrypted archives, and entries that cannot be read, are reported once as ARCHIVE-UNREADABLE (Low) instead of failing the scan.
- Safety caps: at most 512 entries examined, at most the
--max-sizecap (1 MiB by default) extracted per entry, at most 16 times that per archive. Entries are read in memory only; nothing is written to disk or executed. - One new dependency: the
zipcrate, with only the deflate feature enabled.
New pattern rules (99 total, up from 94)
- SS095 auth.gg secret (High): an application secret or API key assigned near an auth.gg reference. This was a real leaked credential the hunt found v1.0 missing.
- SS096 Ethereum address and SS097 Bitcoin address (Low, informational): addresses are public identifiers, not secrets. They are classified so a hardcoded payout address in source is labelled as one instead of surfacing only as generic entropy noise. An address in a labelled example or test fixture will still match; the classification is informational by design.
- SS098 private-key persistence (High): code that writes private key material (
private_key,pk_hex, seed phrase, mnemonic) to a file. This is a same-line heuristic: the key identifier and the file-write call must appear on the same line. The decoy app in the malicious repo did exactly this, saving a rawpk_hexinto a home-directory file. - SS099 file-host archive link (Low, the stretch rule, included because it could be made precise): a download link that points to an archive (extension or archive path) on a short list of file-hosting services frequently abused for malware lures, including password-protected archive campaigns. A file-host homepage or help page alone does not match.
Tests
177 tests, all passing (up from 152). New coverage includes: a planted key inside a zip text entry found with the archive path shown, exe-plus-launcher and exe-plus-large-single-line archives triggering ARCHIVE-EXEC, docs-only and exe-only archives staying quiet, a corrupt zip reported uninspectable while the rest of the scan continues, oversized archives skipped and counted, nested zips not opened, entries beyond the per-entry cap not extracted, and positive and negative cases for every new rule. All fixtures are synthetic and benign; no part of the real malicious archive is included anywhere in this repository.
What v1.1 still does not catch
- The intent of an encrypted payload whose strings only decrypt at runtime. v1.1 flags the Auto-claimer zip's structure and scans its text entries, but the payload's destination stays hidden without execution, which a scanner must never do.
- Encrypted archives and encrypted entries: reported as uninspectable, contents not scanned.
- Archives nested inside other archives (listed, not opened) and non-ZIP archive formats such as tar, 7z and rar (still skipped as binary).
- The SS098 persistence check misses key material and its write call split across different lines.
SecretSweep v1.0.0
First release of SecretSweep, an offline secrets scanner written in Rust.
What is included:
- 94 pattern rules for known providers and formats: AWS, GCP, Azure, GitHub, GitLab, Slack, Stripe, OpenAI, Anthropic, npm, PyPI, database connection strings, private key blocks, generic credential assignments, and more. Run
secretsweep --list-rulesfor the full registry. - A heuristic entropy engine (Shannon entropy over quoted strings and assignment values, charset-aware thresholds, UUID and hash-digest exclusions) that labels its findings as heuristic.
- Worktree scanning that respects .gitignore, skips binaries and oversize files, and still scans lockfiles and dotfiles such as .env.
- Git history scanning via the git CLI (
--git), which finds secrets that were committed and later removed, with the commit hash attached. Merge commits are not covered; see the README limitations. - Baselines (fingerprints only, no secret values are stored) and a TOML allowlist by rule, path glob or fingerprint.
- Text, JSON and SARIF 2.1.0 reports. Reports never print a full secret: at most a four character preview plus a hash fingerprint.
- Exit codes designed for CI: 0 clean, 1 findings at or above --fail-on (default high), 2 usage or runtime error.
- A pre-commit hook example and a .pre-commit-hooks.yaml for the pre-commit framework.
Testing: 152 tests pass locally and in CI (per-rule positive and negative cases for all 94 rules, entropy behaviour, scanner integration on temporary trees, a git history integration test that commits and then removes a documented example key, baseline suppression, report shape, and CLI exit codes). CI also enforces cargo fmt --check and clippy with warnings denied.
Install: cargo install --git https://github.com/RahilSahu/secretsweep --tag v1.0.0 (needs a stable Rust toolchain; history mode also needs git).
Note on fixtures: tests use only publicly documented example credentials or synthetic strings assembled from fragments. During the first push, GitHub push protection flagged two fixtures that were written as single literals (a Slack bot token and a Slack webhook shape); both were reworked into fragmented synthetic strings rather than allowed through, and the push then passed.