Skip to content

Rules from traffic ​

The hub's Rules screen is the rule builder. It turns what you found in the traffic into a vulnboxd rule, shows what that rule would have matched over the last 20 ticks, and pushes it to the vulnbox. You never have to write YAML by hand, but you always see it.

Starting a rule ​

  • Make rule on a flow or an attack drafts conditions from that request: its path, the headers it has and lacks, its fingerprint, the payload.
  • Make rule from differences in a compare drafts conditions that separate the attacker's request from the checker's.
  • Make rule on the Headers screen's strongest separator drafts a condition from the header that best tells two groups apart.
  • + New rule on the Vulnbox screen starts an empty one for a service.
  • On a gRPC call, the builder drafts the method and the fields by number, answering with a proper gRPC error (gRPC).

Editing it ​

The builder lists the conditions, each one a match condition of the rules file, and lets you switch, edit or remove them and pick the action: block with its status and body, stall, replace, log. Conditions that can also match the decoded form of a message have a match decoded too switch with a choice of layers, and anomalies conditions their own editor. The rule appears as YAML in the rules file's own format as you go.

Preview ​

The rule builder: conditions drafted from a flow, the Block action, a preview with a warning that the rule would hit the checker, and the rule as YAML.The rule builder: conditions drafted from a flow, the Block action, a preview with a warning that the rule would hit the checker, and the rule as YAML.
A rule drafted from a flow. The preview warns that it would also match the checker.

Before anything is pushed, the builder previews the rule over the last 20 ticks of captured traffic:

  1. An estimate at once, from the hub's database.
  2. The exact count, from vulnboxd's own rule engine run over the captured requests.

Both are split into requests that look like the checker (the checker hint: their flow stored a flag, or its fingerprint is labelled checker) and other traffic, with the flag-outs the rule would have stopped. A rule that would hit flows that look like the checker gets a loud warning with a link to those flows: blocking the checker costs you SLA points every tick. It is a hint, not proof, so it never stops you pushing, and the builder suggests no exemptions built from those flows' headers (anyone can make a flow look like the checker). Drafted from a flow, the builder lists the headers every flag-in request sends and this one lacks as unticked "has no …" conditions, for you to judge.

Robustness ​

A rule that matches the attack you saw may not match the same attack written a little differently. Check robustness under the preview takes the captured requests the rule fires on (the newest 10 of the preview's window) and runs each again through vulnboxd's own rule engine, the code the proxy runs, rewritten in every way an attacker gets for free:

variantthe request rewritten as
gzip, deflate, br, zstdthe body compressed, with Content-Encoding saying so
non-ASCII byte in the matched texta 0xff byte in the middle of what the rule's contains, regex or body pattern found; a service that skips stray bytes (PHP, SQL comments, some parsers) still reads the payload
non-ASCII byte after it0xff right after the matched text, where a pattern ending in \b or $ looks
600 dummy parameters first600 form parameters, JSON keys or query parameters in front of the payload, past where decoding stops
body in many small readsthe body arriving a byte at a time
gRPC content typeContent-Type: application/grpc on a plain request
JSON \uXXXX escapesevery character of the JSON body's strings written as an escape
percent-encodingthe matched text as %XX in a form body or the query string
base64 with junkthe value holding the matched text as base64 with !, . and ~ mixed in, which PHP's, Python's and Node's decoders still read
WebSocket split framesnever applies here: captured requests carry no WebSocket messages, and the proxy joins a message's frames before its rules see it

Each variant gets a row: still caught, gets past the rule (with links to the captured requests it got past on), does not apply (and why: no body, not JSON, the pattern finds no text to change) or not tried when the check ran out of time. Above them, "This rule is bypassed by: …" sums it up. A rule bypassed by percent-encoding, JSON escapes or base64 usually wants decoded: true; one bypassed by a stray byte wants a regex that allows it (cat[^a-z]*/[^a-z]*flag); padding past decoding is what on_undecidable: block (the default) is for, and unless the port sets log the row counts those requests as refused. A rule that only fingerprints the exploit (its Content-Length, a header's exact value) is bypassed by nearly everything.

The check is on demand and takes up to 10 seconds; it says when you have edited the rule since. It reads only captured traffic and changes nothing. The API is POST /api/rules/robustness (see the hub's API.md), which also takes chosen flows instead of the window.

Pushing it ​

Push to vulnbox sends the rule as a rule push: the agent checks it, vulnboxd loads it within a second, and it is committed to the service's git repository under your name. Tick log only first to push it in shadow mode: it only counts what it would have blocked, and Promote on the Vulnbox screen makes it real once it only catches what it should.

The builder shows each step of the push as it happens. Edit whole file opens the rules file as text for what the builder does not cover.