Skip to content

Commit b4b4471

Browse files
authored
Merge pull request #3 from codepath/dynamic
Dynamic file support
2 parents 826c7f0 + 0f05e3f commit b4b4471

37 files changed

+329
-224
lines changed

Files/.DS_Store

6 KB
Binary file not shown.

Files/ftp-3/activity.pcapng

-66.9 KB
Binary file not shown.

Files/ftp-3/attack.sh

-33
This file was deleted.

Files/ftp-3/cosmo/passwords.txt

-1
This file was deleted.

Files/ftp-3/cosmo/reports_original.txt

-1
This file was deleted.

Files/ftp-3/cosmo/rocknames.txt

-1
This file was deleted.

Files/ftp-3/general/budget.txt

-1
This file was deleted.

Files/ftp-3/general/reports.txt

-1
This file was deleted.

Files/ftp-3/scripts/attack.js

-28
This file was deleted.

Files/ftp-3/scripts/start-server.js

-1
This file was deleted.

Files/ftp-3/timmy/fishnames.txt

-2
This file was deleted.

Files/ftp-3/timmy/passwords.txt

-1
This file was deleted.

Files/ftp-3/timmy/reports_original.txt

-1
This file was deleted.

Files/ftp-3/wanda/catnames.txt

-4
This file was deleted.

Files/ftp-3/wanda/passwords.txt

-1
This file was deleted.

Files/ftp-3/wanda/reports_original.txt

-1
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Files/unit3/ftp_folder.zip

