Direct answer
Testing an intrusion detection system's (IDS) resilience to evasion means deliberately sending it traffic crafted to exploit gaps between how the sensor reassembles and parses packets and how the real destination host does, then checking whether the sensor still alerts. This needs a controlled lab, not production, because some of these techniques are designed to break normal parsing.
Test generation tools
- Scapy: a Python packet-crafting library used to build packets with deliberately unusual properties, such as overlapping IP fragments with conflicting data, unusual TCP option combinations, or out-of-order segments.
- fragroute: a tool purpose-built to fragment and reorder traffic in transit according to a rule file, replaying known evasion patterns against a target without hand-crafting each packet.
- tcpreplay: replays a previously captured pcap, a packet capture file, at a controlled speed. This is useful for testing timing-based evasion, sending an attack slowly enough to fall below a rate-based detection threshold, and for regression-testing that a sensor still catches a known-bad capture after a configuration change.
Lab topology
Build an isolated segment: an attacker host running the generation tools, a mirror or tap feeding the sensor under test, and a victim host running the same operating system and application stack as production, so you can confirm whether the victim actually accepts the evasive packet the same way the sensor does or does not. Isolation matters because some fragmentation or malformed-packet tests can crash a fragile network stack, and you do not want that on a production network.
Expected sensor failure modes
- Fragmentation ambiguity: if the sensor reassembles overlapping IP fragments differently than the victim host's operating system does, for example favoring the first fragment received versus the last, an attacker can hide the malicious portion of a payload in a fragment the sensor discards but the victim keeps.
- TCP options or segmentation ambiguity: similarly, if the sensor's stream reassembly disagrees with the victim's, a segmented payload can be reassembled differently on each side, hiding a signature match from the sensor while the victim still executes the full payload.
- Timing evasion: sending an attack slowly enough, well below a threshold-based or time-windowed detection rule, can avoid tripping a rate-based signature entirely.
Remediation
- Sensor configuration: enable target-based reassembly if the engine supports it, meaning you tell the sensor which operating system each protected host runs so it reassembles fragments and segments the same way that host would, and keep fragment and stream reassembly timeouts and limits current with vendor guidance.
- Host hardening: disable accepting unusual fragment or option combinations at the host's own network stack where the operating system supports it, and keep host network stack patches current, since these evasion classes exploit implementation differences that get fixed over time.
Making it reproducible and continuous
Turn the test set into version-controlled scripts, the Scapy, fragroute, and tcpreplay drivers plus expected alert outcomes, and run them in a continuous integration and continuous delivery (CI/CD) pipeline whenever sensor rules or software are updated, rather than as a one-off exercise, so a regression, a previously-caught evasion technique that starts slipping through again after an upgrade, is caught automatically. Pair this with periodic red team and blue team exercises, where one side crafts new evasion attempts and the other tunes detections against them, to keep testing ahead of technique drift rather than only re-running a fixed, aging test suite.
A related but distinct exercise: writing a new signature under evasion pressure
Separately from re-testing existing signatures, you will sometimes need to write a brand-new IPS signature for a freshly disclosed exploit. The same evasion-mindedness applies at write time: match on the most invariant part of the exploit, the part an attacker cannot trivially change without breaking the exploit itself, rather than an easily randomized string, and validate the new signature against your evasion test harness above before enabling it in blocking mode, so you are not shipping a rule that a single character of obfuscation defeats.
Trade-offs and pitfalls
An evasion test suite that never gets re-run after the first pass gives false confidence, since sensor software and rule sets change. Fully replicating production's operating system and stack diversity in the lab is expensive; a common and reasonable shortcut is testing against the two or three most common host stacks in the environment rather than every variant, which is a stated trade-off, not full coverage.