Suricata custom exfil

From XuShuwenn/RedAct · View interactive version

Suricata custom exfil is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Write Suricata signatures to detect custom HTTP telemetry exfiltration patterns in network traffic.

How to use this skill

Skill file

Suricata Custom Exfiltration Detection

When to Use

Execution Protocol

Execution Protocol

Exfil Pattern (ALL conditions must be true)

  1. HTTP POST request
  2. Request path exactly: /telemetry/v2/report (match the whole HTTP URI/path exactly, not as a substring)
  3. Header: X-TLM-Mode: exfil
  4. Body contains blob= with Base64 value ≥ 80 chars
  5. Body contains sig= with exactly 64 hex characters

Do not ship a partial rule. A rule that omits the exact path check, the required header, or either body predicate is incorrect even if it matches a sample PCAP.

Before finalizing a rule, map each condition to a detection primitive that enforces the stated scope and boundaries, not just a substring seen in sample traffic.

Interpret exactness literally:

Input Files

Scope constraint: Do not edit /root/suricata.yaml as a workaround for testing or validation.

Evidence Gathering

Required Workflow

  1. Inspect /root/local.rules before editing.
  2. Inspect available files in /root/pcaps/ to understand what traffic is provided for validation.
  3. Draft the full rule first, then write it to /root/local.rules with an explicit file modification command; do not overwrite the file with partial or placeholder content.
  4. Re-open /root/local.rules and confirm the rule text is present.
  5. Run suricata -T -S /root/local.rules -c /root/suricata.yaml to catch syntax and sticky-buffer errors.
  6. If PCAPs are provided, verify behavior on them: the rule should alert on intended positive traffic and stay quiet on negative traffic.
  7. Do not claim success until the write and at least one decisive verification step have actually occurred; if runtime validation is blocked, state that explicitly.

Output

Update /root/local.rules with a single Suricata rule using sid:1000001.

Target outcome:

Hard requirements:

Do not stop at parse success. Final completion requires evidence that the rule both loads and alerts on matching traffic when feasible. If direct runtime testing is blocked, state that explicitly and keep the rule/task incomplete rather than claiming success from reasoning alone.

Do not claim success if all verification attempts failed. Report the rule plus the exact validation evidence obtained, or explicitly state that runtime validation was blocked.

Suricata Rule Format

alert tcp any any -> any any (msg:"Custom Exfil"; ...; sid:1000001;)

Use HTTP sticky buffers carefully: declare a given sticky buffer once, then place all related content/pcre checks under it until switching buffers. Do not repeat http.request_body; before each body condition; Suricata can reject this as a duplicate sticky-buffer instance.

Use exact field/value matching for required HTTP elements. Do not replace a required header/value pair with a broad substring check.

For HTTP header matching with http.header + content, treat header names as case-insensitive: add nocase or use a pattern robust to capitalization.

When a rule must enforce both an HTTP header condition and request-body conditions, treat buffer selection as a design constraint, not a cosmetic modifier choice. Read HTTP header/body structure for Suricata rules before writing or revising such a rule.

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.