19.3 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
timestamp,source_ip,username,dest_ip,dest_url,http_method,user_agent,status_code,bytes_sent,bytes_received,category,action,
2-
6/4/2023 14:52,192.168.1.3,MKhan,93.184.216.34,http://example.com,GET,Chrome/91.0.4472.124,200,512,2048,General,ALLOW,
3-
6/4/2023 14:57,192.168.1.7,Jmann,172.217.168.68,http://google.com,GET,Firefox/89.0,200,1024,4096,Search Engines,ALLOW,
4-
6/4/2023 15:03,192.168.1.2,ACase,204.79.197.200,http://bing.com,GET,Edge/91.0.864.41,200,768,3072,Search Engines,ALLOW,
5-
6/4/2023 15:07,192.168.1.5,AMays,157.240.20.35,http://facebook.com,GET,Chrome/91.0.4472.124,200,2048,8192,Social Networking,DENY,
6-
6/4/2023 15:15,192.168.1.6,KHorton,52.30.206.159,http://linkedin.com,GET,Edge/91.0.864.41,200,1024,4096,Social Networking,ALLOW,
7-
6/4/2023 15:18,192.168.1.10,ABurke,52.94.237.74,http://amazon.com,GET,Firefox/89.0,200,768,3072,E-commerce,ALLOW,
8-
6/4/2023 15:22,192.168.1.9,SBielert,51.89.178.210,http://freecalendars.com,GET,Chrome/91.0.4472.124,200,512,2048,Organization,ALLOW,
9-
6/4/2023 15:28,192.168.1.11,JColeman,140.82.121.4,http://github.com,GET,Safari/13.1.1,200,1024,4096,Programming,ALLOW,
10-
6/4/2023 15:33,192.168.1.12,EFisher,208.80.154.224,http://wikipedia.org,GET,Edge/91.0.864.41,200,2048,8192,Reference,ALLOW,
11-
6/4/2023 15:37,192.168.1.14,TShah,192.229.163.122,http://yahoo.com,GET,Chrome/91.0.4472.124,200,768,3072,Email,ALLOW,
12-
6/4/2023 15:42,192.168.1.13,LMccarty,23.52.164.113,http://adobe.com,GET,Firefox/89.0,200,512,2048,Software,ALLOW,
13-
6/4/2023 15:47,192.168.1.4,DPetersen,216.58.217.46,http://youtube.com,GET,Firefox/89.0,200,1024,4096,Streaming Media,ALLOW,
14-
6/4/2023 15:50,192.168.1.10,ABurke,69.171.250.35,http://www.microsoft-updateserver.cf,GET,Safari/13.1.1,200,768,3072,Software,ALLOW,ALLOW
15-
6/4/2023 15:54,192.168.1.3,MKhan,185.60.216.35,http://netflix.com,GET,Chrome/91.0.4472.124,200,2048,8192,Streaming Media,ALLOW,
16-
6/4/2023 16:01,192.168.1.7,Jmann,184.26.44.19,http://microsoft.com,GET,Firefox/89.0,200,1024,4096,Organization,ALLOW,
17-
6/4/2023 16:05,192.168.1.2,ACase,151.101.65.140,http://stackoverflow.com,GET,Edge/91.0.864.41,200,768,3072,Programming,ALLOW,
18-
6/4/2023 16:11,192.168.1.5,AMays,172.217.5.110,http://gmail.com,GET,Chrome/91.0.4472.124,200,512,2048,Email,ALLOW,
19-
6/4/2023 16:15,192.168.1.6,KHorton,184.72.106.52,http://quora.com,GET,Edge/91.0.864.41,200,1024,4096,Forums,ALLOW,
20-
6/4/2023 16:20,192.168.1.10,ABurke,69.171.234.21,http://messenger.com,GET,Firefox/89.0,200,2048,8192,Messaging,ALLOW,
21-
6/4/2023 16:23,192.168.1.9,KKirby,192.0.66.2,http://wordpress.com,GET,Chrome/91.0.4472.124,200,768,3072,Blogging,ALLOW,
22-
6/4/2023 16:28,192.168.1.11,JColeman,104.244.42.193,http://twitter.com,GET,Safari/13.1.1,200,512,2048,Social Networking,ALLOW,
23-
6/4/2023 16:33,192.168.1.12,EFisher,13.249.44.129,http://imdb.com,GET,Edge/91.0.864.41,200,1024,4096,Entertainment,ALLOW,
24-
6/4/2023 16:37,192.168.1.14,TShah,199.232.36.84,http://pinterest.com,GET,Chrome/91.0.4472.124,200,768,3072,Social Networking,ALLOW,
25-
6/4/2023 16:42,192.168.1.15,JBennett,151.101.1.164,http://news.ycombinator.com,GET,Firefox/89.0,200,2048,8192,News,ALLOW,
26-
6/4/2023 16:50,192.168.1.15,JBennett,151.101.194.2,http://reddit.com,GET,Firefox/89.0,200,2048,8192,Forums,ALLOW,
27-
6/4/2023 16:55,192.168.1.3,MKhan,192.0.66.2,http://wordpress.org,GET,Chrome/91.0.4472.124,200,768,3072,Blogging,ALLOW,
28-
6/4/2023 17:00,192.168.1.7,Jmann,51.89.178.210,http://freecalendars.com,GET,Firefox/89.0,200,512,2048,E-commerce,ALLOW,
29-
6/4/2023 17:05,192.168.1.2,ACase,204.79.197.200,http://bing.com,GET,Edge/91.0.864.41,200,1024,4096,Search Engines,ALLOW,
30-
6/4/2023 17:10,192.168.1.5,AMays,151.101.1.167,http://flickr.com,GET,Chrome/91.0.4472.124,200,2048,8192,Photo Sharing,ALLOW,
31-
6/4/2023 17:15,192.168.1.6,KHorton,31.13.71.36,http://facebook.com,GET,Edge/91.0.864.41,200,768,3072,Social Networking,ALLOW,
32-
6/4/2023 17:20,192.168.1.10,ABurke,216.58.192.206,http://google.com,GET,Firefox/89.0,200,512,2048,Search Engines,ALLOW,
33-
6/4/2023 17:25,192.168.1.9,KKirby,151.101.129.164,http://vimeo.com,GET,Chrome/91.0.4472.124,200,1024,4096,Streaming Media,ALLOW,
34-
6/4/2023 17:30,192.168.1.11,JColeman,104.244.42.1,http://tumblr.com,GET,Safari/13.1.1,200,2048,8192,Blogging,ALLOW,
35-
6/4/2023 17:35,192.168.1.12,EFisher,34.206.39.153,http://stackoverflow.com,GET,Edge/91.0.864.41,200,768,3072,Programming,ALLOW,
36-
6/4/2023 17:40,192.168.1.14,TShah,185.60.218.35,http://netflix.com,GET,Chrome/91.0.4472.124,200,512,2048,Streaming Media,ALLOW,
37-
6/4/2023 17:45,192.168.1.1,Echan,104.79.140.7,http://github.com,GET,Firefox/89.0,200,2048,8192,Software Development,ALLOW,
38-
6/4/2023 17:50,192.168.1.13,LMccarty,209.170.118.61,http://linkedin.com,GET,Firefox/89.0,200,768,3072,Social Networking,ALLOW,
39-
6/4/2023 17:55,192.168.1.4,SBielert,208.80.154.224,http://www.microsoft-updateserver.cf,GET,Firefox/89.0,200,1024,4096,Software,ALLOW,
40-
6/4/2023 18:00,192.168.1.8,EChan,23.21.189.88,http://twitch.tv,GET,Safari/13.1.1,200,2048,8192,Streaming Media,DENY,
1+
timestamp,source_ip,username,dest_ip,dest_url,http_method,user_agent,status_code,bytes_sent,bytes_received,category,action,
2+
6/4/2023 14:52,192.168.1.3,MKhan,93.184.216.34,http://example.com,GET,Chrome/91.0.4472.124,200,512,2048,General,ALLOW,
3+
6/4/2023 14:57,192.168.1.7,Jmann,172.217.168.68,http://google.com,GET,Firefox/89.0,200,1024,4096,Search Engines,ALLOW,
4+
6/4/2023 15:03,192.168.1.2,ACase,204.79.197.200,http://bing.com,GET,Edge/91.0.864.41,200,768,3072,Search Engines,ALLOW,
5+
6/4/2023 15:07,192.168.1.5,AMays,157.240.20.35,http://facebook.com,GET,Chrome/91.0.4472.124,200,2048,8192,Social Networking,DENY,
6+
6/4/2023 15:15,192.168.1.6,KHorton,52.30.206.159,http://linkedin.com,GET,Edge/91.0.864.41,200,1024,4096,Social Networking,ALLOW,
7+
6/4/2023 15:18,192.168.1.10,ABurke,52.94.237.74,http://amazon.com,GET,Firefox/89.0,200,768,3072,E-commerce,ALLOW,
8+
6/4/2023 15:22,192.168.1.9,SBielert,51.89.178.210,http://freecalendars.com,GET,Chrome/91.0.4472.124,200,512,2048,Organization,ALLOW,
9+
6/4/2023 15:28,192.168.1.11,JColeman,140.82.121.4,http://github.com,GET,Safari/13.1.1,200,1024,4096,Programming,ALLOW,
10+
6/4/2023 15:33,192.168.1.12,EFisher,208.80.154.224,http://wikipedia.org,GET,Edge/91.0.864.41,200,2048,8192,Reference,ALLOW,
11+
6/4/2023 15:37,192.168.1.14,TShah,192.229.163.122,http://yahoo.com,GET,Chrome/91.0.4472.124,200,768,3072,Email,ALLOW,
12+
6/4/2023 15:42,192.168.1.13,LMccarty,23.52.164.113,http://adobe.com,GET,Firefox/89.0,200,512,2048,Software,ALLOW,
13+
6/4/2023 15:47,192.168.1.4,DPetersen,216.58.217.46,http://youtube.com,GET,Firefox/89.0,200,1024,4096,Streaming Media,ALLOW,
14+
6/4/2023 15:50,192.168.1.10,ABurke,69.171.250.35,http://www.microsoft-updateserver.cf,GET,Safari/13.1.1,200,768,3072,Software,ALLOW,ALLOW
15+
6/4/2023 15:54,192.168.1.3,MKhan,185.60.216.35,http://netflix.com,GET,Chrome/91.0.4472.124,200,2048,8192,Streaming Media,ALLOW,
16+
6/4/2023 16:01,192.168.1.7,Jmann,184.26.44.19,http://microsoft.com,GET,Firefox/89.0,200,1024,4096,Organization,ALLOW,
17+
6/4/2023 16:05,192.168.1.2,ACase,151.101.65.140,http://stackoverflow.com,GET,Edge/91.0.864.41,200,768,3072,Programming,ALLOW,
18+
6/4/2023 16:11,192.168.1.5,AMays,172.217.5.110,http://gmail.com,GET,Chrome/91.0.4472.124,200,512,2048,Email,ALLOW,
19+
6/4/2023 16:15,192.168.1.6,KHorton,184.72.106.52,http://quora.com,GET,Edge/91.0.864.41,200,1024,4096,Forums,ALLOW,
20+
6/4/2023 16:20,192.168.1.10,ABurke,69.171.234.21,http://messenger.com,GET,Firefox/89.0,200,2048,8192,Messaging,ALLOW,
21+
6/4/2023 16:23,192.168.1.9,KKirby,192.0.66.2,http://wordpress.com,GET,Chrome/91.0.4472.124,200,768,3072,Blogging,ALLOW,
22+
6/4/2023 16:28,192.168.1.11,JColeman,104.244.42.193,http://twitter.com,GET,Safari/13.1.1,200,512,2048,Social Networking,ALLOW,
23+
6/4/2023 16:33,192.168.1.12,EFisher,13.249.44.129,http://imdb.com,GET,Edge/91.0.864.41,200,1024,4096,Entertainment,ALLOW,
24+
6/4/2023 16:37,192.168.1.14,TShah,199.232.36.84,http://pinterest.com,GET,Chrome/91.0.4472.124,200,768,3072,Social Networking,ALLOW,
25+
6/4/2023 16:42,192.168.1.15,JBennett,151.101.1.164,http://news.ycombinator.com,GET,Firefox/89.0,200,2048,8192,News,ALLOW,
26+
6/4/2023 16:50,192.168.1.15,JBennett,151.101.194.2,http://reddit.com,GET,Firefox/89.0,200,2048,8192,Forums,ALLOW,
27+
6/4/2023 16:55,192.168.1.3,MKhan,192.0.66.2,http://wordpress.org,GET,Chrome/91.0.4472.124,200,768,3072,Blogging,ALLOW,
28+
6/4/2023 17:00,192.168.1.7,Jmann,51.89.178.210,http://freecalendars.com,GET,Firefox/89.0,200,512,2048,E-commerce,ALLOW,
29+
6/4/2023 17:05,192.168.1.2,ACase,204.79.197.200,http://bing.com,GET,Edge/91.0.864.41,200,1024,4096,Search Engines,ALLOW,
30+
6/4/2023 17:10,192.168.1.5,AMays,151.101.1.167,http://flickr.com,GET,Chrome/91.0.4472.124,200,2048,8192,Photo Sharing,ALLOW,
31+
6/4/2023 17:15,192.168.1.6,KHorton,31.13.71.36,http://facebook.com,GET,Edge/91.0.864.41,200,768,3072,Social Networking,ALLOW,
32+
6/4/2023 17:20,192.168.1.10,ABurke,216.58.192.206,http://google.com,GET,Firefox/89.0,200,512,2048,Search Engines,ALLOW,
33+
6/4/2023 17:25,192.168.1.9,KKirby,151.101.129.164,http://vimeo.com,GET,Chrome/91.0.4472.124,200,1024,4096,Streaming Media,ALLOW,
34+
6/4/2023 17:30,192.168.1.11,JColeman,104.244.42.1,http://tumblr.com,GET,Safari/13.1.1,200,2048,8192,Blogging,ALLOW,
35+
6/4/2023 17:35,192.168.1.12,EFisher,34.206.39.153,http://stackoverflow.com,GET,Edge/91.0.864.41,200,768,3072,Programming,ALLOW,
36+
6/4/2023 17:40,192.168.1.14,TShah,185.60.218.35,http://netflix.com,GET,Chrome/91.0.4472.124,200,512,2048,Streaming Media,ALLOW,
37+
6/4/2023 17:45,192.168.1.1,Echan,104.79.140.7,http://github.com,GET,Firefox/89.0,200,2048,8192,Software Development,ALLOW,
38+
6/4/2023 17:50,192.168.1.13,LMccarty,209.170.118.61,http://linkedin.com,GET,Firefox/89.0,200,768,3072,Social Networking,ALLOW,
39+
6/4/2023 17:55,192.168.1.4,SBielert,208.80.154.224,http://www.microsoft-updateserver.cf,GET,Firefox/89.0,200,1024,4096,Software,ALLOW,
40+
6/4/2023 18:00,192.168.1.8,EChan,23.21.189.88,http://twitch.tv,GET,Safari/13.1.1,200,2048,8192,Streaming Media,DENY,
File renamed without changes.
File renamed without changes.
File renamed without changes.

