Skip to main content
Challenges nftables: manual rule simulation
Digital forensics Expert nftables semantics: hook/priority, jump/goto/return, set, meta mark, family Solves: 4

nftables: manual rule simulation

Author: CyberSamSU
Points
150

The border gateway (fw-edge-01) rules were added over the years by several teams: four tables, chains across multiple hooks, and sets. The auditor obtained the nft list ruleset output (nft-audit/ruleset.nft) and nft-audit/packets.csv from the network log. It is necessary to compute accurately whether each packet passes or is dropped by the rules. Each packet in the log has a transmitted "data" fragment attached; concatenating the fragments of passed packets in no order yields a base64 string.

CSV columns: no — sequence number; path — in (to this host itself: prerouting → input) or fwd (transit: prerouting → forward); family — ip/ip6; iif, oif (- = none); proto (tcp udp icmp icmpv6); saddr sport daddr dport (port - for ICMP); ct — conntrack state (provided); data — fragment. The packet's meta mark value is initially 0.

Semantics (according to actual nftables/netfilter):

  • Chain order. For each hook the packet traverses, base chains across all tables attached to that hook and matching the packet family (inet — IPv4 and IPv6; ip — IPv4 only) are evaluated sequentially in ascending priority order. Named priorities: raw=-300, mangle=-150, filter=0; filter + 20 = 20, filter - 10 = -10.
  • Within a chain, rules are evaluated top to bottom; a rule triggers only if all its conditions are met. Unconditional effects: meta mark set X sets the packet mark to X (subsequent rules and subsequent chains/hooks see the new value); counter and log change nothing.
  • Verdict. drop and reject — the packet is dropped, and everything ends there. accept — terminates only this base chain; the packet still proceeds to subsequent base chains (higher priority or next hook) and may be dropped there. A packet that passes through all chains without being dropped is considered "passed".
  • End of chain. If a base chain ends without a verdict, its policy applies (accept = this chain ends, processing continues; drop = dropped). If a regular chain ends or return is executed, execution returns to the rule after the last jump.
  • jump C saves the return address. goto C does not: if C ends / return occurs, execution returns to the last saved jump address; if there is no such address, the base chain's policy is applied (the remaining rules of the chain that performed the goto are not executed). return in a base chain also leads to the policy.
  • Conditions. iifname/oifname; meta l4proto; ip saddr/daddr matches only IPv4 packets, ip6 ... only IPv6 packets; tcp|udp dport|sport matches only packets with that protocol (also with !=); ct state; meta mark. != — negation. Value: single, { ro'yxat }, range (a-b), CIDR, or @set (interval sets may contain CIDRs/ranges). ip daddr . tcp dport @s — whether the (address, port) pair is in the set.

Concatenate the data columns of the passed packets and decode the base64. An incorrect simulation (for example, assuming accept terminates everything) will also include random fragments of dropped packets, and the result will make no sense. Flag format: BAYROQ{...} (the last 16 characters are lowercase hexadecimal digits).

Attached files
nft-audit.tar Log in to download
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −15 pts Log in
Hint 2 −30 pts Log in
Hint 3 −45 pts Log in
To submit a flag, log in.

First solvers

1. Odam 25.11.2026
2. Asmaa Mottery 25.11.2026
3. Mirjaxon Qaxxarov 25.11.2026
4. FASTEST 27.11.2026