-
Notifications
You must be signed in to change notification settings - Fork 0
/
getdata.sh
executable file
·57 lines (47 loc) · 2.52 KB
/
getdata.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
#! /bin/bash
# URL format:
# ftp://ftp.ll.mit.edu/outgoing/darpa/data/1999/training/week1/monday/outside.tcpdump.gz
count=0
base_url="ftp://ftp.ll.mit.edu/outgoing/darpa/data/1999/"
mkdir -p training
mkdir -p testing
echo "Downloading the DARPA 1999 IDS Dataset..."
for dataset in "training" "testing"; do
if [ $dataset = "training" ]; then
for week in "week1" "week2" "week3"; do
for weekday in "monday" "tuesday" "wednesday" "thursday" "friday"; do
echo wget $base_url$dataset/$week/$weekday/inside.tcpdump.gz
wget $base_url$dataset/$week/$weekday/inside.tcpdump.gz -O $dataset/$count\_$week\_$weekday\_inside.pcap.gz -q
gunzip $dataset/$count\_$week\_$weekday\_inside.pcap.gz
echo wget $base_url$dataset/$week/$weekday/outside.tcpdump.gz
wget $base_url$dataset/$week/$weekday/outside.tcpdump.gz -O $dataset/$count\_$week\_$weekday\_outside.pcap.gz -q
gunzip $dataset/$count\_$week\_$weekday\_outside.pcap.gz
count=$((count + 1))
# Also grab the 3 additional days of extra data from week 3
if [ $week = "week3" ]; then
if [ $weekday = "monday" ] || [ $weekday = "tuesday" ] || [ $weekday = "wednesday" ]; then
echo wget $base_url$dataset/$week/extra\_$weekday/inside.tcpdump.gz
wget $base_url$dataset/$week/extra\_$weekday/inside.tcpdump.gz -O $dataset/$count\_$week\_$weekday\_extra\_inside.pcap.gz -q
gunzip $dataset/$count\_$week\_$weekday\_extra\_inside.pcap.gz
echo wget $base_url$dataset/$week/extra\_$weekday/outside.tcpdump.gz
wget $base_url$dataset/$week/extra\_$weekday/outside.tcpdump.gz -O $dataset/$count\_$week\_$weekday\_extra\_outside.pcap.gz -q
gunzip $dataset/$count\_$week\_$weekday\_extra\_outside.pcap.gz
count=$((count + 1))
fi
fi
done
done
else
for week in "week4" "week5"; do
for weekday in "monday" "tuesday" "wednesday" "thursday" "friday"; do
echo wget $base_url$dataset/$week/$weekday/inside.tcpdump.gz
wget $base_url$dataset/$week/$weekday/inside.tcpdump.gz -O $dataset/$count\_$week\_$weekday\_inside.pcap.gz -q
gunzip $dataset/$count\_$week\_$weekday\_inside.pcap.gz
echo wget $base_url$dataset/$week/$weekday/outside.tcpdump.gz
wget $base_url$dataset/$week/$weekday/outside.tcpdump.gz -O $dataset/$count\_$week\_$weekday\_outside.pcap.gz -q
gunzip $dataset/$count\_$week\_$weekday\_outside.pcap.gz
count=$((count + 1))
done
done
fi
done