README.md

+10-28
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# Machine Set-Up
22

3-
## The Easy Way
3+
## The Easy Way (`install_tool.sh`)
44

5-
- **Get a fresh linux VM with the following specs:**
5+
- **Get a fresh linux VM with the following minimum specs:**
66
- Ubuntu Server 20.04 LTS
77
- 2 cores
88
- 4GB RAM
99
- 128GB Standard SSD
1010

11-
- **Download this Repo, extract into `~` so that `~/Scripts` and `~/Files` are valid paths**
12-
- **From the `~` directory, run script: `./Scripts/setup.sh`**
13-
- This will install all the tools and place all the files needed for the course
11+
- **Download and run the `install_tool.sh` script**
12+
- This script will install all the tools and place all the files needed for the course
1413
- This might take a while (est 30-45m), so open Youtube or something
15-
- You will need to press `enter` between each script -- this is so if you need to stop, you can!
16-
- The script **is** safe to run multiple times if you need to stop and start again
14+
- You will be able to choose between installing all units or just one unit at a time
1715

18-
## The Hard Way
16+
## The Hard Way (Manual Set-Up)
1917

2018
### RDP Setup
2119

@@ -37,17 +35,11 @@
3735

3836
### Unit 2: Lab
3937

40-
- N/A - Students install their account-specific Wazuh agents during lab
38+
- N/A - Students download files during lab
4139

