solveed all week02

This commit is contained in:
2024-11-10 19:46:45 +09:00
parent be44ad3718
commit 857c731089
2 changed files with 5 additions and 5 deletions

View File

@ -73,7 +73,7 @@ def handle_packet(packet: Packet):
send(initial_syn)
else:
if (0x02 in packet[TCP].flags) or (not seq == expected_cookie) or (not ack == INITIAL_SEQ):
if ("S" in packet[TCP].flags) or (not seq == expected_cookie) or (not ack == INITIAL_SEQ):
print(f'Invalid cookie {seq}, expected {expected_cookie}')
rst = get_rst(src_ip, src_port, seq)
send(rst)