Coder Social home page Coder Social logo

krivadna / hostpanic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mr-medi/hostpanic

0.0 0.0 0.0 239 KB

Find host header injections and perform Host Header attacks with other kind of bugs like web cache poisoning

Home Page: https://mr-medi.github.io

License: MIT License

Python 100.00%

hostpanic's Introduction

HostPanic

Hacking tool to seek host header injections and escalate it with other kind of vulns like web cache poissoning.

Feel free to contact me (@medi_0ne ) for any suggestion using this tool.

Attack Example

In the next Youtube video you can check how to perform a Routing Based SSRF based on a Portswigger Lab using my Tool. I will share more examples soon about how to approach it.

Click to see it:

Click to see how to use my Tool to perform Routing Based SSRF on a Portswigger lab

Installation

# Clone the repo
git clone https://github.com/mr-medi/HostPanic.git

Running the tests

python3 main.py -u https://www.google.com/ -v

Break down into end to end tests

The first thing is to enter a URL or domain, with this data the script will generate a serie of payloads to test for and if any of them find any host header injection in the HTTP headers or in the HTML returned by the server will print out in the terminal.

Let´s take an example:

I enter the url "https://www.google.com/" as seen in the previous example.

The script will do a GET request with different host headers, for example a Port Injection like the following HTTP Header 'Host: domain:22'. If this domain generate any link to construct the absolute URL and uses that header without sanitizes it you, then you can try to poisson that request with the reflected input as the host header and perform a responsible DOS attack to let the users without access that link.

In the next image you can see the sucesful result of a port injection in the host header in Google: Index page

USAGE:

[*] NORMAL MODE
python3 main.py -u <URL>

[*] NORMAL MODE + VERBOSE (Print HTTP headers of response)
python3 main.py -u <URL> -v

[*] NORMAL MODE + TEST LOCAL IP RANGE IN HOST HEADER (Following example will do 254 request from 192.168.0.1 to 192.168.0.255)
python3 main.py -u <URL> -r "192.168.0."

[*] NORMAL MODE + ADD COOKIES TO EACH REQUEST
python3 main.py -u <URL> -c "Mycookie1=1;MyEvilcookie2=2"

Authors

  • Mr.Medi

Special Thanks

This work is inspired by the following excellent researches:

TODO

  • Test for Web Cache Poissoning attacks and try to escalate all the host header injections found
  • Create a client to test for DNS pingbacks
  • Export results in a JSON file
  • Let the users to use his own list of payloads in the host header
  • Comment and refactor the code

hostpanic's People

Contributors

mr-medi avatar

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.