> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vigolium.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Utility Toolbox

> vigolium kit, the scanner's internal primitives exposed as standalone one-shot tools for shell pipelines and coding agents.

`vigolium kit` is a family of small, **stateless** primitives carved out of the scanner's own engine — no database, no project scope, no scan pipeline. Each one is a single transform or probe: it reads files or stdin, honours `-j/--json` for machine output, and gates via exit codes.

Added in **v0.4.1**. They exist because the useful parts of a scanner are often wanted *outside* a scan — grepping a repo for leaked credentials, unminifying one bundle, cracking one JWT — and shelling out to five separate tools to do it is the wrong shape.

> [!NOTE]
>
> These are **primitives**: they do one job and report raw output, never a vulnerability verdict. They touch no project database, so nothing is persisted — pipe the output where you need it. For findings that persist, use `vigolium scan` or the [agent modes](https://docs.vigolium.com/agentic-scan/agent-mode.md).

## The commands

| I need to… | Use |
| - | - |
| Scan files/dirs/stdin for leaked credentials | `vigolium kit secret-scan <files\|dirs\|->` |
| Unminify / unpack a JS bundle | `vigolium kit js-beautify <file\|url\|->` |
| Mint OOB callback URLs and drain hits | `vigolium kit oast new` → `vigolium kit oast poll` |
| Collect known URLs for a domain | `vigolium kit harvest <domain…>` |
| Recover a JWT's HMAC signing secret | `vigolium kit jwt-crack <token>` |
| List / print the built-in wordlists | `vigolium kit wordlist [name]` |
| Emit built-in payloads by class | `vigolium kit payload --class <c>` |
| Collect scratch left behind in the temp dir | `vigolium kit tmp-clean` |

Every command reads `-` (or no argument) as stdin and takes `-j/--json` for a single structured object on stdout. Human notes go to stderr, so a pipe stays clean.

***

## `secret-scan`

Scan bytes for leaked secrets with the embedded detection catalog (\~12k kingfisher + Vigolium rules, pure Go, no network). Positional arguments are files or directories, walked recursively; `-` or no argument reads stdin.

```bash theme={null}
vigolium kit secret-scan config.env .github/            # files + dirs
cat bundle.js | vigolium kit secret-scan -              # stdin
vigolium kit secret-scan -j --min-confidence high src/  # high-confidence JSON
```

| Flag | Effect |
| - | - |
| `--min-confidence low\|medium\|high` | Threshold (default `low`) |
| `--rule` / `--exclude-rule` | Allow/deny by rule ID (comma-separated) |
| `--redact` | Mask the value, keeping a prefix/suffix. **The full value is shown by default** |
| `--fail-on-match` | Exit **3** when any secret is found (CI/agent gate) |
| `--max-file-size` | Skip files larger than N bytes (default 16 MiB) |

JSON shape: `{files_scanned, count, matches:[{rule_id, rule_name, confidence, secret, entropy, file, line, start, end}]}`.

Reports *where* a secret is, never whether it is exploitable. Obvious placeholders (`…EXAMPLE`, `123456…` sequences) are safelisted away, so test with realistic-looking values.

## `js-beautify`

Unminify and unpack minified or bundled JavaScript with the embedded jstangle tool (webcrack — no eval-based deobfuscation). The argument is a local file, an `http(s)://` URL that gets fetched, or `-`/no argument for stdin.

```bash theme={null}
vigolium kit js-beautify app.min.js                     # local file
vigolium kit js-beautify https://target.example/main.abc.js
cat bundle.js | vigolium kit js-beautify -              # stdin
vigolium kit js-beautify -j --extract app.min.js        # + extracted endpoints
vigolium kit js-beautify --modules ./out app.min.js     # one file per module
```

By default it writes beautified source to stdout, emitting the input unchanged when it is neither minified nor bundled. `--extract` also runs endpoint extraction.

| Flag | Effect |
| - | - |
| `--extract` | Also run endpoint extraction (a full analysis pass); included in `-j` output |
| `--modules <dir>` | Write each recovered module to its own file under `<dir>`, at its recovered path |
| `-o, --output <file>` | Write the beautified source to a file instead of stdout (`-` means stdout) |
| `--profile <p>` | `beautify` \| `endpoints` \| `discovery` \| `discovery-lite` \| `full` \| `inspect` \| `dom-security` \| `legacy`; default depends on `--extract` |
| `--unpack-modules` | Unpack a bundle and re-scan each module for endpoints (implies `--extract`) |
| `--max-ast-nodes` | AST node budget before the analysis degrades to a per-module scan (0 = engine default, 500k) |
| `--max-input-mb` | **Lowers** the input ceiling only; it cannot raise it above the service limit |
| `--deadline` | Analysis deadline (0 = engine default, 60s) |
| `--timeout` | Fetch timeout for a URL argument (default 30s) |

JSON shape: `{source, status, changed, format, module_count, module_paths?, bytes_in, bytes_out, content, endpoints?, diagnostics?, output_path?, modules_dir?, modules_written?}`. Endpoints carry `{url, method, params, body, headers, cookies, extractor, confidence, module_path?}`.

> [!WARNING]
>
> **Read `status` before trusting `endpoints`.** `complete` is a clean AST pass. `partial` means some stages did not run, and the `diagnostics` codes say which. `failed` means the analysis produced nothing of its own. The exit code is **0** either way — a degraded analysis is never non-zero, so `status` and `diagnostics` are the only signal.

**A big bundle returns `partial`, and that is the good outcome.** A script dense enough to blow the AST budget cannot be parsed whole, so the engine unpacks it and analyzes each module separately (`ast_budget_recovered_by_module_scan`). Those endpoints carry `extractor: "bundle-module"` and a `module_path`, with real methods, headers and body templates. A `partial` from that path is far better data than a `complete` from a small file.

**An empty `method` means unresolved, not `GET`.** The `large-input-string-fallback` extractor is a regex sweep over source no analyzer could parse; it recovers URLs only. Treat `confidence: "low"` plus an empty method as a lead to confirm, never as a request to replay.

For a bundle of any size, prefer `--modules <dir>` over reading `content`: a 400-module document is one 5 MB blob, and a directory is greppable.

## `oast` (`new` / `poll`)

Generate interactsh out-of-band callback URLs, and later poll for the DNS/HTTP/SMTP interactions they received — the primitive behind blind SSRF/XXE/RCE/Log4Shell confirmation.

State lives in a **session file**, so minting and polling are separate fire-and-forget invocations with no long-running process between them.

```bash theme={null}
vigolium kit oast new -n 2 --session run.yaml             # mint 2 URLs, save session
# ...inject the URL(s) somewhere, wait...
vigolium kit oast poll --session run.yaml --wait 30s -j   # drain interactions as JSON
vigolium kit oast poll --session run.yaml --deregister    # final drain + tear down
```

| Flag | Command | Effect |
| - | - | - |
| `-o/--session` | both | Session file path (default `oast-session.yaml`) |
| `--server` / `--token` | `new` | interactsh server (default `oast.pro`) and auth for a self-hosted one |
| `-n/--count` | `new` | Number of URLs to mint |
| `--wait` / `--interval` | `poll` | How long to poll / cadence (auto-shrunk below `--wait`) |
| `--deregister` | `poll` | After draining, destroy the session server-side and delete the file |

`poll` JSON: `{server, session, count, interactions:[{protocol, unique_id, full_id, remote_address, timestamp, raw_request, raw_response}]}`.

> [!WARNING]
>
> Callbacks to the default public `oast.pro` server are visible to whoever operates it. Point `--server`/`--token` at a self-hosted interactsh to keep them private.

## `harvest`

Collect historically-known URLs for one or more domains from public archives and indexes — the same source set as the scan's [external-harvest phase](https://docs.vigolium.com/native-scan/how-it-works.md). Wayback, Common Crawl, AlienVault OTX and Arquivo are keyless and on by default; urlscan and VirusTotal join when their key is configured under `external_harvester`.

A URL argument is reduced to its host; `-` reads domains one per line from stdin.

```bash theme={null}
vigolium kit harvest target.example                     # one domain
vigolium kit harvest target.example shop.target.example -j
cat domains.txt | vigolium kit harvest -                # stdin
vigolium kit harvest --source wayback,commoncrawl target.example
```

Plain mode streams deduped URLs one per line, so it pipes straight into another tool. `-j` yields `{domains, sources, count, urls}`.

## `jwt-crack`

Brute-force a JWT's HMAC signing secret (HS256/384/512) against a wordlist. A token declaring an asymmetric algorithm (RS\*/ES\*/PS\*) is additionally tried under every HMAC variant — the algorithm-confusion attack — and a match is labelled as such. The token is a positional argument or `-`/stdin; a leading `Bearer ` is stripped.

```bash theme={null}
vigolium kit jwt-crack eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...
echo "$TOKEN" | vigolium kit jwt-crack -
vigolium kit jwt-crack -w /path/rockyou.txt -p s3cr3t eyJ...
vigolium kit jwt-crack -j --fail-on-crack eyJ...
```

| Flag | Effect |
| - | - |
| `-w/--wordlist` | Built-in name (see `kit wordlist`) or a file path. Defaults to the embedded `jwt.secrets.list`, \~104k entries |
| `-p/--secret` | Inline candidate secret (repeatable) |
| `--fail-on-crack` | Exit **3** when the secret is recovered |

JSON: `{alg, cracked, secret, matched_alg, candidates_tried, wordlist, header, payload}`. The recovered secret is printed in full — that is the point of the command.

## `wordlist`

List the embedded wordlists, or print one to stdout so it can be piped into another tool.

```bash theme={null}
vigolium kit wordlist               # list available lists with entry/byte counts
vigolium kit wordlist -j            # the same, as JSON
vigolium kit wordlist fuzz          # print the fuzz list to stdout
vigolium kit wordlist jwt > jwt.txt # materialize (alias: jwt → jwt.secrets.list)
```

A name matches the embedded filename, its basename without extension, or the `jwt` alias. Built-ins: `dir-short`, `dir-long`, `file-short`, `file-long`, `fuzz`, `jwt.secrets.list`.

## `payload`

Print the built-in fuzzing payloads for one or more classes, one per line — the same catalog behind [`vigolium fuzz --class`](https://docs.vigolium.com/others/cli-references#fuzz).

```bash theme={null}
vigolium kit payload --list              # list classes
vigolium kit payload --class sqli        # SQLi payloads
vigolium kit payload --class sqli,xss -j # two classes, as JSON
```

Classes: `cmdi`, `crlf`, `lfi`, `open_redirect`, `path_traversal`, `sqli`, `ssrf`, `ssti`, `xss`, `xxe`, plus aliases (`sql` → `sqli`, `traversal` → `path_traversal`). JSON: `{classes, count, payloads}`.

## `tmp-clean`

Remove the temporary scratch Vigolium left in the system temp directory. Added in **v0.5.0**.

```bash theme={null}
vigolium kit tmp-clean                   # collect scratch idle for 6h or more
vigolium kit tmp-clean --max-age 0       # collect everything not currently held
vigolium kit tmp-clean -j                # the same, as JSON
```

| Flag | Effect |
| - | - |
| `--max-age <d>` | Only remove scratch untouched for at least this long (default `6h`; `0` removes everything not held by a running scan) |

JSON shape: `{temp_dir, scratch_root, abandoned_removed, legacy_removed, total_removed, duration}`.

As of v0.5.0 every scan allocates its scratch under one root and removes the whole thing on exit, so a run that finishes — or is interrupted — cleans up after itself. This command is for what is **already** there: scratch from runs that were killed, and the loose per-store directories that earlier versions allocated straight into the temp directory.

> [!NOTE]
>
> **That backlog gets large, and it is also a startup cost.** One workstation had accumulated 71,614 leftover dedup directories totalling 108 GB, and separately 3,384 stranded Chromium profiles worth 104 GB — the spidering browser never called go-rod's `launcher.Cleanup()`. Vigolium's own dependencies used to sweep the whole temp directory at startup, so the litter made every invocation slower in proportion to how much of it there was.
>
> Only names Vigolium itself allocates are touched, and only entries untouched for `--max-age`, so scratch belonging to a scan running right now is never taken.

***

## Gotchas

* **Stateless by design.** Nothing lands in the project database — pipe or redirect the output yourself.
* **`oast new` does not tear down the session.** Closing an interactsh client deregisters it server-side, so `new` mints, saves and exits *without* closing; the session stays alive for `poll`. Use `poll --deregister` to destroy it explicitly when you're done.
* **`oast --interval` is auto-shrunk** below `--wait` (the poll ticker only fires after one full interval), so even a short `--wait` polls at least twice.
* **`secret-scan` safelists placeholders.** `AKIA…EXAMPLE` and `123456`-sequence tokens are treated as benign.
* **`js-beautify` never exits non-zero for a degraded analysis.** A bundle that only half-analyzed still exits `0`; `status` and `diagnostics` are the only signal.
* **`js-beautify --max-input-mb` cannot raise the ceiling.** The service takes the lower of this and its own limit (10 MiB by default), so a larger value is silently ignored. Raise `jstangle.hard_input_mb` in config instead.
* **Exit 3 is a gate, not an error.** `secret-scan --fail-on-match` and `jwt-crack --fail-on-crack` exit `3` on a hit; otherwise the usual `0` success / `1` error / `2` usage error applies. See the [exit-code table](https://docs.vigolium.com/others/cli-references.md#exit-codes).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.