Added initial code.
This commit is contained in:
parent
5808d2f805
commit
1f7a9b0566
22 changed files with 309132 additions and 1 deletions
11
thm/aoc23/day02/1_packets_captured.py
Executable file
11
thm/aoc23/day02/1_packets_captured.py
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env python3
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
df = pd.read_csv('network_traffic.csv')
|
||||
df.head(5)
|
||||
|
||||
# We need to use Pandas count function on the dataframe
|
||||
# For example: dataframe.count()
|
||||
|
||||
print(df.count())
|
10
thm/aoc23/day02/2_ip_address.py
Executable file
10
thm/aoc23/day02/2_ip_address.py
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env python3
|
||||
import pandas as pd
|
||||
|
||||
df = pd.read_csv('network_traffic.csv')
|
||||
df.head(5)
|
||||
|
||||
# We need to perform a groupby with Pandas size function the "Source" and "Destination" columns.
|
||||
# For example: dataframe.groupby(['ColumnName']).size()
|
||||
|
||||
print(df.groupby(['Source']).size().sort_values(ascending=False))
|
8
thm/aoc23/day02/3_protocol.py
Executable file
8
thm/aoc23/day02/3_protocol.py
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env python3
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
df = pd.read_csv('network_traffic.csv')
|
||||
df.head(5)
|
||||
|
||||
print(df['Protocol'].value_counts())
|
101
thm/aoc23/day02/network_traffic.csv
Normal file
101
thm/aoc23/day02/network_traffic.csv
Normal file
|
@ -0,0 +1,101 @@
|
|||
PacketNumber,Timestamp,Source,Destination,Protocol
|
||||
1,05:49.5,10.10.1.7,10.10.1.9,HTTP
|
||||
2,05:50.3,10.10.1.10,10.10.1.3,TCP
|
||||
3,06:10.3,10.10.1.1,10.10.1.2,HTTP
|
||||
4,06:10.4,10.10.1.9,10.10.1.3,ICMP
|
||||
5,06:10.4,10.10.1.1,10.10.1.7,ICMP
|
||||
6,06:10.4,10.10.1.10,10.10.1.8,DNS
|
||||
7,06:10.4,10.10.1.6,10.10.1.7,ICMP
|
||||
8,06:10.4,10.10.1.2,10.10.1.10,HTTP
|
||||
9,06:10.4,10.10.1.9,10.10.1.3,DNS
|
||||
10,06:10.4,10.10.1.7,10.10.1.7,TCP
|
||||
11,06:10.4,10.10.1.8,10.10.1.5,HTTP
|
||||
12,06:10.4,10.10.1.3,10.10.1.4,DNS
|
||||
13,06:10.4,10.10.1.2,10.10.1.5,ICMP
|
||||
14,06:10.4,10.10.1.3,10.10.1.2,DNS
|
||||
15,06:10.4,10.10.1.6,10.10.1.6,ICMP
|
||||
16,06:10.4,10.10.1.4,10.10.1.8,DNS
|
||||
17,06:10.4,10.10.1.9,10.10.1.3,ICMP
|
||||
18,06:10.4,10.10.1.8,10.10.1.9,HTTP
|
||||
19,06:10.5,10.10.1.5,10.10.1.7,HTTP
|
||||
20,06:10.5,10.10.1.9,10.10.1.1,DNS
|
||||
21,06:10.5,10.10.1.8,10.10.1.5,ICMP
|
||||
22,06:10.5,10.10.1.3,10.10.1.2,HTTP
|
||||
23,06:10.5,10.10.1.3,10.10.1.6,ICMP
|
||||
24,06:10.5,10.10.1.8,10.10.1.8,HTTP
|
||||
25,06:10.5,10.10.1.3,10.10.1.4,DNS
|
||||
26,06:10.5,10.10.1.4,10.10.1.10,ICMP
|
||||
27,06:10.6,10.10.1.2,10.10.1.7,ICMP
|
||||
28,06:10.6,10.10.1.3,10.10.1.5,TCP
|
||||
29,06:10.6,10.10.1.10,10.10.1.7,DNS
|
||||
30,06:10.6,10.10.1.9,10.10.1.3,DNS
|
||||
31,06:10.6,10.10.1.4,10.10.1.2,ICMP
|
||||
32,06:10.6,10.10.1.4,10.10.1.5,TCP
|
||||
33,06:10.6,10.10.1.10,10.10.1.3,TCP
|
||||
34,06:10.6,10.10.1.5,10.10.1.1,ICMP
|
||||
35,06:10.6,10.10.1.6,10.10.1.4,TCP
|
||||
36,06:10.6,10.10.1.6,10.10.1.8,ICMP
|
||||
37,06:10.6,10.10.1.6,10.10.1.2,DNS
|
||||
38,06:10.6,10.10.1.6,10.10.1.4,ICMP
|
||||
39,06:10.6,10.10.1.1,10.10.1.9,TCP
|
||||
40,06:10.6,10.10.1.6,10.10.1.10,DNS
|
||||
41,06:10.6,10.10.1.8,10.10.1.7,HTTP
|
||||
42,06:10.6,10.10.1.2,10.10.1.6,TCP
|
||||
43,06:10.6,10.10.1.8,10.10.1.2,TCP
|
||||
44,06:10.6,10.10.1.4,10.10.1.1,TCP
|
||||
45,06:10.6,10.10.1.1,10.10.1.8,ICMP
|
||||
46,06:10.6,10.10.1.8,10.10.1.2,HTTP
|
||||
47,06:10.6,10.10.1.9,10.10.1.9,ICMP
|
||||
48,06:10.6,10.10.1.1,10.10.1.5,TCP
|
||||
49,06:10.6,10.10.1.5,10.10.1.10,DNS
|
||||
50,06:10.6,10.10.1.6,10.10.1.2,DNS
|
||||
51,05:49.5,10.10.1.10,10.10.1.4,TCP
|
||||
52,05:50.3,10.10.1.6,10.10.1.7,ICMP
|
||||
53,06:10.3,10.10.1.3,10.10.1.7,HTTP
|
||||
54,06:10.4,10.10.1.2,10.10.1.9,HTTP
|
||||
55,06:10.4,10.10.1.7,10.10.1.5,DNS
|
||||
56,06:10.4,10.10.1.4,10.10.1.4,HTTP
|
||||
57,06:10.4,10.10.1.9,10.10.1.10,ICMP
|
||||
58,06:10.4,10.10.1.9,10.10.1.9,TCP
|
||||
59,06:10.4,10.10.1.8,10.10.1.2,ICMP
|
||||
60,06:10.4,10.10.1.2,10.10.1.9,DNS
|
||||
61,06:10.4,10.10.1.6,10.10.1.3,ICMP
|
||||
62,06:10.4,10.10.1.4,10.10.1.6,DNS
|
||||
63,06:10.4,10.10.1.4,10.10.1.4,TCP
|
||||
64,06:10.4,10.10.1.3,10.10.1.4,HTTP
|
||||
65,06:10.4,10.10.1.4,10.10.1.6,HTTP
|
||||
66,06:10.4,10.10.1.9,10.10.1.3,HTTP
|
||||
67,06:10.4,10.10.1.6,10.10.1.8,TCP
|
||||
68,06:10.4,10.10.1.10,10.10.1.6,TCP
|
||||
69,06:10.5,10.10.1.2,10.10.1.7,HTTP
|
||||
70,06:10.5,10.10.1.6,10.10.1.1,HTTP
|
||||
71,06:10.5,10.10.1.1,10.10.1.9,DNS
|
||||
72,06:10.5,10.10.1.9,10.10.1.5,ICMP
|
||||
73,06:10.5,10.10.1.10,10.10.1.5,DNS
|
||||
74,06:10.5,10.10.1.6,10.10.1.10,DNS
|
||||
75,06:10.5,10.10.1.2,10.10.1.8,HTTP
|
||||
76,06:10.5,10.10.1.2,10.10.1.3,TCP
|
||||
77,06:10.6,10.10.1.7,10.10.1.3,ICMP
|
||||
78,06:10.6,10.10.1.3,10.10.1.7,DNS
|
||||
79,06:10.6,10.10.1.3,10.10.1.7,TCP
|
||||
80,06:10.6,10.10.1.7,10.10.1.8,HTTP
|
||||
81,06:10.6,10.10.1.1,10.10.1.6,TCP
|
||||
82,06:10.6,10.10.1.3,10.10.1.2,HTTP
|
||||
83,06:10.6,10.10.1.5,10.10.1.3,DNS
|
||||
84,06:10.6,10.10.1.3,10.10.1.2,TCP
|
||||
85,06:10.6,10.10.1.4,10.10.1.8,ICMP
|
||||
86,06:10.6,10.10.1.4,10.10.1.2,DNS
|
||||
87,06:10.6,10.10.1.4,10.10.1.2,DNS
|
||||
88,06:10.6,10.10.1.4,10.10.1.1,HTTP
|
||||
89,06:10.6,10.10.1.2,10.10.1.3,TCP
|
||||
90,06:10.6,10.10.1.2,10.10.1.5,HTTP
|
||||
91,06:10.6,10.10.1.2,10.10.1.3,ICMP
|
||||
92,06:10.6,10.10.1.10,10.10.1.2,ICMP
|
||||
93,06:10.6,10.10.1.9,10.10.1.4,HTTP
|
||||
94,06:10.6,10.10.1.6,10.10.1.9,TCP
|
||||
95,06:10.6,10.10.1.4,10.10.1.4,TCP
|
||||
96,06:10.6,10.10.1.8,10.10.1.3,DNS
|
||||
97,06:10.6,10.10.1.1,10.10.1.3,ICMP
|
||||
98,06:10.6,10.10.1.3,10.10.1.3,DNS
|
||||
99,06:10.6,10.10.1.4,10.10.1.3,TCP
|
||||
100,06:10.6,10.10.1.5,10.10.1.2,ICMP
|
|
Loading…
Add table
Add a link
Reference in a new issue