Git Product home page Git Product logo

http2-ddos's Introduction

HTTP/2 DDoS Attack

This attack utilizes the attack script from bennettaur's http2-ddos! Huge shout to Michael Bennett for his great work and presentation at HackFest.

Set up the HTTP/2 Server

docker pull robinhung/http2-express-server

docker run -p 9876:3000 --name=http-express-server -d robinhung/http2-express-server

Now go to https://localhost:9876 to connect to HTTP/2 express.js server.

NOTICE: use https instead of http! Normally the browser will indicates that the connection is insecure. This is becasue we're utilizing the self-signed certificate ,which is not trusted by the browser. Just add the exception to view the page :)

Attack Setup

Head over to attack-script directory. After you can utilize the .py script to launch the attack, you need to setup the virtualenv and install all the required packages!

Setup virtual environment using virtualenv

virtualenv --python python2 env2

# activate the virtual environment
source env2/bin/activate

# test if the virtualenv has been successfully setup
pip list

pip install -r requirements.txt

Attack Time!

Now, let's launch the attack!

# use the `http_req_limit_tests.pt` to spam the server with `/` requests
python http2_req_limit_tests.py -r 200 -c 10 -t localhost -p 9876 -f ./assets.txt -v 2

Click Control + C to stop the attack script.

During the attack, you can use docker stats to view the CPU usage has been increased dramatically!

docker stats $(docker ps | awk '{if(NR>1) print $NF}')

HTTP/2 Server with Express-Rate-Limit

cd http2-express-rate-limit

docker build -t robinhung/http2-express-rate-limit .

docker run -p 1234:3000 --name=rate-limit -d robinhung/http2-express-rate-limit

Result

Defense is NOT effective. Because the server is still taking all of the coming requests, but just instead return the status code 429 (Too many requests).

http2-ddos's People

Contributors

robinhung avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

http2-ddos's Issues

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.