Red team · D3 AI-Assisted Security

Red-team the detection

Reason about how an attacker evades naive detections and how to harden each — the offensive angle that produces durable, behavior-based rules.

~35 min · AnythingLLM Desktop · 5 steps

The scenario

You built detections this morning. Now attack them. You cannot write a robust rule until you can see how a weak one fails — so put on the attacker's hat and find the seams in four naive detections, then close them.

New to AnythingLLM? Do the one-time setup first — it takes about five minutes.

1 Guided walkthrough

  1. From the Day 4 pack, upload evasion-challenges.md. It has four naive detection rules.

  2. Work the first rule — an exact string match on "UNION SELECT".

    Paste this into the assistant
    A detection alerts only if a log line contains the exact text "UNION SELECT". How would an attacker evade this, and how would I rewrite the detection to catch SQL injection more robustly?

    You should see: Case changes, inline comments, encoding, alternate syntax — and a suggestion to detect the injection pattern or DB error responses instead of one literal string.

  3. Work the fixed-threshold rule (20 failed logins/minute). Think slow-and-distributed.

    Paste this into the assistant
    A rule alerts on more than 20 failed SSH logins per minute from one IP. Give three ways an attacker stays under it, and a more durable detection.

    You should see: Slow to under the threshold, spread across IPs, spray usernames — and a ratio-based or windowed detection instead of a raw count.

  4. Work the blocklist-IP and User-Agent-name rules the same way. For each, land on the same insight: detect the BEHAVIOR, not the artifact.

  5. Keep it to reasoning and these toy rules — the output is a better detection, not an attack tool.

2 Turn four brittle rules into robust ones

No prompts given this time — you write them. Forming the right question is the skill. Work these on your own; compare with a neighbour if you can.

  1. For each of the four naive rules, write: the evasion that beats it, and a hardened rule that closes the gap.
  2. Name the single pattern all four naive rules share (they detect a surface artifact, not a behavior). State it in one sentence you could teach.
  3. Take your best hardened rule back to the blue lab and check it against the real logs — does it still fire on the actual attack without drowning you in noise?

What to notice

Think about it

Take it further — for fast finishers
In your classroom: The red-team half of Day 4. Drops into offensive-security or detection-tuning units; pairs with the blue detection lab so students build a rule then try to beat it.
Teaching this? Learn to write your own challenges like these — see Build your own red-team challenge.