Skip to content

Commit

Permalink
randomize the sequence number for SYN packets
Browse files Browse the repository at this point in the history
  • Loading branch information
xhdix committed Feb 6, 2022
1 parent 21f3611 commit 17b143e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def send_single_packet(this_request, timeout):
this_request[IP].id = RandShort()
if this_request.haslayer(TCP):
this_request[TCP].sport = ephemeral_port_reserve("tcp")
if this_request[TCP].flags == "S":
this_request[TCP].seq = RandInt()
del(this_request[TCP].chksum)
elif this_request.haslayer(UDP):
this_request[UDP].sport = ephemeral_port_reserve("udp")
Expand Down

0 comments on commit 17b143e

Please sign in to comment.