| The algorithm found seems so unintuitive that I wonder if it was not found by the AI. "Allow a connection to continue if the first TCP payload (pkt)
sent by the client satisfies any of the following exemptions: Ex1:
popcount(pkt)
len(pkt) ≤ 3.4 or popcount(pkt)
len(pkt) ≥ 4.6. Ex2: The first six (or more) bytes of pkt are [0x20,0x7e]. Ex3: More than 50% of pkt’s bytes are [0x20,0x7e]. Ex4: More than 20 contiguous bytes of pkt are [0x20,0x7e]. Ex5: It matches the protocol fingerprint for TLS or HTTP. Block if none of the above hold." |
First rule exploits the IND-CPA property of most encryption. You want to kill traffic that has about 4 bits set to 1 per byte, i.e. traffic that "looks random".
The following rules are exemptions for permissible encrypted or compressed traffic (note that compression, while not IND-CPA, results in high entropy and thus will trigger the first rule).
This could work very well, which is confirmed by the researchers in this paper.