Coder Social home page Coder Social logo

ssrfsocks's Introduction

ssrfsocks: SOCKS-based SSRF tunneling proxy

ssrfsocks utilizes an existing Server-Side Request Forgercy vulnerability to tunnel traffic through it. This code acts as a SOCKS4 proxy server, and relays traffic through the SSRF vuln and returns the result. This concept is based on the Blackhat 2012 presentation by Polyakov & Chastukhin on SSRF and XXE tunneling.

Limitations:

Due to the nature of SSRF vulnerabilities, only one response is made from a request. This means that it is not possible to run an interactive session. We can however send single-shot messages to internal services. This means it's possible to, for example, send an email via SMTP, and grab the banner of most services. This will tend to be most useful with simple protocols like SMTP and HTTP, and ineffective with protocols such as SSH and TLS.

Example:

$ ./ssrfproxy "http://victim.com/openurl?url="
listener ready on port 65432

$ echo -e "HELO localhost\nMAIL FROM:[email protected]\nRCPT TO: [email protected]\nDATA\nSubject: test\n\nthis is a test\n.\nQUIT\n" \
  | proxychains nc 127.0.0.1 25

In the above scenario, it's necessary to configure proxychains.conf:

[ProxyList]
socks4 127.0.0.1 65432

Testing:

Currently, the SOCKS4A code is untested, as proxychains doesn't seem to support it. I found limited success with running nmap over this proxy, as nmap reports closed ports as open, and some open ports as closed.

This script was tested against a vulnerable app that passed a user-controlled value to code that treated the value as a URI, fetched it, and returned the result. It's likely not usable against XXE vulnerabilities without some modification.

ssrfsocks's People

Contributors

iamultra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  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.