Tempesta Technologies
  • Home
  • Tempesta FW
    • Features
      • Web acceleration
      • Load balancing
      • Application performance monitoring
    • Performance
    • How it works
    • Deployment
    • Support
    • Knowledge base
  • Services
    • Software development
      • High performance
      • Networking
      • Databases
      • Linux kernel
      • Machine learning
      • How we work
      • Case studies
    • Performance analysis
    • Network security
      • DDoS protection
      • Application security
      • Cryptography
      • Security assessment
      • How we work
      • Case Studies
  • Solutions
    • DDoS Protection
    • Web Acceleration
  • Blog
  • Company
    • Research
    • Careers
    • Contact
Tempesta Technologies

TCP Anomaly Filter

The filter blocks anomalous TCP segments โ€” suspicious or invalid packets โ€” according to RFC rules and additional heuristics.

Default Behavior๐Ÿ”—

By default, the filter is disabled.

You can enable basic traffic filtering by simply defining the filter:

xfw {
   tcp_anomaly_filter;
}

The following packets are always blocked by the filter:

  • RFC-prohibited TCP flag combinations: SYN+FIN, SYN+RST, FIN+RST.
  • TCP packets with zero source or destination port.

SYN without Options๐Ÿ”—

Checks whether a SYN packet contains TCP options and drops it if none are present:

xfw {
   tcp_anomaly_filter syn_without_opt;
}

SYN with Payload๐Ÿ”—

Checks whether a SYN packet contains payload data and drops it if it does:

xfw {
   tcp_anomaly_filter syn_with_payload;
}

SYN with Specific Sequence Number๐Ÿ”—

You can specify a sequence number for SYN packets that should be dropped. It is recommended to drop packets with a zero sequence number. You can also specify any other valid sequence number in the range [0, 4294967295]:

xfw {
   tcp_anomaly_filter syn_with_seqno=0;
}

Bad Flags Filtration๐Ÿ”—

Enabling this option allows blocking an extended list of suspicious TCP flag combinations:

xfw {
   tcp_anomaly_filter bad_flags;
}

or

xfw {
   tcp_anomaly_filter bad_flags();
}

The following packets are blocked:

  • FIN only (FIN scan);
  • 0 / no flags set (NULL scan);
  • FIN+PSH+URG (XMAS scan) โ€” all supersets are also considered suspicious;
  • SYN+PSH โ€” all supersets are also considered suspicious;
  • SYN+URG โ€” all supersets are also considered suspicious;
  • RST+PSH โ€” all supersets are also considered suspicious;
  • RST+URG โ€” all supersets are also considered suspicious.

You can also define your own set of bad flags. In this case, the default set is skipped:

xfw {
   tcp_anomaly_filter bad_flags(0, SYN+PSH);
}

Available flag values:

Value Description
0 TCP segment with no flags set
SYN, ACK, FIN, RST, PSH, URG, ECE, CWR Individual TCP flags

Flags can be combined using +. Multiple combinations are separated by commas.

xfw {
   tcp_anomaly_filter bad_flags(0, SYN+PSH, SYN+FIN, SYN+FIN+RST);
}

Turning Off the Filter๐Ÿ”—

You can disable the filter with the following command:

xfw {
    tcp_anomaly_filter/del;
}

Combining Different Options๐Ÿ”—

You can enable multiple checks at once, including custom bad flag rules:

xfw {
   tcp_anomaly_filter syn_without_opt syn_with_payload syn_with_seqno=0 bad_flags(0,SYN+PSH);
}

Statistics๐Ÿ”—

Some anomalies may not appear in the statistics because a packet is accounted for only by the first matching rule. For example, a packet with both invalid TCP flags and a zero port will be filtered and counted only under the zero-port rule.

  • Home
  • XFW
    • Basic Administration
    • Quick start
    • DNS DDoS protection
    • Observability
    • Performance
  • XFW Filtration Rules
    • Chaining
    • Evaluation Mode
    • IP Filter
    • ICMP Filter
    • DNS Filter
    • UDP Anomaly Filter
    • TCP Anomaly Filter
    • TCP Authentication Filter
    • TCP SYN Cookies
    • TCP Flags Filter
    • Destination Filter
    • Source Filter
    • Protected Network Definition
    • Rate Limits
    • Default Rules
  • Manager
    • Management daemon
    • Client library
    • Command line interface
  • DDoS Protection Use Cases
    • DNS server
    • Web server
    • Advanced Protection
  • Troubleshooting
    • Troubleshooting System Description
    • Troubleshooting System Verification Script
    • Troubleshooting Netconsole Configuration
    • Troubleshooting Server
    • Troubleshooting Support Server

Powered by Tempesta FW

Stay up to date with our latest developments

Useful Links

Home
Blog

Tempestaยฎ FW

Features
Performance
Deployment
Support
Knowledge Base

Services

Software Development
Performance analysis
Network Security

Solutions

DDoS Protection

Web Acceleration

Company

Research
Careers
Contact