-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel11.py
More file actions
59 lines (53 loc) ยท 2.15 KB
/
level11.py
File metadata and controls
59 lines (53 loc) ยท 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import os
import time
def clear():
os.system('cls' if os.name == 'nt' else 'clear')
def next_step_menu():
print("\n๐ฎ What would you like to do next?")
print("1. Continue to next level")
print("2. Restart this level")
print("3. Exit game")
choice = input("> ").strip()
return choice
def level11(save):
clear()
print("๐ก Level 11: C2 Traffic Detection\n")
print("You've captured suspicious outbound traffic from an infected machine.\n")
print("Here's a snippet of the PCAP log:\n")
print("""\
Time Destination IP Protocol Info
---------------------------------------------------------
10:21:34 93.184.216.34 HTTPS GET /updates
10:21:35 192.168.1.1 ARP Who has 192.168.1.10?
10:21:36 45.33.32.156 TCP SYN to port 1337
10:21:38 104.21.34.88 HTTPS GET /api
10:21:40 45.33.32.156 TCP PSH, ACK /exec?id=rat""")
print("\n๐ ๏ธ Task: Identify the C2 server and submit it using: submit FLAG{IP_ADDRESS}")
print("๐ก Hint: Look for unusual ports or repeated suspicious connections.\n")
while True:
cmd = input("> ").strip().lower()
if cmd == "submit flag{45.33.32.156}":
print("\nโ
Correct! That IP shows C2-like behavior on a shady port (1337).")
save["level"] = 12
save["flags"].append("flag{45.33.32.156}")
time.sleep(1.5)
clear()
print("๐ Level 11 Complete!\n")
while True:
choice = next_step_menu()
if choice == "1":
return save
elif choice == "2":
return level11(save)
elif choice == "3":
print("๐ Exiting game...")
exit()
else:
print("โ Invalid choice. Please select 1, 2, or 3.")
elif cmd == "restart":
return level11(save)
elif cmd == "exit":
print("๐ Exiting game...")
exit()
else:
print("โ Incorrect flag. Try again or type 'exit' or 'restart'.")