diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-09-17 16:10:42 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2016-09-17 16:10:42 +0200 |
commit | 5a17d2a0a3aa6d7a672bd7cb4bf1362f2ede81e9 (patch) | |
tree | 3a44b1c1c93b12d9b4eefd8c92858732da04a956 | |
parent | c77414b056e7c9bcc91c9256b463c75e4992e076 (diff) | |
download | wireshark-notes-5a17d2a0a3aa6d7a672bd7cb4bf1362f2ede81e9.tar.gz |
make-tcp.py: use HTTP (which activates reassembly)
-rwxr-xr-x | crafted-pkt/make-tcp.py | 26 |
1 files 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) ] |