-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel6.py
More file actions
53 lines (48 loc) · 1.81 KB
/
level6.py
File metadata and controls
53 lines (48 loc) · 1.81 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
import os
import time
def clear():
os.system('cls' if os.name == 'nt' else 'clear')
def next_step_menu(save):
while True:
print("\nWhat would you like to do next?")
print("1. Continue to next level")
print("2. Restart level")
print("3. Exit game")
choice = input("Enter your choice (1/2/3): ").strip()
if choice == "1":
return save
elif choice == "2":
return level6(save)
elif choice == "3":
print("\n👋 Exiting game...\n")
exit()
else:
print("❌ Invalid choice. Please enter 1, 2, or 3.")
def level6(save):
clear()
print("🧪 Level 6: Suspicious EXE Behavior\n")
print("The malware was dropped as `dropper.exe`. When executed in a sandbox, it performed a strange action:\n")
print("--- Sandbox Output ---")
print("cmd.exe /c echo U1RBR0VfMUpTTl9GTElHRw== | base64 -d")
print("--- End Output ---\n")
print("🛠️ Your task:")
print("Analyze the command. What is the decoded output of the base64 string?")
print("\n🎯 Submit the flag using:")
print("submit FLAG{DECODED_TEXT}")
print("\n💡 Hint: The command echoes a base64 string and pipes it to base64 -d.\n")
while True:
cmd = input(">> ").strip()
if cmd == "submit FLAG{STAGE_1JSN_FLIGG}":
print("\n✅ Correct! Flag accepted.\n")
save["level"] = 7
save["flags"].append("FLAG{STAGE_1JSN_FLIGG}")
time.sleep(1.5)
clear()
return next_step_menu(save)
elif cmd.lower() == "restart":
return level6(save)
elif cmd.lower() == "exit":
print("\n👋 Exiting game...\n")
exit()
else:
print("❌ Incorrect flag. Try again or type 'restart' or 'exit'.")