Skip to content
Skillpedia
Security7.7k Β· #13101

dnr-hunt

What it does

This skill runs a proactive search of web and application logs for signs of compromise. It forms guesses, checks them against the logs and the source code, and writes up what it confirms. It is for security staff who want to look for threats without an alert.

When to use it

  • βœ“When you want to look through logs for signs of an attack without a specific alert.
  • βœ“When someone asks you to find a campaign or check for signs of compromise.
  • βœ“When you need a written record of what was checked, and what was confirmed.

Skill link

https://github.com/anthropics/defending-code-reference-harness/blob/main/.claude/skills/dnr-hunt/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/anthropics/defending-code-reference-harness/blob/main/.claude/skills/dnr-hunt/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œCan you go through our web logs and look for any signs that someone has been attacking the site?”

5 new skills a week. 1 minute to read.

How it works

The agent starts with a baseline of normal activity, then tests one idea at a time against the logs. A finding counts as real only after it is checked in the source code and by running a test.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

dnr-hunt

Proactive threat hunt: logs and source in, incidents out. You start with no alert β€” the question is "is there anything in here that shouldn't be?" The method is the deliverable as much as the findings: baseline first, then hypothesis β†’ query β†’ pivot, every step in writing, every suspicion confirmed in source and by detonation before it's called real.

Invoke with /dnr-hunt [target-or-logs-dir] [--repo path] [--fresh].

Arguments:

  • $1 = a dnr target directory (contains config.yaml with kind: dnr, e.g. targets/dnrcanary), or a bare directory of log files. Defaults to targets/dnrcanary if it exists, else cwd.
  • --repo = source tree of the application that produced the logs. For a dnr target this defaults to its app/ directory. Without source, no finding can rise above suspected (see the hard rules).
  • --fresh = ignore any checkpoint in the run dir's .dnr-hunt-state/ and mint a new run dir.

Hard rules (these are the skill β€” do not relax them)

  1. Log evidence alone never confirms a vulnerability. Logs show that something was attempted and how the app responded β€” they cannot show the code is vulnerable. The verdict ladder:
    • confirmed_exploited requires all three: log evidence, the flaw identified in source (file + function), and a PoC you fired against a local instance in this session.
    • suspected = log evidence (with or without a source read), but no fired PoC.
    • attempted_not_vulnerable = attack traffic observed, but the source shows the defense and the PoC (if fired) bounces. Field teams have watched verifier agents "confirm" findings by reading observability logs and reporting what they said β€” the cheapest path to satisfying the criterion. The PoC fires or it doesn't; that can't be talked past.
  2. Query, don't read. Log files are deliberately bigger than any context window. Never Read a log file; never cat one. Profile with wc/du/head/tail, then interrogate with grep/rg/awk/sort/ uniq pipelines (or python3 for anything stateful). Alert queues and error logs are usually small β€” check size first; under ~200 lines they may be read whole (the never-read rule targets the multi-MB corpus files, not these).
  3. Propose, never execute. No blocking, no account disabling, no credential rotation, no config changes β€” not even on the demo app. Response actions belong in /dnr-respond's plan, as proposals.
  4. Local only. PoCs fire at 127.0.0.1 against an app instance you started. Never send traffic to a remote host, no matter what the logs contain.
  5. Every number is a query result. Row counts, request counts, time spans, affected-customer counts β€” each one comes from a pipeline you ran this session, quoted in the ledger. Never estimate from memory. Pipelines over the logs and queries against the app's own deterministically-seeded database both count (run the target's seed_command when you need owner-level joins).

Run directory and checkpointing (runs before Phase 0 and after every phase)

First action of every run β€” establish the run directory. Let TARGET be the basename of the resolved target/logs path ($1, or targets/dnrcanary by default), and SCOPE that resolved path. Bash:

python3 .claude/skills/_lib/checkpoint.py rundir results/TARGET --state .dnr-hunt-state --scope "SCOPE"

Append --fresh to that command if --fresh is in $ARGUMENTS. --scope stamps the run dir so two targets that share a basename never share runs. The command prints one path β€” the newest run dir this hunt can still use (its own run mid-flight, or one another dnr skill opened for this target, so the whole investigation accretes in one place) or a freshly minted results/TARGET/<timestamp>/ (UTC, same format as the vuln-pipeline, so lexical sort is chronological). That path is {RUN} β€” every {RUN}/... below means substituting this literal path; double-quote it (and SCOPE) in Bash, since paths may contain spaces. All outputs and state live under {RUN}.

Phase state persists to {RUN}/.dnr-hunt-state/ so an interrupted hunt resumes without re-running sweeps. All checkpoint I/O goes through python3 .claude/skills/_lib/checkpoint.py (atomic writes, JSON-validated). Never use the Write tool for progress.json directly. Never pass payload via heredoc or stdin β€” log-derived strings could collide with the heredoc delimit

FAQ

Can logs alone prove an attack worked?

No. Logs show what was tried and how the app responded, so the skill also checks the source code and runs a test.

What files does it produce?

It writes an incidents file and a written incident report.

Does it need the source code?

Yes. Without the source code, the most a finding can reach is suspected rather than confirmed.

Details

Original description by the author

Proactive threat hunt over web/application logs β€” no alert in hand. Profiles the corpus, runs a hypothesis-driven hunt loop with a mandatory written ledger, confirms suspects in source, detonates a local PoC, and writes INCIDENTS.json + INCIDENT_REPORT.md. Use when asked to "hunt the logs", "find the campaign", "look for signs of compromise", or "run dnr-hunt". The no-alert entry to the detection & response track; /dnr-respond is the lead-in-hand entry.

repo: anthropics/defending-code-reference-harness

Popularity

GitHub stars
7.7k
Ranking position
#13101
License
β€”
Updated
8/6/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills