-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbaseline_menu.sh
executable file
·139 lines (67 loc) · 4.58 KB
/
baseline_menu.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
#baseline_menu
# v1.0 by sVen Mueller
## This script creates dynamic baseline traffic
clear
echo "Traffic Baselining"
echo
#IP=$1
IP="juiceshop.f5agility.com"
#if [ "$IP" == "" ]
# then
# #echo -n "Enter Target IP as an Argument"
# #exit
#fi
BASELINE='Please enter your type of baselining: '
options=("increasing" "alternate" "Quit")
select opt in "${options[@]}"
do
case $opt in
"increasing")
while true; do
clear
echo "Hourly increasing HTTP traffic: $IP"
echo
for i in $(eval echo "{0..`date +%M`}")
do
curl -k -0 --interface 10.1.10.100 -s -o /dev/null -A "`shuf -n 1 ./source/useragents_with_bots.txt`" -w "status: %{http_code}\tbytes: %{size_download}\ttime: %{time_total}\n" https://$IP`shuf -n 1 ./source/urls.txt`
curl -k -0 --interface 10.1.10.100 -s -o /dev/null -A "`shuf -n 1 ./source/useragents_with_bots.txt`" https://$IP`shuf -n 1 ./source/urls.txt`
curl -k -0 --interface 10.1.10.100 -s -o /dev/null -A "`shuf -n 1 ./source/useragents_with_bots.txt`" https://$IP`shuf -n 1 ./source/urls.txt`
#curl -0 -s -o /dev/null -A "`sort -R ./source/useragents_with_bots.txt | head -1`" -w "status: %{http_code}\tbytes: %{size_download}\ttime: %{time_total}\n" https://$IP`sort -R ./source/urls.txt | head -1`
done
#sleep 0.1
done
;;
"alternate")
while true; do
clear
echo "Hourly alternate HTTP traffic: $IP"
echo
#if (( {`date +%k` % 2} )); then
if (( `date +%k` % 2 )); then
for i in {1..100};
do
curl -k -0 --interface 10.1.10.100 -s -o /dev/null -A "`shuf -n 1 ./source/useragents_with_bots.txt`" -w "High:\tstatus: %{http_code}\tbytes: %{size_download}\ttime: %{time_total}\n" https://$IP`shuf -n 1 ./source/urls.txt`
curl -k -0 --interface 10.1.10.100 -s -o /dev/null -A "`shuf -n 1 ./source/useragents_with_bots.txt`" https://$IP`shuf -n 1 ./source/urls.txt`
curl -k -0 --interface 10.1.10.100 -s -o /dev/null -A "`shuf -n 1 ./source/useragents_with_bots.txt`" https://$IP`shuf -n 1 ./source/urls.txt`
# curl -k -0 -s -o /dev/null -A "`sort -R ./source/useragents_with_bots.txt | head -1`" -w "status: %{http_code}\tbytes: %{size_download}\ttime: %{time_total}\n" https://$IP`sort -R ./source/urls.txt | head -1`
done
else
for i in {1..50};
do
curl -k --interface 10.1.10.100 -s -o /dev/null -A "`shuf -n 1 ./source/useragents_with_bots.txt`" -w "High:\tstatus: %{http_code}\tbytes: %{size_download}\ttime: %{time_total}\n" https://$IP`shuf -n 1 ./source/urls.txt`
curl -k --interface 10.1.10.100 -s -o /dev/null -A "`shuf -n 1 ./source/useragents_with_bots.txt`" https://$IP`shuf -n 1 ./source/urls.txt`
curl -k --interface 10.1.10.100 -s -o /dev/null -A "`shuf -n 1 ./source/useragents_with_bots.txt`" https://$IP`shuf -n 1 ./source/urls.txt`
#curl -0 -s -o /dev/null -A "`sort -R ./source/useragents_with_bots.txt | head -1`" -w "status: %{http_code}\tbytes: %{size_download}\ttime: %{time_total}\n" https://$IP`sort -R ./source/urls.txt | head -1`
done
fi
#sleep 0.1
clear
done
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done