4240
### Unit 2: Project
4341

44-
- Run script: `~/scripts/unit2_project.sh`
45-
- Tool(s) installed: N/A - Same as lab
46-
- Files placed:
47-
- `/etc/wazuh/static.txt`
48-
- `/etc/wazuh/thisisit.txt`
49-
- `attack-part1`
50-
- `attack-part2`
42+
- N/A - Students download files during project
5143

5244
### Unit 3: Lab
5345

@@ -120,21 +112,11 @@ ftp_project
120112

121113
### Unit 7: Lab
122114

123-
- Run script: `~/scripts/unit7_lab.sh`
124-
- Tool(s) installed: `MISP`
125-
- Files placed: None
126-
127-
#### 🚨 Manual Steps
128-
129-
- Login to 127.0.0.1 on the local machine (No port needed)
130-
- Change the user/password from `[email protected]/admin` to `[email protected]/Codepath123!`
131-
- Click on `Sync Actions` > `Load Default Feed Metadata` > `Fetch and Store all feed data`
132-
- Check all the options and select `Cache All Feeds`
133-
- (Note: This is NOT the blue button that says `Fetch and store all feed Data`!)
115+
- N/A - Students download files during lab
134116

135117
### Unit 7: Project
136118

137-
- N/A - Same as Lab
119+
- N/A - Students download files during project
138120

139121
### Unit 8+
140122

Scripts/setup.sh

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
# Check if wget is installed
4+
if ! command -v wget &> /dev/null; then
5+
echo -e "Installing wget..."
6+
sudo apt install -y wget
7+
fi
8+
39
# Call the rdp_setup.sh script
410
./Scripts/rdp_setup.sh
511

Scripts/unit1_lab.sh

+42-25
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,60 @@ red='\033[0;31m'
33
green='\033[0;32m'
44
none='\033[0m'
55

6+
scripts_repo="https://raw.githubusercontent.com/codepath/cyb102-vm-setup/${1:-"main"}/Files/"
7+
68
echo "[UNIT 1 LAB] Starting script..."
79

8-
# Check if the script needs to run
10+
# Check if the Wireshark needs to be installed
911
if command -v wireshark >/dev/null 2>&1 ; then
1012
echo -e "${green}[UNIT 1 LAB]${none} Wireshark is already installed."
11-
exit 0
12-
fi
13-
echo "[UNIT 1 LAB] Installing Wireshark..."
13+
else
14+
echo "[UNIT 1 LAB] Installing Wireshark..."
1415

15-
# Pre-set the answer for the wireshark-common package
16-
echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections
16+
# Pre-set the answer for the wireshark-common package
17+
echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections
1718

