]> git.somenet.org - pub/jan/netsec2.git/blob - report/exercise2.tex
It compiles! SHIP IT!
[pub/jan/netsec2.git] / report / exercise2.tex
1
2 \section{Exercise 2}
3 \subsection{Rep:2.a}
4
5 pcap-ng format to pcap for scapy
6 editcap -F libpcap team15\_ex21.pcap ex21.pcap
7
8 filter out large flows (>=400 packets)
9
10 ./readflows.py
11 % (src, dst) : (srctodst, dsttosrc)
12 %{('113.15.85.25', '179.160.238.111'): (463, 0),
13 % ('114.176.157.191', '221.72.61.209'): (541, 0),
14 % ('134.134.122.170', '179.187.246.122'): (419, 0),
15 % ('179.187.53.117', '129.49.173.82'): (472, 0),
16 % ('211.2.138.61', '144.66.241.253'): (462, 151),
17 % ('221.100.234.92', '161.194.49.146'): (547, 0),
18 % ('8.73.98.88', '144.66.191.77'): (535, 0)}
19
20 split into separate files
21
22 (ip.addr == 113.15.85.25 and ip.addr == 179.160.238.111) % large_flow_1.pcap
23 (ip.addr == 114.176.157.191 and ip.addr == 221.72.61.209) % large_flow_2.pcap
24 (ip.addr == 134.134.122.170 and ip.addr == 179.187.246.122) % large_flow_3.pcap
25 (ip.addr == 179.187.53.117 and ip.addr == 129.49.173.82) % large_flow_4.pcap
26 (ip.addr == 211.2.138.61 and ip.addr == 144.66.241.253) % large_flow_5.pcap
27 (ip.addr == 221.100.234.92 and ip.addr == 161.194.49.146) % large_flow_6.pcap
28 (ip.addr == 8.73.98.88 and ip.addr == 144.66.191.77) % large_flow_7.pcap
29
30 generate csv from wireshark for full pcap
31
32 generate graphs:
33 large\_flow\_2.png
34
35 cat large\_flow\_2.dehexed.csv | awk -F, '{print \$8}' | sed 's/5950/0/' | sed 's/5960/1/' | sed 's/"//g' > bits
36 ./bitstobytes.py
37
38 \subsection{Rep:2.b}
39 Data acquired. Key for message (len=42 \& pkts>200): nSa123 (Scott)
40
41 \subsection{Rep:2.c}
42
43 pcap-ng format to pcap for scapy
44 editcap -F libpcap team15\_ex22.pcap ex22.pcap
45
46 filter out large flows (>200 packets and frame.len == 42)
47
48 ./task2/readflows.py
49 % {('53.151.211.106', '217.115.203.44'): (213, 0)}
50
51 filter into file
52 ip.addr == 53.151.211.106 and ip.addr == 217.115.203.44 and eth.len == 42
53
54 generate graph:
55 large\_flow.png
56
57 save bytes (ipid) from stream to file
58 ./decode\_ipid.py
59
60 try decoding with password from previous task
61 openssl enc -d -rc4 -nosalt -k nSa123 -in stream\_encrypted -out stream\_decrypted
62
63 -> didn't work
64
65 tried reversing the bytes (lower byte first, upper byte next)
66
67 -> didn't work
68
69 trying to decode the second-largest flow:
70 ip.addr == 96.55.191.225 and ip.addr == 217.115.203.44 and eth.len == 42
71
72 -> didn't work
73
74 found out, that scapy removes the frame length from the packet, rewrote the script...
75
76 filter into files
77
78 ./readflows.py
79
80 manually create csv files
81
82 for i in large\_flow\_*.csv ; do ./../../only\_decimal.sh \$i > \${i\%.csv}.dehexed.csv ; done
83
84 ./autocorrelate.sh | grep -v "All values are identical" | sort -k2
85
86 -> ./parse\_stream\_data.py
87
88 \subsection{Rep:2.c}
89 Agent South was captured! Aborting operation. (Agent Scott)