Geneva uses a specific string syntax called Strategy DNA to express complex evasion strategies.
Structure
- Forest Separation: A strategy is divided into outbound and inbound forests using the
\/ separator: <outbound forest> \/ <inbound forest>. If \/ is absent, all trees belong to the outbound forest. - Action Trees: Each tree starts with a trigger and ends with the terminator
-|.
Triggers
Triggers follow the format [<protocol>:<field>:<value>] or [<protocol>:<field>:<value>:<gas>].
- Example:
[TCP:flags:S] triggers on TCP packets with the SYN flag set. - Gas: An optional 4th parameter specifying how many times a trigger can fire.
[IP:version:4:4]: Fires only on the first 4 matching IPv4 packets.- Bomb Trigger: If gas is negative, the trigger only fires after seeing the specified number of matching packets. e.g.,
[IP:version:4:-2] triggers only after 2 matching packets have been observed (it does not trigger on the first two).
Actions and Nesting
Actions can have up to two children (for branching actions like duplicate) or one child (for tamper).
- Parameters: Specified within curly braces
{}. e.g., tamper{TCP:flags:replace:A}. - Branching Syntax:
[trigger]-action(left_child,right_child)-|. - Single Child Syntax:
[trigger]-action{params}(child,)-|. - Leaf/No Branching: If
(,) is not specified, packets emerging from the action are sent directly to the wire.
Example
To trigger on TCP packets with the ACK flag, duplicate them, replace the flags with R, and then corrupt the checksum:
[TCP:flags:A]-duplicate(tamper{TCP:flags:replace:R}(tamper{TCP:chksum:corrupt},),)-|
[TCP:flags:A]-duplicate(tamper{TCP:flags:replace:R}(tamper{TCP:chksum:corrupt},),)-| \/