From 5a17d2a0a3aa6d7a672bd7cb4bf1362f2ede81e9 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 17 Sep 2016 16:10:42 +0200 Subject: make-tcp.py: use HTTP (which activates reassembly) --- crafted-pkt/make-tcp.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/crafted-pkt/make-tcp.py b/crafted-pkt/make-tcp.py index 8f6bb00..508bbb3 100755 --- a/crafted-pkt/make-tcp.py +++ b/crafted-pkt/make-tcp.py @@ -12,20 +12,19 @@ def send(data, flags='A'): seqno = last.seq + len(last.payload) else: seqno = 100 - tcp = TCP(sport=32323, dport=9, flags=flags, seq=seqno)/data + tcp = TCP(sport=32323, dport=80, flags=flags, seq=seqno)/data pkt = IP(dst='10.0.0.2',src='10.0.0.1') / tcp pkts.append(pkt) return pkt # data for one side lines = [ - 'First\n', - 'Second\n', - 'Third\n', - 'Fourth\n', - 'Fifth\n', - 'Sixth\n', - 'Last\n' + 'PUT / HTTP/1.1\r\n', # 1 + 'Content-Length: 6\r\n', # 2 + '\r\n', # 3 + '1\n', # 4 + '2\n', # 5 + '3\n', # 6 ] for line in lines: send(line) @@ -34,13 +33,12 @@ send('', flags='F') # FIN # Errorneous packets numbers = [ 1, - 1, # duplicate packet + 1, # Duplicate 2, - 4, # out-of-order (2) - 3, # out-of-order (1) - 5, - #6, # missing packet - 7, + 3, + 5, # out-of-order + 4, # out-of-order + 6, 0, # FIN (last packet) ] -- cgit v1.2.1