Coder Social home page Coder Social logo

jpleorx / tor-flood-attack Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 6.0 128 KB

Docker container that can flood HTTP requests through TOR proxy, scalable as a docker-compose service

License: Other

Dockerfile 2.01% Python 97.17% Shell 0.83%
tor proxy ddos ddos-attacks ddos-tool flood flooding http-flood python docker

tor-flood-attack's Introduction

Tor Flood Attack

This is a tool for orchestrating an HTTP flood attack. We provide a python script that launches parallel requests to target URLs while being covered by TOR or free VPN proxy. We also provide a docker image wrapped over this script, and a scalable docker-compose configuration.

This project was designed and intended for educational purposes only. All examples and targets were selected randomly. Use this at yout own risk. This repository may be deleted at any time, please make local backups if needed accordingly.

Prerequisites

Obviously you need to install Docker and docker-compose. Have a good bandwidth, and preferably a good CPU as we rely heavily on parallel HTTP requests here.

Configuration

Before launching this I highly suggest you to get familiar with how things can be adjusted in this script.

Targets

Target settings - all target URLs should be placed in targets.txt, please note that all of them are either "http" or "https":

https://www.google.com/
https://yandex.ru/

Performance

All performance settings are located in docker-compose.yml:

version: "3.9"
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      # How many cycles (epochs) of attacks should be performed
      # This value can be ignored, you can control the attack by stopping docker-compose at any time
      NUMBER_OF_EPOCHS: 100

      # Min/max values that determine how many requests can be simultaneously sent to a single URL
      # Actual number of requests is always randomly generated, bound between these two numbers
      PARALLEL_SINGLE_URL_MIN_REQUESTS: 200
      PARALLEL_SINGLE_URL_MAX_REQUESTS: 700

      # Should we use TOR proxy or free VPN proxy? (0 - no, 1 - yes)
      # Obviously do not set them both to 1, this will make everything crash
      # Set them both to 0 if you don't want to use any proxy
      #
      # Prefer free VPN proxy when running on servers with low replicas count (less than 5)
      # Also lower parallel single url requests for free vpn
      ENABLE_TOR_PROXY: 1
      ENABLE_FREE_PROXY: 0

      # How often should new proxy identity be generated? Default value - every 6 batches of requests (every 6 URLs)
      # Use 0 or -1 to disable IP change
      TOR_PROXY_IP_CHANGE_FREQUENCY: 6
      FREE_PROXY_IP_CHANGE_FREQUENCY: 6
    deploy:
      # How scaled this attack is, how many replicas of this container should be deployed
      replicas: 12
      restart_policy:
        condition: any

This setup has a potential to really warn up your hardware, please lower the settings if you're not sure what stress your PC can handle. For a modest PC it'll look like this:

...
NUMBER_OF_EPOCHS: 10
PARALLEL_SINGLE_URL_MIN_REQUESTS: 20
PARALLEL_SINGLE_URL_MAX_REQUESTS: 100
ENABLE_TOR_PROXY: 0
ENABLE_FREE_PROXY: 1
TOR_PROXY_IP_CHANGE_FREQUENCY: 24
FREE_PROXY_IP_CHANGE_FREQUENCY: 24
...
replicas: 2
...

Always monitor your hardware, tweak these settings and squeeze the most requests that your network can handle.

Running

Launching this script is fairly straight forward - clone the repository, navigate to the project's root folder and just run docker-compose.

Clone this repository

git clone https://github.com/JPLeoRX/tor-flood-attack.git
cd tor-flood-attack

Start the containers with scripts via:

docker-compose up --build -d

Connect to logs to monitor what's going on inside your containers:

docker-compose logs -f -t

Or in one command:

docker-compose up --build -d && docker-compose logs -f -t

To stop and kill all containers:

docker-compose down

Side-note: Running with another VPN

If your host machine is already connected to a VPN, with all outgoing traffic forwarded though VPN - all Docker traffic will be forwarded as well. So you don't need to use TOR or free VPN in this container, you can rely on your own host's VPN.

Links

In case you’d like to check my other work or contact me:

tor-flood-attack's People

Contributors

jpleorx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tor-flood-attack's Issues

Multiple Errors

Hi,
I find the project quite exciting. Is the project still being maintained? I just tried to make the whole thing work, but I get various error messages.

I was able to solve the first problem myself: The Dockerfile
refers to netcat instead of netcat-traditional. I have adapted this myself.
But I got some other errors:

2023-08-04T14:23:55.827553861Z cannot read PID file /run/tor/tor.pid ... failed!
2023-08-04T14:23:55.832517859Z privoxy is not running ... failed!
2023-08-04T14:23:55.842777603Z ControlPort 9051
2023-08-04T14:23:55.842794665Z CookieAuthentication 0
2023-08-04T14:23:55.842798121Z HashedControlPassword 16:C8437A54D9DF7AB9604A666C8C2BDB5622E0D7FF2D3D27C63893F522E6
2023-08-04T14:23:55.860006595Z Checking if tor configuration is valid ... failed!
2023-08-04T14:23:55.865376268Z Aug 04 14:23:55.865 [notice] Tor 0.4.7.13 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.9, Zlib 1.2.13, Liblzma 5.4.1, Libzstd 1.5.4 and Glibc 2.36 as libc.
2023-08-04T14:23:55.865392728Z Aug 04 14:23:55.865 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/
2023-08-04T14:23:55.865395613Z Aug 04 14:23:55.865 [warn] Tor was compiled with zstd 1.5.2, but is running with zstd 1.5.4. For safety, we'll avoid using advanced zstd functionality.
2023-08-04T14:23:55.865398078Z Aug 04 14:23:55.865 [notice] Read configuration file "/usr/share/tor/tor-service-defaults-torrc".
2023-08-04T14:23:55.865400523Z Aug 04 14:23:55.865 [notice] Read configuration file "/etc/tor/torrc".
2023-08-04T14:23:55.866736997Z Aug 04 14:23:55.866 [warn] Directory /var/lib/tor cannot be read: Permission denied
2023-08-04T14:23:55.866753107Z Aug 04 14:23:55.866 [warn] Failed to parse/validate config: Couldn't access private data directory "/var/lib/tor"
2023-08-04T14:23:55.866756143Z Aug 04 14:23:55.866 [err] Reading config failed--see warnings above.
2023-08-04T14:24:00.877698269Z tor is not running ... failed!
2023-08-04T14:24:06.888502708Z Starting filtering proxy server: privoxy failed!
2023-08-04T14:24:11.897248173Z privoxy is not running ... failed!

I tried to enable/disable TOR-Proxy / free proxy.. (0/0, 1/0, 0/1) But nothing works.

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.