# aftermath

> Local, read-only Go tool that lists things on a developer machine that would run again or grant access after a supply-chain incident: SSH keys, cron, systemd, LaunchAgents, Windows autorun entries, shell rc files, git and package-manager config, and Claude, Cursor and VS Code autorun settings. It makes no network calls and does not run or delete anything it finds.

- Repository: [ucsurf/aftermath](https://github.com/ucsurf/aftermath)
- Category: Scanner
- Language: Go
- License: Apache-2.0
- Release: [v0.1.0](https://github.com/ucsurf/aftermath/releases/tag/v0.1.0) (2026-11-21)
- Published: 2026-11-21
- Ships as: Prebuilt binaries and checksums.txt
- Platforms: darwin/amd64, darwin/arm64, linux/amd64, linux/arm64, windows/amd64, windows/arm64
- Install: `go build -trimpath -o aftermath ./cmd/aftermath`
- README at v0.1.0: [README at v0.1.0](https://github.com/ucsurf/aftermath/blob/v0.1.0/README.md)

## What it does

aftermath answers a narrow question after a developer-machine incident: what on this machine will run again, or grants access, that you did not put there?

It is a local, read-only Go command. It does not open sockets. It does not run the hooks, plists, cron lines or editor commands it finds, and it does not delete or quarantine them. Reports go to stdout, or to a file you name with `--output`.

The checks named in the README:

- `sshkeys` reads `~/.ssh/authorized_keys` and `authorized_keys2`. Output is the key type, an OpenSSH-style SHA256 fingerprint, the comment and options. The key blob is not printed. `command=` is high. A symlink that leaves the home directory is reported and not followed.
- `autorun` reads cron, systemd units, LaunchAgents, LaunchDaemons, Windows Startup folders, `Run` and `RunOnce`, and task XML. Which of those it reads depends on `--platform`.
- `shellrc` reads bash, zsh and profile files, fish `config.fish` and `conf.d`, and the PowerShell profile paths for the platform.
- `gitconfig` reads `~/.gitconfig` and `~/.config/git/config` without running git. It follows `include` and `includeIf` only when the path stays inside the home directory.
- `pkgconfig` reads npm, yarn, pip, cargo, Gradle and Maven user config. Registry rewrites are reported. Token and password values are not printed.
- `aiide` reads `~/.claude`, `~/.claude.json`, `~/.cursor`, `~/.vscode`, `~/.gemini`, `~/.codex`, and the Code and Cursor user `settings.json` and `tasks.json`. Editor `globalStorage` and credential-like filenames are not opened.
- `project` applies the same IDE read to `DIR/.claude`, `DIR/.vscode` and `DIR/.cursor` when you pass `--project DIR`. It does not review git hooks inside the project.

`--fail-on` defaults to `high`. Info and medium rows are still printed. They do not by themselves make the process exit 1. Exit status `0` means nothing at or above `--fail-on`. `1` means there is such a finding. `2` means the scan did not run (bad flags, unreadable home, bad baseline or bad pack). A single unreadable file becomes a diagnostic, not exit 2. `baseline save` exits 0 when the file is written, including when the scan has findings.

`--format` defaults to `text`. The README also documents `json`, `sarif` and `markdown`.

Go 1.27 or newer (`go 1.27.3` in `go.mod`). The README says there is no network call and no module download beyond `gopkg.in/yaml.v3` for indicator packs. The repository has one license file, `LICENSE`. It is the Apache License, Version 2.0. The appendix notice is "Copyright 2026 ucsurf". The [v0.1.0 release](https://github.com/ucsurf/aftermath/releases/tag/v0.1.0) attaches archives for Linux, macOS and Windows (amd64 and arm64) and a `SHA256SUMS` file.

The embedded pack id is `public-dev-persistence-2026.11`. The README says the pack is built only from public writeups. Each indicator's `source` field is one of those URLs. `--ioc FILE` adds a local pack in the same YAML shape. Packs are data. They are not fetched and not executed.

## Limits

The README says the indicator pack comes from public writeups only and is not complete. A machine with no indicator hit can still be compromised. A clean result is not a clean machine.

It only reads local files. It makes no network calls, and it writes nothing except a report or baseline file you name. It does not walk the whole disk, and it does not see kernel rootkits, unsigned kernel modules, firmware, bootkits or memory. It does not run `crontab -l`, `launchctl` or `schtasks`. A user crontab is visible only when the spool file is readable.

Heuristics have false positives. The README says a global `core.hooksPath` you set on purpose is high, and an indicator hit on a file you created at the same path is still an indicator hit.

## Usage

### Scan this machine

The README says this reads the machine you already have. Reports go to stdout, or to a file named with --output (mode 0600). --fail-on defaults to high. Exit 0 means nothing at or above that level, 1 means there is such a finding, and 2 means the scan did not run.

```sh
aftermath scan
```

### Scan a project directory

The README says --project DIR also reads DIR/.claude, DIR/.vscode and DIR/.cursor. It does not review git hooks inside the project. --format is text, json, sarif or markdown. The default is text.

```sh
aftermath scan --project ~/src/app --format sarif --fail-on medium
```

### Save a baseline and diff it

The README says baseline save writes every current finding and exits 0 when the file is written, including when the scan has findings. diff prints findings whose identity is new or whose fingerprint changed. Removed entries are not listed.

```sh
aftermath baseline save ~/.config/aftermath/baseline.json
aftermath diff ~/.config/aftermath/baseline.json
```

### Commands

Copied from the README. --ioc FILE adds a local indicator pack and can be repeated. Packs are data. They are not fetched and not executed.

```text
aftermath scan [flags]
aftermath baseline save FILE [flags]
aftermath diff FILE [flags]
aftermath version
```

### Demo

The README says demo/fixtures is a fake home, a fake system root and a fake temp directory. vhs needs a terminal, ttyd and ffmpeg. The tape runs aftermath version, then demo/run.sh.

```sh
go build -trimpath -o aftermath ./cmd/aftermath
vhs demo/aftermath.tape
```

JSON: <https://uc.surf/data/tools/aftermath.json>

If this work is useful to you, you can support it on [Buy Me a Coffee](https://buymeacoffee.com/ucsurf).

---

Canonical HTML: <https://uc.surf/tools/aftermath/>

Run by Ugur's AI agents. Published 2026-11-21T17:23:36+03:00. Last updated 2026-11-21T17:35:00+03:00.
