-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_challenges.sh
118 lines (95 loc) · 4.33 KB
/
setup_challenges.sh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
echo "Starting setup for challenges..."
# Base directory for challenges
CHALLENGES_DIR=~/Desktop/challenges
# Create base directory
mkdir -p $CHALLENGES_DIR
# --- Session 1 Challenges ---
echo "Setting up Session 1 challenges..."
SESSION1_DIR=$CHALLENGES_DIR/session1
mkdir -p $SESSION1_DIR/file_finder_race/folder1/folder2
# File Finder Race
echo "You found the treasure!" > $SESSION1_DIR/1_file_finder_race/folder1/folder2/hidden.txt
# --- Session 2 Challenges ---
echo "Setting up Session 2 challenges..."
SESSION2_DIR=$CHALLENGES_DIR/session2
# Hidden File Hunt
mkdir -p $SESSION2_DIR/1_hidden_file_hunt/folder1/folder2
echo "Congrats! You found the hidden file!" > $SESSION2_DIR/1_hidden_file_hunt/folder1/folder2/.hidden.txt
# Organize the Chaos
ORGANIZE_DIR=$SESSION2_DIR/2_organize_the_chaos
mkdir -p $ORGANIZE_DIR
for i in $(seq 1 10); do echo "Text file $i" > $ORGANIZE_DIR/file$i.txt; done
for i in $(seq 1 5); do echo "Image file $i" > $ORGANIZE_DIR/image$i.jpg; done
for i in $(seq 1 3); do echo "PDF file $i" > $ORGANIZE_DIR/document$i.pdf; done
# File Security Puzzle
SECURITY_DIR=$SESSION2_DIR/3_file_security_puzzle
mkdir -p $SECURITY_DIR
echo "Top secret message!" > $SECURITY_DIR/secret.txt
chmod 600 $SECURITY_DIR/secret.txt
# Secret Message Decoder
DECODER_DIR=$SESSION2_DIR/4_secret_message_decoder
mkdir -p $DECODER_DIR
echo "Decode this: VGhlIHBhc3N3b3JkIGlzIDEyMzQ=" > $DECODER_DIR/message_to_decode.txt
# --- Session 3 Challenges ---
echo "Setting up Session 3 challenges..."
SESSION3_DIR=$CHALLENGES_DIR/session3
# Mini-Challenge: Build Your Project Folder
PROJECT_DIR=$SESSION3_DIR/1_project_folder
mkdir -p $PROJECT_DIR/assignments $PROJECT_DIR/notes $PROJECT_DIR/resources $PROJECT_DIR/submissions
echo "Assignment 1 content" > $PROJECT_DIR/assignments/assignment1.txt
echo "Class notes" > $PROJECT_DIR/notes/class_notes.txt
echo "Research material" > $PROJECT_DIR/resources/research_material.pdf
touch $PROJECT_DIR/submissions/.gitignore
# Pre-created files for Advanced Commands section
BIG_FILES_DIR=$SESSION3_DIR/2_big_files
mkdir -p $BIG_FILES_DIR
touch $BIG_FILES_DIR/largefile.txt
for i in $(seq 1 100); do echo "This is line $i" >> $BIG_FILES_DIR/largefile.txt; done
# File Hunt
HUNT_DIR=$SESSION3_DIR/3_file_hunt
mkdir -p $HUNT_DIR/docs $HUNT_DIR/reports $HUNT_DIR/backups
echo "Confidential report" > $HUNT_DIR/reports/secret_report.txt
echo "Backup file 1" > $HUNT_DIR/backups/.hidden_backup1.txt
echo "Important passwords" > $HUNT_DIR/docs/passwords.txt
# User & Group Management Challenge
USER_GROUP_DIR=$SESSION3_DIR/4_user_group_management
mkdir -p $USER_GROUP_DIR
echo "Confidential data for a new user" > $USER_GROUP_DIR/confidential.txt
chmod 600 $USER_GROUP_DIR/confidential.txt
# --- Session 4 Challenges ---
echo "Setting up Session 4 challenges..."
SESSION4_DIR=$CHALLENGES_DIR/session4
# Ping and Traceroute Challenge
NETWORK_DIR=$SESSION4_DIR/network_tools
mkdir -p $NETWORK_DIR
echo "Ping results: Check connectivity to a specific server." > $NETWORK_DIR/ping_results.txt
echo "Traceroute: Find the path to a specific server." > $NETWORK_DIR/traceroute_results.txt
# Nmap Challenge
NMAP_DIR=$SESSION4_DIR/nmap
mkdir -p $NMAP_DIR
echo "Run an nmap scan to discover devices in the classroom network." > $NMAP_DIR/instructions.txt
# Cybersecurity Basic Challenge
CYBERSEC_DIR=$SESSION4_DIR/cybersecurity_basics
mkdir -p $CYBERSEC_DIR
echo "Attempt to brute-force a simulated password (hint: use the provided dictionary)." > $CYBERSEC_DIR/instructions.txt
echo -e "1234\npassword\nletmein" > $CYBERSEC_DIR/dictionary.txt
echo "Correct password: password" > $CYBERSEC_DIR/target.txt
# Who’s on the Network Challenge
WHO_NETWORK_DIR=$SESSION4_DIR/whos_on_network
mkdir -p $WHO_NETWORK_DIR
echo "Identify devices on the network and map them to their owners." > $WHO_NETWORK_DIR/instructions.txt
# --- Session 6 Challenges ---
echo "Setting up Session 6 challenges..."
SESSION6_DIR=$CHALLENGES_DIR/session6_pwnagotchi
mkdir -p $SESSION6_DIR
# Wireshark Analysis
echo "Creating sample pcap file for Wireshark analysis..."
sudo apt-get update && sudo apt-get install -y tcpdump curl
tcpdump -i lo -w $SESSION6_DIR/sample.pcap "tcp port 80" > /dev/null 2>&1 &
sleep 2
curl "http://example.com/login?user=admin&pass=password123" > /dev/null 2>&1
pkill tcpdump
# --- Finalizing ---
echo "All challenges set up under: $CHALLENGES_DIR"
ls -R $CHALLENGES_DIR