-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathattack.sh
More file actions
executable file
·39 lines (35 loc) · 871 Bytes
/
attack.sh
File metadata and controls
executable file
·39 lines (35 loc) · 871 Bytes
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
#! /bin/bash
attack_times=10000
round_wait_time=300 # 20 min
wait_submit_time=60 # 20 s
log_file="logs"
run_time=3m
next_attack_time=0.5
log() {
t=`date "+%H:%M:%S"`
m="[$t]$m"
info="\033[43;37m $m ]\033[0m"
echo -e "$info"
echo -e "\n$m" >> $log_file
}
attack() {
echo "-- round $i -- " >> all_flags
cat flags >> all_flags
rm flags
for line in `cat hosts`;do
timeout --foreground $run_time python ./web_exp.py $line &
sleep $next_attack_time
done
echo -e "\x1b[47;30m Waitting $wait_submit_time s to submit flag\x1b[0m"
sleep $wait_submit_time
echo -e "\x1b[47;30m Submiting flag\x1b[0m"
python ./submit_flag
}
for((i=1; i <= $attack_times; i++));
do
m="-------- round $i --------"
log $m
attack
echo -e "\x1b[47;30m Waitting next round\x1b[0m"
sleep $round_wait_time
done