SlideShare a Scribd company logo
OWNING THE CLOUT THROUGH SSRF
AND PDF GENERATORS
Ben Sadeghipour
Cody Brocious
WHO ARE WE
● Head of Hacker Operations at HackerOne
● Top 20 hacker on HackerOne
● Snapchat, Yahoo, DoD, Airbnb, Valve, etc.
● Youtube/Twitch/social media: @NahamSec
Ben Sadeghipour
● Head of Hacker Education at HackerOne
● Not top 20 on HackerOne
● Hotel locks, Nintendo Switch, iTunes, etc.
● Twitter: @daeken
Cody Brocious
In a Server-Side Request Forgery (SSRF) attack, the attacker can abuse functionality
on the server to read or update internal resources. The attacker can supply or a modify
a URL which the code running on the server will read or submit data to, and by
carefully selecting the URLs, the attacker may be able to read server configuration
such as AWS metadata, connect to internal services like http enabled databases or
perform post requests towards internal services which are not intended to be exposed.
TL;DR: Make requests using the target host and in some cases render JS server side
SSRF According to OWASP
What is Cloud Metadata?
● 169.254.164.254 is accessible internally within the machine you have access to.
● Provides details like internal IP, hostname, project details, etc.
And if you’re lucky enough, it could also give you access to access_key & secret_key
as well

Recommended for you

SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTION

This document discusses SQL injection (SQLI), which is a code injection technique used to attack data-driven applications. SQLI works by inserting malicious SQL statements into entry fields for execution on the backend database. This allows attackers to read sensitive data, modify database contents, and perform administration tasks. The document outlines common SQLI attack methods like error-based and union-based techniques. It also categorizes SQLI attacks as in-band, inferential/blind, or out-of-band based on how results are returned. Examples are provided to illustrate how SQLI exploits vulnerabilities in dynamic SQL queries.

sql injection in details
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques

General Waf detection and bypassing techniques. Main focus to demonstrate that how to take right approach to analyse the behaviour of web application firewall and then create test cases to bypass the same.

hackwaf
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)

Cross-Site Scripting (XSS) is a web security vulnerability that allows attackers to inject client-side scripts into web pages viewed by other users. There are three main types of XSS attacks: reflected XSS, stored XSS, and DOM-based XSS. XSS has been one of the top vulnerabilities on the OWASP Top Ten list for many years. While XSS attacks can compromise user sessions and steal sensitive data, developers can prevent XSS through proper input sanitization and output encoding. As web applications continue to grow in use, jobs in web application security and penetration testing are also expected to increase significantly in the coming years.

scriptingxsscross-site
Basic Example
● Upload avatar via URL and triggers the following request:
GET /api/v1/fetch?url=https://site.com/myfunnycatmeme.jpeg
Host: thesiteweareabouttpwn.com
● Changing the URL parameter to something.internal.target.com may give us
access to see internal assets
● Not limited to http, you can use other protocols
○ file:///etc/passwd
○ gopher://
○ ssh://
… But it’s not always that easy
CVE Examples
Similar to previous slides
JIRA CVE-2017-9506
CVE Examples
https://medium.com/bugbountywriteup/piercing-the-veil-server-side-request-forgery-to-niprnet-access-c358fd5e249a
Pointing consumerUri to Google
Similar to previous slides
JIRA CVE-2017-9506
CVE Examples
https://medium.com/bugbountywriteup/piercing-the-veil-server-side-request-forgery-to-niprnet-access-c358fd5e249a
Metadata

Recommended for you

Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting

Cross Site Scripting (XSS) is a type of injection attack where malicious scripts are injected into otherwise benign and trusted websites. XSS has been a top web application vulnerability since 1996. There are three main types of XSS attacks: reflected XSS, stored XSS, and DOM-based XSS. Reflected XSS occurs when malicious scripts come from URLs, while stored XSS happens when scripts are stored on websites. XSS can be used to steal cookies and sessions, redirect users, alter website contents, and damage an organization's reputation. Developers can prevent XSS through input validation, output encoding, and using the HttpOnly flag.

Injection flaws
Injection flawsInjection flaws
Injection flaws

As long as code and data cannot be distinguished by machines, Injection attacks will prevail. Injection flaws are very prevalent, particularly in legacy code. Injection flaws occur when an application sends untrusted data to an interpreter. This talk will focus on different injection flaws, challenges associated with it and possible ways to mitigate it.

sql injectionos command injectionimap injection
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with example

The slide consists of: An explanation for SQL injections. First order and second order SQL injections. Methods: Normal and Blind SQL injections with examples. Examples: Injection using true/false, drop table and update table commands. Prevention using dynamic embedded SQL queries. Conclusion and References.

javaoraclesql
Similar to previous slides
Jenkins - CVE-2018-1000600
CVE Examples
Pointing apiUri to AWS Metadata
Sometimes it’s not as straightforward as a single http request. In some cases you may
be dealing with filters or you may not even see the output of your request but you still
have a few options
SSRF Hurdles
SSRF Hurdles
● Problem: metadata or internal IPs are getting filtered
○ Solution: Use a custom domain like meta.mydomain.com and point it to the
asset you are trying to access (aws.mydomain.com -> 169.254.169.254)
● Problem: Only able to use whitelisted domains
○ Solution: Find an ‘Open Redirect’ on the whitelisted domain(s) and use that
to exploit your SSRF
● Problem: SSRF is there but I can’t see the output
○ Solution: Use Javascript and exfil data
● XSS on the target application where it also gets pushed to the PDF
○ How to confirm it: <script>document.write(123)</script>
○ Generate PDF and it should print 123
● Follows redirection by pointing the url or HTML tag (iframe/img etc) to our host
where redirect.php redirects to success.php
○ mysite.com/redirect.php -> redirects to mysite.com/success.php
● Any customization that involves HTML/CSS (Font name, colors, styling)
● Open redirect on the target application in case of any domain whitelisting
Valuable Assets / Vulnerabilities

Recommended for you

Cross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting ExplainedCross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting Explained

Key Points What is Cross Site Request Forgery (CSRF)? How Attack Can Happen? Damages caused by CSRF? Mitigations What is Cross Site Request Forgery (CSRF)? CSRF is an attack in which attacker forges the request as a trusted user. The request is essentially made to send unintended data to the site. A vulnerable web application assumes that the data is coming from a trusted user. The root cause is – request coming from browser is trusted by server blindly, if CSRF protection is not implemented. This “blind trust” lets attacker create a forged request, and make the victim perform that request. How Attack Can Happen? Attacker knows about target application, on which the attack is to be performed Attacker forges request and sends it to victim who may be logged into the website by embedding that forged request into a hyperlink Victim clicks on it, and unknowingly sends malicious request to website Website accepts it and processes it. Thus the attacker is successful in performing the attack. Damages caused by CSRF? In Net-banking attacker can forge the request and send it to victim to steal money from Victim’s account Personal health information can be stolen or modified in a hospital database Attacker force victim to perform unwanted action which affect their profile Mitigation Techniques Can be mitigate by two ways CSRF token (a cookie which is introduced in each form and validated by web app) Captcha (implemented to ensure that the request is being performed by a human interaction)

ethical hackingwebsite hackinginformation security
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application Vulnerabilities

This document provides an overview of the OWASP Top 10 Risk Rating Methodology. It explains how risks are rated based on four factors: threat agent, attack vector, technical impact, and business impact. Each factor is given a rating of 1-3 (easy to difficult) and these ratings are multiplied together to calculate an overall weighted risk rating. An example of how this methodology would be applied to an SQL injection vulnerability is also provided.

sgce2012
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction

This document provides an overview of the Laravel PHP framework. It describes key Laravel concepts like MVC architecture, Eloquent ORM, Blade templating, routing, controllers, authentication, Artisan CLI, and Inversion of Control using service providers. It also lists requirements to set up a Laravel project and ways to create one using the Laravel installer or Composer.

phplaravel
PDF GENERATION PROCESS
Headless Browsers
There are two common headless browsers in use:
● wkhtmlpdf is a Webkit implementation whose rendering backend is PDF.
● Headless Chrome is desktop Chrome minus the GUI and with a PDF or image
rendering backend attached.
Lots of wrapper libraries providing easy integration with any language
HTML Renderers
Rather than using an actual browser engine, these renderers work by doing the HTML
and CSS parsing, without any kind of JavaScript support or dynamic layout engine.
● tend to provide a restricted environment where most HTML can be handled safely
and efficiently
WeasyPrint is a great example of this class of HTML->PDF converters (more later)
XSS in PDF Files

Recommended for you

An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API

This document provides an introduction and overview of REST APIs. It defines REST as an architectural style based on web standards like HTTP that defines resources that are accessed via common operations like GET, PUT, POST, and DELETE. It outlines best practices for REST API design, including using nouns in URIs, plural resource names, GET for retrieval only, HTTP status codes, and versioning. It also covers concepts like filtering, sorting, paging, and common queries.

restapiweb
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT

This document provides an overview of the Laravel PHP framework, including instructions for installation, directory structure, MVC concepts, and a sample "task list" application to demonstrate basic Laravel features. The summary covers creating a Laravel project, defining a database migration and Eloquent model, adding routes and views with Blade templating, performing validation and CRUD operations, and more.

phpartisanslaravel
Cross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert BoxCross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert Box

The document discusses cross-site scripting (XSS) flaws that occur when untrusted user data is included on a webpage without validation or encoding. XSS allows attackers to execute scripts in a victim's browser by tricking them into visiting a malicious website. The document provides examples of XSS payloads and links to learn more about prevention and filters.

owasptop 10cybersecurity
PDF + XSS == SSRF
Most modern web applications performing PDF generation do not actually generate
PDFs directly.
● As such, any XSS into this data gets you running in the context of the server --
not the client!
The attack strategy used will depend on what conversion system is in use in the
application, but these can be broken into two categories: Headless browsers and
HTML renderers.
Simple XSS->SSRF via wkhtmltopdf
You notice HTML is rendering within your Generated PDF
● we want to make sure this can communicate with other hosts
○ <iframe src=”http://myhost:myport:443”>
Simple XSS->SSRF via wkhtmltopdf
<iframe src=”http://169.254.169.254/user-data”>
When Simple Fails
Headless Chrome is great for PDF conversion tasks like this, but it makes it harder for
hackers. Unlike wkhtmltopdf, it cares if you try to load an http resource inside an
https page, like our previous example. Also unlike wkhtmltopdf, you can’t typically
redirect it to another page and get a render of the new location.
Finally, the JS engine cares about Same-Origin Policy just like normal browsers do, so
we can’t just make an XMLHttpRequest to the metadata service and steal their data
that way.

Recommended for you

Laravel ppt
Laravel pptLaravel ppt
Laravel ppt

- Laravel is a popular PHP MVC framework that provides tools like Eloquent ORM, Blade templating, routing, and Artisan CLI to help developers build applications faster. - Key Laravel features include Eloquent for database access, Blade templating engine, routing system, middleware, and Artisan CLI commands for common tasks like migrations and seeding. - The document discusses Laravel's file structure, installing via Composer, and provides best practices for coding with Laravel like avoiding large queries and using middleware, validation, and CSRF protection.

laravelphpweb design
Hack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhydHack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhyd

The document provides an overview of key features and capabilities of Burp Suite, a popular web application security testing tool. It discusses how to configure Burp Suite for optimal performance, techniques for proxying and filtering traffic, exploiting vulnerabilities using the intruder tool, passive and active scanning with the scanner, replaying requests with the repeater, crawling sites with the spider, analyzing tokens with the sequencer, decoding responses with the decoder, comparing responses with the comparer, searching with engagement tools, extending functionality with extender, maintaining the state of assessments, and references for additional learning. The document is intended to help users get started with Burp Suite and leverage its full capabilities as a "pro."

hack like a pro with burp suite
SQL Injections (Part 1)
SQL Injections (Part 1)SQL Injections (Part 1)
SQL Injections (Part 1)

This document provides an introduction to SQL injection basics. It defines SQL injection as executing a SQL query or statement by injecting it into a user input field. The document outlines why SQL injection is studied, provides a sample database structure, and describes generic SQL queries and operators like UNION and ORDER BY. It also categorizes different types of SQL injection and attacks. The remainder of the document previews upcoming topics on blind SQL injection, data extraction techniques, and prevention.

sqlinjectionsqli
● Most user input gets sanitized/filtered
● We haven’t found an XSS in our target app
○ But… we are allowed to customize the fonts and styling of the generated
PDF
HTML Renders but...
XSS via escaping <style> tag
● Most user input gets sanitized/filtered
● No XSS
○ But… we are allowed to customize the fonts and styling
XSS via escaping <style> tag
● Confirm it renders HTML within the PDF Generator
● Can it fetch anything from a remote host”?
XSS via escaping <style> tag
Replace test payload with <style><iframe src=”http://169.254.169.254/user-data”>
and extract data:

Recommended for you

Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications

Microsoft powerpoint presentation for BTech academic seminar.This seminar discuses about penetration testing, penetration testing tools, web application vulnerabilities, impact of vulnerabilities and security recommendations.

web application securitybtechseminar
Security Vulnerabilities
Security VulnerabilitiesSecurity Vulnerabilities
Security Vulnerabilities

The document discusses common security threats such as URL spoofing, man-in-the-middle attacks, cross-frame scripting, SQL injection, rainbow table matching, denial of service attacks, cross-site scripting, cross-site request forgery, brute force attacks, and dictionary attacks. For each threat, it describes variations, prevention methods such as input validation, access control, and encryption, and detection techniques like monitoring for anomalous behavior.

middleman attackscross frame scriptingurl spoofing
Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend

This document discusses various techniques for optimizing the frontend performance of web applications. It provides 5 rules: 1) Only optimize when it makes a meaningful difference. 2) Download resources in parallel to reduce page load time. 3) Eliminate unnecessary requests through techniques like merging, inlining, sprites and caching. 4) Defer parsing of JavaScripts when possible to improve perceived page load speeds. 5) Consider factors like server location and content delivery networks to improve global performance.

WeasyPrint Makes Hacking (W)easy
WeasyPrint Makes Hacking (W)easy
… Once you know the trick, at least.
This one stumped us for a while. We got XSS into a PDF no problem, but there were
two things that made this hard:
1. It didn’t seem to run any scripts, load iframes, or seemingly do anything but load
images.
2. Every single payload we wanted to test required us to take a rideshare
somewhere.
Use The Source
Once we got it to connect to a server where we could see the request, we noticed that
the user agent said it was from WeasyPrint. A quick Google search later and we
learned it was a pretty straightforward HTML renderer written in Python and it was
open source!
Thankfully, we could run this locally and render pages just like the victim.
Unfortunately, this was when we got really pessimistic. This thing didn’t render
anything fun. Text, some CSS, images -- that was about it.
Use The Source
● How does it work?
○ weasyprint input.html output.pdf
Example:

Recommended for you

Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities

The document discusses various techniques for hacking client-side insecurities, including discovering clients on the internet and intranet, attacking client-side through JavaScript jacking and pluggable protocol handlers, exploiting cross-site request forgery vulnerabilities, and fingerprinting clients through analysis of HTTP headers and browser information leaks. The presentation aims to demonstrate these hacking techniques through examples and a question/answer session.

Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing

The presentation about how the site works on the Internet and what happens when you open it in your browser. What happens under the hood of the server and browser. How to measure the performance of the CS-Cart project simply and without technical knowledge :) And of course, why all the online-performance-testing services lie, or dont provides a clear view ;) https://www.simtechdev.com/cloud-hosting --- Cloud hosting for CS-Cart, Multi-Vendor, WordPress, and Magento by Simtech Development - AWS and CS-Cart certified hosting provider free installation & migration | free 24/7 server monitoring | free daily backups | free SSL | and more...

cloudhostingsimtechdev
Developer's Guide to JavaScript and Web Cryptography
Developer's Guide to JavaScript and Web CryptographyDeveloper's Guide to JavaScript and Web Cryptography
Developer's Guide to JavaScript and Web Cryptography

The increasing capabilities and performance of the web platform allow for more feature-rich user experiences. How can JavaScript based applications utilize information security and cryptography principles? This session will explore the current state of JavaScript and Web Cryptography. We will review some basic concepts and definitions, discuss the role of TLS/SSL, show some working examples that apply cryptography to real-world use cases and take a peek at the upcoming W3C WebCryptoAPI. Code samples will use CryptoJS in the browser and the Node.js Crypto module on the server. An extended example will secure the popular TodoMVC project using PBKDF2 for key generation, HMAC for data integrity and AES for encryption.

cryptographyjavascript
Use The Source
● Only fetched images
● No Javascript
● No <iframe>
● Html.py from WeasyPrint’s GitHub repository indicates we can use
○ <Img> 🛑
Use The Source
● Only fetched images
● No Javascript
● No <iframe>
● Html.py from WeasyPrint’s GitHub repository indicates we can use
○ <Img> 🛑
○ <Embed> 🛑
Use The Source
● Only fetched images
● No Javascript
● No <iframe>
● Html.py from WeasyPrint’s GitHub repository indicates we can use
○ <Img> 🛑
○ <Embed> 🛑
○ <Object> 🛑
Use The Source
● Only fetched images
● No Javascript
● No <iframe>
● Html.py from WeasyPrint’s GitHub repository indicates we can use
○ <Img> 🛑
○ <Embed> 🛑
○ <Object> 🛑
○ <Link> 🤔

Recommended for you

Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation

The document provides an overview of web development. It discusses how the web was created in 1989 by Tim Berners-Lee and the initial technologies of HTTP, HTML, and URLs. It then explains how a basic web application works with a browser connecting to a web server to request and receive HTML files and other resources. The document also summarizes key concepts in web development including front-end versus back-end code, common programming languages and frameworks, database usage, and standards that allow interoperability across systems.

codesjsonweb development
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development

Learn all the basics of web app development including bootstrap, handlebars templates, jquery and angularjs, as well as using hybrid app deployment on a phone.

WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development

Crash course introduction to web development for WordPress covering acronyms, buzzwords and concepts that often leave outsiders mystified. Overview of primary development processes and what software and tools are needed to play the game. We’ll cover what you need to go from zero to developer and hopefully how to have fun on the way. WordPress development tools explained for beginners: ftp, git, svn, php, html, css, sass, js, jquery, IDEs, themes, child themes, the Loop, hooks, APIs, CLI, agile, bootstrap, slack, linting, sniffing … etc.

wordpresswordcampwordcamp greenville
Attachments
<link rel=attachment href=”file:///etc/passwd”>
Attachments
<link rel=attachment href=”file:///etc/passwd”>
This embeds files right into the PDF itself! They aren’t visible on the page, but they’re
included as a hidden resource on the file.
Attachments
<link rel=attachment href=”file:///etc/passwd”>
This embeds files right into the PDF itself! They aren’t visible on the page, but they’re
included as a hidden resource on the file.
We could not only read files, but make web requests. Three rideshares later, we had
their full EC2 access keys.
Attachments
Unpacks the content from pdf

Recommended for you

1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development

Drupal is an open source content management system (CMS) written in PHP and uses a MySQL database. It allows users to build dynamic websites and provides features like content authoring, taxonomy, views, and customizable modules. The document discusses Drupal fundamentals like nodes, modules, blocks, menus, and user permissions. It also provides an overview of using HTML, CSS, PHP, and MySQL to develop websites with Drupal.

drupaltutorialcms
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe

The document discusses securing web applications from common vulnerabilities like cross-site scripting (XSS) and cross-site request forgery (CSRF). It outlines various techniques attackers use to exploit these issues, such as injecting malicious scripts into user input or forging unauthorized requests. The document then provides recommendations for developers to prevent these attacks, such as carefully validating and encoding all user input, and authenticating that requests are intended by the user.

jeremiah grossman joe walker ajax experience web a
Rails security: above and beyond the defaults
Rails security: above and beyond the defaultsRails security: above and beyond the defaults
Rails security: above and beyond the defaults

- The document discusses securing Rails web applications by improving on the framework's default security settings. - It emphasizes using HTTPS to encrypt traffic, securing certificates with tools like Let's Encrypt, and strengthening configurations using the Mozilla SSL Configuration Generator. - Content Security Policies provide an added layer of security by restricting what content can be loaded from external sources, reducing vulnerabilities, though they require careful configuration. - HTTP Public Key Pinning can lock users out if misconfigured, so caution is advised. Overall, the talk provides guidance on tightening security beyond Rails defaults.

httphttpshpkp
DNS Rebinding for Fun and Profit
When Simple Fails
Headless Chrome is great for PDF conversion tasks like this, but it makes it harder for
hackers. Unlike wkhtmltopdf, it cares if you try to load an http resource inside an
https page, like our previous example. Also unlike wkhtmltopdf, you can’t typically
redirect it to another page and get a render of the new location.
Finally, the JS engine cares about Same-Origin Policy just like normal browsers do, so
we can’t just make an XMLHttpRequest to the metadata service and steal their data
that way.
DNS Rebinding for Fun and Profit
DNS rebinding attacks provide a means to get around this. We make the browser
think it’s requesting data from the same domain the page was loaded from and it’s
game over.
DNS Rebinding for Fun and Profit
1. Browser loads http://ex.ploit.info/ and the script sends a message to the server
to rebind ex.ploit.info to 169.254.169.254
2. The script then resolves a0.ex.ploit.info through a2499.ex.ploit.info, flushing the
DNS cache for the original domain
3. Then the script can request any data from the metadata service using requests
to ex.ploit.info; the metadata services don’t care what hostname is used to make
requests to them
4. Data can be sent to bc.ex.ploit.info, which serves as a backchannel for
exfiltration

Recommended for you

W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities

Slides for "HTML5 Security Realities" talk at W3Conf: Practical Standards for Web Professionals 2013. Brad Hill - PayPal @hillbrad

html5 security csp mashups
Web II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentWeb II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side development

Lecture slides for COMP 3512. Suitable for Web 2 course in a degree following CIT/CIS/CS ACM model curriculum.

aspnetteachingweb
Abusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryAbusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec glory

"Through cooperation between browser vendors and standards bodies in the recent past, numerous standards have been created to enforce stronger client-side control for web applications. As web appsec practitioners continue to shift from mitigating vulnerabilities to implementing proactive controls, each new standard adds another layer of defense for attack patterns previously accepted as risks. With the most basic controls complete, attention is shifting toward mitigating more complex threats. As a result of the drive to control for these threats client-side, standards such as SubResource Integrity (SRI), Content Security Policy (CSP), and HTTP Public Key Pinning (HPKP) carry larger implementation risks than others such as HTTP Strict Transport Security (HSTS). Builders supporting legacy applications actively make trade-offs between implementing the latest standards versus accepting risks simply because of the increased risks newer web standards pose.  In this talk, we'll strictly explore the risks posed by SRI, CSP, and HPKP; demonstrate effective mitigation strategies and compromises which may make these standards more accessible to builders and defenders supporting legacy applications; as well as examine emergent properties of standards such as HPKP to cover previously unforeseen scenarios. As a bonus for the breakers, we'll explore and demonstrate exploitations of the emergent risks in these more volatile standards, to include multiple vulnerabilities uncovered quite literally during our research for this talk (which will hopefully be mitigated by d-day)." (Source: Black Hat USA 2016, Las Vegas)

DEF CON 27 - BEN SADEGHIPOUR  - owning the clout through ssrf and pdf generators
SSRF Tools
HTTPRebind
Rebinding attacks can be very valuable for SSRF, but they require a lot of setup work,
tweaking, and programming. HTTPRebind combines a DNS server with an HTTP
server to automatically handle all of this for you.
● Usable against any headless browser
● Takes only seconds to run due to DNS cache flushing
● Automatically pulls critical data from GCP, AWS, and Azure
Get the source at https://github.com/daeken/httprebind
SSRFTest
This tool lets you quickly do a first-pass test for SSRF. It will record incoming requests
for your different targets as well as automatically attempt to access and dump data
from EC2 metadata service.
The optimal targets for SSRFTest’s automated functionality are real headless
browsers living in the cloud, but it’s a useful starting point for any SSRF exploitation.
Get the code at https://github.com/daeken/SSRFTest or use the public instance at
https://ssrftest.com/

Recommended for you

Unusual Web Bugs
Unusual Web BugsUnusual Web Bugs
Unusual Web Bugs

The document summarizes various techniques for exploiting vulnerabilities in web applications, including exploiting logged out XSS vulnerabilities, CSRF protected XSS, XSS via HTTP headers, file upload issues, and encoding tricks for SQL injection. It discusses using techniques like browser password managers, session fixation, persistent data stores, and Flash to circumvent protections.

Web Bugs
Web BugsWeb Bugs
Web Bugs

This document provides an overview of unusual web application security bugs and exploitation techniques discussed by Alex Kuznetsov, including exploiting logged out XSS vulnerabilities, CSRF protected XSS, XSS via HTTP headers, file upload issues, PHP oddities, SQL injection encoding attacks, and more obscure bugs involving cookies, timing attacks, and cookie policies. The talk outlines new and creative ways to bypass input validation and achieve remote code execution or sensitive data disclosure on vulnerable sites.

Open Source Web Technologies
Open Source Web TechnologiesOpen Source Web Technologies
Open Source Web Technologies

Zend Framework is an open source PHP framework that follows the model-view-controller (MVC) pattern to promote best practices. It has many features like simplicity, extensibility, and full documentation. Google Gears is a browser plugin that allows web applications to work offline and store data locally. It includes a database, caching, and background processing to improve performance and responsiveness even without internet access. Google Gears aims to bridge the gap between desktop and web applications and its components are simple to use.

Recap
Recap
● SSRFs can be very dangerous
● Don’t give up on your bugs until you have tried every possible scenario
○ WeasyPrint took us ~3 months to piece together
● If you see a PDF generator somewhere, 9/10 it’s vulnerable
○ Especially if you chain with other vulnerabilities (XSS, Open Redirect, etc)
Recap
● Disable Javascript
● Create some good whitelisting
● Properly configure your cloud instances to minimize impact
● Be nice to hackers
Keep in Touch
● me@nahamsec.com
● Youtube/Twitch/social media: @NahamSec
Ben Sadeghipour
● Twitter: @daeken
● Hacker101 Discord
Cody Brocious

Recommended for you

Top Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.NetTop Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.Net

The document provides 10 tips for securing ASP.NET applications. It discusses common web attacks like cross-site request forgery and session fixation, and defenses against them such as using secret tokens and regenerating session IDs. It also covers proper use of cryptography, input validation, authorization, cookies, password security, and restricting application trust levels.

Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test

The document provides an overview of scaling principles for web applications, beginning with optimizing a single server application and progressing to more advanced architectures involving load balancing, multiple web/application servers, and multiple database servers. It discusses profiling applications to identify bottlenecks, various caching and optimization strategies, Apache configuration for handling load, and links to additional resources on related topics.

Scaling 101
Scaling 101Scaling 101
Scaling 101

The document provides an overview of scaling principles for web applications, beginning with optimizing a single server application and progressing to more advanced architectures involving load balancing, multiple web/application servers, and multiple database servers. It discusses profiling applications to identify bottlenecks, various caching and optimization strategies, Apache configuration for prefork MPM, and load balancing technologies like DNS round robin, Apache reverse proxy, HAProxy and Pound. Links are provided to additional resources on related topics.

scalingwebapplication
Thank You!

More Related Content

What's hot

CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVC
Suvash Shah
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
Halil Burak Cetinkaya
 
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
CODE BLUE
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTION
Mentorcs
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
Avinash Thapa
 
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)
Daniel Tumser
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
n|u - The Open Security Community
 
Injection flaws
Injection flawsInjection flaws
Injection flaws
DANISH INAMDAR
 
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with example
Prateek Chauhan
 
Cross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting ExplainedCross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting Explained
Valency Networks
 
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application Vulnerabilities
Software Guru
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
Ahmad Shah Hafizan Hamidin
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
Aniruddh Bhilvare
 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
Piyush Aggarwal
 
Cross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert BoxCross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert Box
Aaron Weaver
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
Mayank Panchal
 
Hack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhydHack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhyd
n|u - The Open Security Community
 
SQL Injections (Part 1)
SQL Injections (Part 1)SQL Injections (Part 1)
SQL Injections (Part 1)
n|u - The Open Security Community
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
Niyas Nazar
 
Security Vulnerabilities
Security VulnerabilitiesSecurity Vulnerabilities
Security Vulnerabilities
Marius Vorster
 

What's hot (20)

CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVC
 
REST & RESTful Web Services
REST & RESTful Web ServicesREST & RESTful Web Services
REST & RESTful Web Services
 
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTION
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Injection flaws
Injection flawsInjection flaws
Injection flaws
 
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with example
 
Cross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting ExplainedCross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting Explained
 
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application Vulnerabilities
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
 
Cross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert BoxCross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert Box
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Hack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhydHack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhyd
 
SQL Injections (Part 1)
SQL Injections (Part 1)SQL Injections (Part 1)
SQL Injections (Part 1)
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Security Vulnerabilities
Security VulnerabilitiesSecurity Vulnerabilities
Security Vulnerabilities
 

Similar to DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators

Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend
tkramar
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
amiable_indian
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing
Roman Ananev
 
Developer's Guide to JavaScript and Web Cryptography
Developer's Guide to JavaScript and Web CryptographyDeveloper's Guide to JavaScript and Web Cryptography
Developer's Guide to JavaScript and Web Cryptography
Kevin Hakanson
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
TurnToTech
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
zonathen
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
Evan Mullins
 
1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development
Wingston
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe
Jeremiah Grossman
 
Rails security: above and beyond the defaults
Rails security: above and beyond the defaultsRails security: above and beyond the defaults
Rails security: above and beyond the defaults
Matias Korhonen
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Brad Hill
 
Web II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentWeb II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side development
Randy Connolly
 
Abusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryAbusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec glory
Priyanka Aash
 
Unusual Web Bugs
Unusual Web BugsUnusual Web Bugs
Unusual Web Bugs
amiable_indian
 
Web Bugs
Web BugsWeb Bugs
Web Bugs
Dr Rushi Raval
 
Open Source Web Technologies
Open Source Web TechnologiesOpen Source Web Technologies
Open Source Web Technologies
Aastha Sethi
 
Top Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.NetTop Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.Net
alsmola
 
Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test
Rashmi Sinha
 
Scaling 101
Scaling 101Scaling 101
Scaling 101
Chris Finne
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
Nilesh Bafna
 

Similar to DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators (20)

Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
 
Website & Internet + Performance testing
Website & Internet + Performance testingWebsite & Internet + Performance testing
Website & Internet + Performance testing
 
Developer's Guide to JavaScript and Web Cryptography
Developer's Guide to JavaScript and Web CryptographyDeveloper's Guide to JavaScript and Web Cryptography
Developer's Guide to JavaScript and Web Cryptography
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to DevelopmentWordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
 
1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development1 Introduction to Drupal Web Development
1 Introduction to Drupal Web Development
 
Rich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safeRich Web App Security - Keeping your application safe
Rich Web App Security - Keeping your application safe
 
Rails security: above and beyond the defaults
Rails security: above and beyond the defaultsRails security: above and beyond the defaults
Rails security: above and beyond the defaults
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
Web II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side developmentWeb II - 01 - Introduction to server-side development
Web II - 01 - Introduction to server-side development
 
Abusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryAbusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec glory
 
Unusual Web Bugs
Unusual Web BugsUnusual Web Bugs
Unusual Web Bugs
 
Web Bugs
Web BugsWeb Bugs
Web Bugs
 
Open Source Web Technologies
Open Source Web TechnologiesOpen Source Web Technologies
Open Source Web Technologies
 
Top Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.NetTop Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.Net
 
Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test
 
Scaling 101
Scaling 101Scaling 101
Scaling 101
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
 

More from Felipe Prado

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
Felipe Prado
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
Felipe Prado
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got ants
Felipe Prado
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryption
Felipe Prado
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101
Felipe Prado
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a government
Felipe Prado
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
Felipe Prado
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
Felipe Prado
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
Felipe Prado
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interface
Felipe Prado
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
Felipe Prado
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
Felipe Prado
 
DEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityDEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud security
Felipe Prado
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portals
Felipe Prado
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitch
Felipe Prado
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
Felipe Prado
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
Felipe Prado
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
Felipe Prado
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
Felipe Prado
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devices
Felipe Prado
 

More from Felipe Prado (20)

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got ants
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryption
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a government
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interface
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
 
DEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityDEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud security
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portals
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitch
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devices
 

Recently uploaded

WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 

Recently uploaded (20)

WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 

DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators

  • 1. OWNING THE CLOUT THROUGH SSRF AND PDF GENERATORS Ben Sadeghipour Cody Brocious
  • 2. WHO ARE WE ● Head of Hacker Operations at HackerOne ● Top 20 hacker on HackerOne ● Snapchat, Yahoo, DoD, Airbnb, Valve, etc. ● Youtube/Twitch/social media: @NahamSec Ben Sadeghipour ● Head of Hacker Education at HackerOne ● Not top 20 on HackerOne ● Hotel locks, Nintendo Switch, iTunes, etc. ● Twitter: @daeken Cody Brocious
  • 3. In a Server-Side Request Forgery (SSRF) attack, the attacker can abuse functionality on the server to read or update internal resources. The attacker can supply or a modify a URL which the code running on the server will read or submit data to, and by carefully selecting the URLs, the attacker may be able to read server configuration such as AWS metadata, connect to internal services like http enabled databases or perform post requests towards internal services which are not intended to be exposed. TL;DR: Make requests using the target host and in some cases render JS server side SSRF According to OWASP
  • 4. What is Cloud Metadata? ● 169.254.164.254 is accessible internally within the machine you have access to. ● Provides details like internal IP, hostname, project details, etc. And if you’re lucky enough, it could also give you access to access_key & secret_key as well
  • 5. Basic Example ● Upload avatar via URL and triggers the following request: GET /api/v1/fetch?url=https://site.com/myfunnycatmeme.jpeg Host: thesiteweareabouttpwn.com ● Changing the URL parameter to something.internal.target.com may give us access to see internal assets ● Not limited to http, you can use other protocols ○ file:///etc/passwd ○ gopher:// ○ ssh:// … But it’s not always that easy
  • 7. Similar to previous slides JIRA CVE-2017-9506 CVE Examples https://medium.com/bugbountywriteup/piercing-the-veil-server-side-request-forgery-to-niprnet-access-c358fd5e249a Pointing consumerUri to Google
  • 8. Similar to previous slides JIRA CVE-2017-9506 CVE Examples https://medium.com/bugbountywriteup/piercing-the-veil-server-side-request-forgery-to-niprnet-access-c358fd5e249a Metadata
  • 9. Similar to previous slides Jenkins - CVE-2018-1000600 CVE Examples Pointing apiUri to AWS Metadata
  • 10. Sometimes it’s not as straightforward as a single http request. In some cases you may be dealing with filters or you may not even see the output of your request but you still have a few options SSRF Hurdles
  • 11. SSRF Hurdles ● Problem: metadata or internal IPs are getting filtered ○ Solution: Use a custom domain like meta.mydomain.com and point it to the asset you are trying to access (aws.mydomain.com -> 169.254.169.254) ● Problem: Only able to use whitelisted domains ○ Solution: Find an ‘Open Redirect’ on the whitelisted domain(s) and use that to exploit your SSRF ● Problem: SSRF is there but I can’t see the output ○ Solution: Use Javascript and exfil data
  • 12. ● XSS on the target application where it also gets pushed to the PDF ○ How to confirm it: <script>document.write(123)</script> ○ Generate PDF and it should print 123 ● Follows redirection by pointing the url or HTML tag (iframe/img etc) to our host where redirect.php redirects to success.php ○ mysite.com/redirect.php -> redirects to mysite.com/success.php ● Any customization that involves HTML/CSS (Font name, colors, styling) ● Open redirect on the target application in case of any domain whitelisting Valuable Assets / Vulnerabilities
  • 14. Headless Browsers There are two common headless browsers in use: ● wkhtmlpdf is a Webkit implementation whose rendering backend is PDF. ● Headless Chrome is desktop Chrome minus the GUI and with a PDF or image rendering backend attached. Lots of wrapper libraries providing easy integration with any language
  • 15. HTML Renderers Rather than using an actual browser engine, these renderers work by doing the HTML and CSS parsing, without any kind of JavaScript support or dynamic layout engine. ● tend to provide a restricted environment where most HTML can be handled safely and efficiently WeasyPrint is a great example of this class of HTML->PDF converters (more later)
  • 16. XSS in PDF Files
  • 17. PDF + XSS == SSRF Most modern web applications performing PDF generation do not actually generate PDFs directly. ● As such, any XSS into this data gets you running in the context of the server -- not the client! The attack strategy used will depend on what conversion system is in use in the application, but these can be broken into two categories: Headless browsers and HTML renderers.
  • 18. Simple XSS->SSRF via wkhtmltopdf You notice HTML is rendering within your Generated PDF ● we want to make sure this can communicate with other hosts ○ <iframe src=”http://myhost:myport:443”>
  • 19. Simple XSS->SSRF via wkhtmltopdf <iframe src=”http://169.254.169.254/user-data”>
  • 20. When Simple Fails Headless Chrome is great for PDF conversion tasks like this, but it makes it harder for hackers. Unlike wkhtmltopdf, it cares if you try to load an http resource inside an https page, like our previous example. Also unlike wkhtmltopdf, you can’t typically redirect it to another page and get a render of the new location. Finally, the JS engine cares about Same-Origin Policy just like normal browsers do, so we can’t just make an XMLHttpRequest to the metadata service and steal their data that way.
  • 21. ● Most user input gets sanitized/filtered ● We haven’t found an XSS in our target app ○ But… we are allowed to customize the fonts and styling of the generated PDF HTML Renders but...
  • 22. XSS via escaping <style> tag ● Most user input gets sanitized/filtered ● No XSS ○ But… we are allowed to customize the fonts and styling
  • 23. XSS via escaping <style> tag ● Confirm it renders HTML within the PDF Generator ● Can it fetch anything from a remote host”?
  • 24. XSS via escaping <style> tag Replace test payload with <style><iframe src=”http://169.254.169.254/user-data”> and extract data:
  • 26. WeasyPrint Makes Hacking (W)easy … Once you know the trick, at least. This one stumped us for a while. We got XSS into a PDF no problem, but there were two things that made this hard: 1. It didn’t seem to run any scripts, load iframes, or seemingly do anything but load images. 2. Every single payload we wanted to test required us to take a rideshare somewhere.
  • 27. Use The Source Once we got it to connect to a server where we could see the request, we noticed that the user agent said it was from WeasyPrint. A quick Google search later and we learned it was a pretty straightforward HTML renderer written in Python and it was open source! Thankfully, we could run this locally and render pages just like the victim. Unfortunately, this was when we got really pessimistic. This thing didn’t render anything fun. Text, some CSS, images -- that was about it.
  • 28. Use The Source ● How does it work? ○ weasyprint input.html output.pdf Example:
  • 29. Use The Source ● Only fetched images ● No Javascript ● No <iframe> ● Html.py from WeasyPrint’s GitHub repository indicates we can use ○ <Img> 🛑
  • 30. Use The Source ● Only fetched images ● No Javascript ● No <iframe> ● Html.py from WeasyPrint’s GitHub repository indicates we can use ○ <Img> 🛑 ○ <Embed> 🛑
  • 31. Use The Source ● Only fetched images ● No Javascript ● No <iframe> ● Html.py from WeasyPrint’s GitHub repository indicates we can use ○ <Img> 🛑 ○ <Embed> 🛑 ○ <Object> 🛑
  • 32. Use The Source ● Only fetched images ● No Javascript ● No <iframe> ● Html.py from WeasyPrint’s GitHub repository indicates we can use ○ <Img> 🛑 ○ <Embed> 🛑 ○ <Object> 🛑 ○ <Link> 🤔
  • 34. Attachments <link rel=attachment href=”file:///etc/passwd”> This embeds files right into the PDF itself! They aren’t visible on the page, but they’re included as a hidden resource on the file.
  • 35. Attachments <link rel=attachment href=”file:///etc/passwd”> This embeds files right into the PDF itself! They aren’t visible on the page, but they’re included as a hidden resource on the file. We could not only read files, but make web requests. Three rideshares later, we had their full EC2 access keys.
  • 37. DNS Rebinding for Fun and Profit
  • 38. When Simple Fails Headless Chrome is great for PDF conversion tasks like this, but it makes it harder for hackers. Unlike wkhtmltopdf, it cares if you try to load an http resource inside an https page, like our previous example. Also unlike wkhtmltopdf, you can’t typically redirect it to another page and get a render of the new location. Finally, the JS engine cares about Same-Origin Policy just like normal browsers do, so we can’t just make an XMLHttpRequest to the metadata service and steal their data that way.
  • 39. DNS Rebinding for Fun and Profit DNS rebinding attacks provide a means to get around this. We make the browser think it’s requesting data from the same domain the page was loaded from and it’s game over.
  • 40. DNS Rebinding for Fun and Profit 1. Browser loads http://ex.ploit.info/ and the script sends a message to the server to rebind ex.ploit.info to 169.254.169.254 2. The script then resolves a0.ex.ploit.info through a2499.ex.ploit.info, flushing the DNS cache for the original domain 3. Then the script can request any data from the metadata service using requests to ex.ploit.info; the metadata services don’t care what hostname is used to make requests to them 4. Data can be sent to bc.ex.ploit.info, which serves as a backchannel for exfiltration
  • 43. HTTPRebind Rebinding attacks can be very valuable for SSRF, but they require a lot of setup work, tweaking, and programming. HTTPRebind combines a DNS server with an HTTP server to automatically handle all of this for you. ● Usable against any headless browser ● Takes only seconds to run due to DNS cache flushing ● Automatically pulls critical data from GCP, AWS, and Azure Get the source at https://github.com/daeken/httprebind
  • 44. SSRFTest This tool lets you quickly do a first-pass test for SSRF. It will record incoming requests for your different targets as well as automatically attempt to access and dump data from EC2 metadata service. The optimal targets for SSRFTest’s automated functionality are real headless browsers living in the cloud, but it’s a useful starting point for any SSRF exploitation. Get the code at https://github.com/daeken/SSRFTest or use the public instance at https://ssrftest.com/
  • 45. Recap
  • 46. Recap ● SSRFs can be very dangerous ● Don’t give up on your bugs until you have tried every possible scenario ○ WeasyPrint took us ~3 months to piece together ● If you see a PDF generator somewhere, 9/10 it’s vulnerable ○ Especially if you chain with other vulnerabilities (XSS, Open Redirect, etc)
  • 47. Recap ● Disable Javascript ● Create some good whitelisting ● Properly configure your cloud instances to minimize impact ● Be nice to hackers
  • 48. Keep in Touch ● me@nahamsec.com ● Youtube/Twitch/social media: @NahamSec Ben Sadeghipour ● Twitter: @daeken ● Hacker101 Discord Cody Brocious