Coder Social home page Coder Social logo

jonathanwilbur / cve-2018-19131 Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 2.0 4.27 MB

Proof-of-Concept exploit of CVE-2018-19131: Squid Proxy XSS via X.509 Certificate

License: MIT License

Shell 4.16% HTML 7.49% Dockerfile 88.35%
proxy xss exploit cve squid squid3 squid-proxy xss-exploitation xss-poc

cve-2018-19131's Introduction

CVE-2018-19131 Demo

Do not do anything illegal with this. This is not malware. This is just a proof of concept.

This is a demo of CVE-2018-19131, which runs in a Docker Compose app.

This library builds Squid version 3.5.27, which is vulnerable. Version 3.5.28 is not vulnerable. The particular versions that are affected are listed here.

Testing has succeeded on both Windows 10 and Mac OS X Mojave.

Proof-of-Concept Usage

Don't run this on the same host that you are configured to proxy from, because the proxy will redirect all HTTP requests back to itself. The client and server should be two separate machines.

Server Setup

  1. Clone this repository by running git clone https://github.com/JonathanWilbur/CVE-2018-19131.git.
  2. Change into the directory by running cd CVE-2018-19131.
  3. Build the application by running docker-compose up.
  • This will take a long time (about 20 minutes), because it has to compile Squid from scratch.

Client Setup

Setting up an HTTPS proxy is a really standard thing. Windows and MacOS has it. Linux has anything if you're creative. I will not document how to set up a proxy here, because it is already documented extensively elsewhere. Just configure your computer to point to the server on which you installed the vulnerable Squid instance.

I will note, however, that you should be using an HTTPS proxy, not HTTP. On MacOS, in the Proxies settings, this is called a Secure Web Proxy. Windows makes no such distinction.

Exploitation

Access the malicious site by connecting to https://web. Accept the first certificate error, which is just caused from the proxy intercepting the HTTPS traffic, then you'll be presented with the next page, which will run the exploit. You should see a web browser alert that says HACKED!.

After you click OK, you will see the default Squid page for a failure to securely connect. You will notice that the issuer/subject name displayed--which are one and the same, because this uses a self-signed certificate--is missing the commonName (CN) attribute. That's because its value was:

<script>alert("HACKED!");</script>

which gets interpreted as raw HTML and hence, the script gets executed!

See Also

Contact Me

If you would like to suggest fixes or improvements on this library, please just leave an issue on this GitHub page. If you would like to contact me for other reasons, please email me at [email protected] (My GPG Key) (My TLS Certificate). ๐Ÿ—

cve-2018-19131's People

Contributors

jonathanwilbur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

orf53975

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.