18-
# Add the Wireshark PPA
19-
sudo add-apt-repository -y ppa:wireshark-dev/stable
19+
# Add the Wireshark PPA
20+
sudo add-apt-repository -y ppa:wireshark-dev/stable
2021

21-
# Update the package list
22-
sudo apt-get update
22+
# Update the package list
23+
sudo apt-get update
2324

24-
# Install Wireshark in non-interactive mode
25-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y wireshark
25+
# Install Wireshark in non-interactive mode
26+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y wireshark
2627

27-
# Print output based on whether or not Wireshark is installed
28-
if command -v wireshark >/dev/null 2>&1 ; then
29-
echo -e "${green}[UNIT 1 LAB]${none} Wireshark installed successfully."
30-
else
31-
echo -e "${red}[UNIT 1 LAB]${none} ERROR: Wireshark was not installed correctly!"
32-
exit 1
28+
# Print output based on whether or not Wireshark is installed
29+
if command -v wireshark >/dev/null 2>&1 ; then
30+
echo -e "${green}[UNIT 1 LAB]${none} Wireshark installed successfully."
31+
else
32+
echo -e "${red}[UNIT 1 LAB]${none} ERROR: Wireshark was not installed correctly!"
33+
exit 1
34+
fi
35+
fi
36+
37+
# Ensure the lab_1 directory exists
38+
if [ ! -d "$HOME/lab_1" ]; then
39+
mkdir -p "$HOME/lab_1"
3340
fi
3441

