Documentation

Everything there is to read

snare is a single bash program with no build step and no dependencies from a package registry. That keeps the documentation short: install it, learn about a dozen commands, and understand what it cannot do.

Start here

Four ways in, depending on why you are here

Auth

It uses your credentials, and stores none

snare ships no token of its own. Every GitHub call goes through the GitHub CLI using your account, which means it can only ever reach what you can already reach.

authenticate
gh auth login              # browser, or paste your own token
export GH_TOKEN=...        # or an env var

Scopes needed: repo and workflow. Do not use a token with broader permissions. A scanner does not need to administer your account, and a token that can do more is a token worth more to whoever steals it.

If you are here because you were compromised

Do not authenticate with a token that existed while the machine was infected. Rotate first, then log in with the new credential โ€” the rotation order is here. This family harvests token files and environment variables, so a token you reuse is a token the operator may already hold.

Extending

Adding your own detection patterns

All detection reads a single file. Add a pattern there and every command โ€” scan, guard, hook, shield, CI โ€” picks it up, with no code change.

iocs.txt โ€” one extended regex per line, # for comments
# a wallet address seen in a new variant
0x[0-9a-fA-F]{40}

# a C2 hostname
eth\.blockscout\.com

Patterns are extended regular expressions, one per line, # starts a comment. The structural heuristic โ€” code, a run of 50+ whitespace characters, then more code โ€” runs independently of this list, which is why a variant using an address nobody has seen before is still caught.

If you write a pattern that catches something new, send it in. A variant nobody else can detect yet is the single most useful thing to contribute.

State

Where snare keeps things

Everything lives under $SNARE_HOME, which defaults to ~/.snare. Nothing is written outside it except the hooks and shield blocks you explicitly install.

PathWhat is in it
logs/Scan and guard logs, plus saved reports.
logs/evidence/What the guard captured when it killed something โ€” keep this if you plan to report a variant.
backups/Bundle backups written before any fix touches a repository.
work/Scratch clones used during scanning and history rewriting.

SNARE_ROOT overrides where snare looks for its own library files โ€” useful if you installed it somewhere unusual and the launcher cannot resolve lib/.

Index

Every page on this site

PageWhat it covers
The threatBoth execution routes, the hidden-payload specimen, and how the C2 address is read off the blockchain.
Check your machineFour read-only checks, and how to read a clean result honestly.
If you're infectedRotate, clean the machine, clean the repositories, notify โ€” in order.
InstallmacOS, Linux, Windows, WSL, requirements, and first run.
Command referenceEvery command, grouped by purpose, with its limits.
LimitsWhat snare does not do โ€” read this before trusting it.
ChangelogEvery release, false-clean defects listed first.
CommunityDiscussions, field reports, and the questions still open.
Report a bugWhat to report and how โ€” a false clean above all.