35-
# Move everything in ../Files/lab-1 to ~ and rename it to lab_1
36-
if [ -e ~/lab_1 ]; then
37-
echo -e "${green}[UNIT 1 LAB]${none} lab_1 already exists."
42+
# Download the required files into the lab_1 directory
43+
if [ -e "$HOME/lab_1/SMTP.pcap" ]; then
44+
echo -e "${green}[UNIT 1 LAB]${none} Files already found at ~/lab_1."
3845
else
39-
if [ -e ~/Files/lab-1 ]; then
40-
sudo mv ~/Files/lab-1 ~/lab_1 && echo -e "${green}[UNIT 1 PROJECT]${none} Moved lab 1 files to ~/lab_1"
41-
else
42-
echo -e "${red}[UNIT 1 LAB]${none} Error: Directory ~/Files/lab-1 does not exist."
46+
# Initialize a flag to indicate success
47+
all_success=true
48+
49+
# Download the files
50+
wget "${scripts_repo}unit1/DHCP.txt" -O "$HOME/lab_1/DHCP.txt" || all_success=false
51+
wget "${scripts_repo}unit1/Security_log.rtf" -O "$HOME/lab_1/Security_log.rtf" || all_success=false
52+
wget "${scripts_repo}unit1/SMTP.pcap" -O "$HOME/lab_1/SMTP.pcap" || all_success=false
53+
54+
# Verify download was successful
55+
if [ "$all_success" = false ]; then
56+
echo -e "${red}[UNIT 1 LAB]${none} Error: Could not download files to $HOME/lab_1 folder"
57+
echo -e "${red}[UNIT 1 LAB]${none} Try downloading manually from ${scripts_repo}unit1 and placing in ~/lab_1."
4358
exit 1
59+
else
60+
echo -e "${green}[UNIT 1 LAB]${none} Files downloaded successfully."
4461
fi
4562
fi

Scripts/unit3_lab.sh

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ if command -v /usr/local/bin/snort >/dev/null 2>&1 ; then
1010
echo -e "${green}[UNIT 3 LAB]${none} Snort is already installed."
1111
exit 0
1212
fi
13+
14+
echo -e "${yellow}WARNING: Installing Snort takes 30-60 minutes.${none}"
15+
echo -e "${yellow}During that time, you will need to leave your machine on and connected to the internet.${none}"
16+
read -p "Do you want to continue with the installation? (y/n) " -n 1 -r
17+
echo
18+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
19+
echo "Exiting the program. Goodbye!"
20+
exit 1
21+
fi
22+
1323
echo "[UNIT 3 LAB] Installing Snort..."
1424

1525
# Set timezone to Eastern Time

Scripts/unit3_project.sh

+13-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
red='\033[0;31m'
33
green='\033[0;32m'
44
none='\033[0m'
5+
scripts_repo="https://raw.githubusercontent.com/codepath/cyb102-vm-setup/${1:-"main"}/Files/"
56

67
echo "[UNIT 3 PROJECT] Starting script..."
78

@@ -30,14 +31,20 @@ else
3031
fi
3132
fi
3233

33-
# Move everything in ../Files/ftp-3 to ~ and rename it to ftp_folder
34+
# Download the required files into the lab_1 directory
3435
if [ -e ~/ftp_folder ]; then
3536
echo -e "${green}[UNIT 3 PROJECT]${none} ftp_folder already exists."
3637
else
37-
if [ -e ~/Files/ftp-3 ]; then
38-
sudo mv ~/Files/ftp-3 ~/ftp_folder && echo -e "${green}[UNIT 3 PROJECT]${none} Moved ftp-3 files to ~/ftp_folder"
39-
else
40-
echo -e "${red}[UNIT 3 PROJECT]${none} Error: File ~/Files/ftp-3 does not exist."
38+
# Download the files
39+
wget "${scripts_repo}unit3/ftp_folder.zip" -O "$HOME/ftp_folder.zip"
40+
unzip ~/ftp_folder.zip -d ~/
41+
42+
# Verify download was successful
43+
if ! [ "$HOME/ftp_folder" ]; then
44+
echo -e "${red}[UNIT 3 PROJECT]${none} Error: Could not download files to $HOME/ftp_folder"
45+
echo -e "${red}[UNIT 3 PROJECT]${none} Try downloading manually from ${scripts_repo}unit3/ftp_folder.zip and placing in $HOME."
4146
exit 1
47+
else
48+
echo -e "${green}[UNIT 3 PROJECT]${none} Files downloaded successfully."
4249
fi
43-
fi
50+
fi

0 commit comments

Comments
 (0)