Improving Web Vulnerability Scanning. Daniel Zulla



Similar documents
(WAPT) Web Application Penetration Testing

Criteria for web application security check. Version

WebCruiser Web Vulnerability Scanner User Guide

How to hack a website with Metasploit

Lecture 11 Web Application Security (part 1)

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

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

Recon and Mapping Tools and Exploitation Tools in SamuraiWTF Report section Nick Robbins

List of Scanner Features (3 of 3)

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

Adobe Systems Incorporated

DISCOVERY OF WEB-APPLICATION VULNERABILITIES USING FUZZING TECHNIQUES

STABLE & SECURE BANK lab writeup. Page 1 of 21

WebCruiser User Guide

Security vulnerabilities in new web applications. Ing. Pavol Lupták, CISSP, CEH Lead Security Consultant

HP WebInspect Tutorial

Security Basics - Lessons From a Paranoid. Stuart Larsen Yahoo! Paranoids - Pentest

The Web AppSec How-to: The Defenders Toolbox

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

Web Application Penetration Testing

Update logo and logo link on A Master. Update Date and Product on B Master

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

Table of Contents. Open-Xchange Authentication & Session Handling. 1.Introduction...3

Conducting Web Application Pentests. From Scoping to Report For Education Purposes Only

Web Application Guidelines

HTTPParameter Pollution. ChrysostomosDaniel

Cloud Application Security Assessment, Guerrilla Style

How To Burp David Brown

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

Pwning Intranets with HTML5

Detecting and Exploiting XSS with Xenotix XSS Exploit Framework

Cross-Site Scripting

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

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

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

Web Application Security

Security Products Development. Leon Juranic

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

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

Penetration Testing Lessons Learned. Security Research

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

The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.

EVALUATING COMMERCIAL WEB APPLICATION SECURITY. By Aaron Parke

The Top Web Application Attacks: Are you vulnerable?

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

What is Web Security? Motivation

Software Requirements Specification

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

Sichere Software- Entwicklung für Java Entwickler

BDD FOR AUTOMATING WEB APPLICATION TESTING. Stephen de Vries

Essential IT Security Testing

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

FIVE WAYS TO OPTIMIZE MOBILE WEBSITE PERFORMANCE WITH PAGE SPEED

Crawl Proxy Installation and Configuration Guide

Load testing with. WAPT Cloud. Quick Start Guide

Penetration Testing: Lessons from the Field

Real World Web Service Testing For Web Hackers

THE OPEN UNIVERSITY OF TANZANIA

Mavituna Security Ltd. Finance House, 522A Uxbridge Rd. Pinner. HA5 3PU / UK

Intrusion detection for web applications

Front-End Performance Testing and Optimization

Cyber Security Challenge Australia 2014

Acunetix Web Vulnerability Scanner. Getting Started. By Acunetix Ltd.

Acunetix Website Audit. 5 November, Developer Report. Generated by Acunetix WVS Reporter (v8.0 Build )

Maltego Tungsten as a collaborative attack platform BlackHat 2013

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

Information Supplement: Requirement 6.6 Code Reviews and Application Firewalls Clarified

A Tool for Evaluation and Optimization of Web Application Performance

Adding Value to Automated Web Scans. Burp Suite and Beyond

Playing with Web Application Firewalls

Bust a cap in a web app with OWASP ZAP

Introduction:... 1 Security in SDLC:... 2 Penetration Testing Methodology: Case Study... 3

Two Novel Server-Side Attacks against Log File in Shared Web Hosting Servers

Application security testing: Protecting your application and data

Newsletter - September T o o l s W a t c h T e a m NJ OUCHN & MJ SOLER

A Tale of the Weaknesses of Current Client-side XSS Filtering

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

WebCruiser Web Vulnerability Scanner User Guide

EXTRA. Vulnerability scanners are indispensable both VULNERABILITY SCANNER

Bank Hacking Live! Ofer Maor CTO, Hacktics Ltd. ATC-4, 12 Jun 2006, 4:30PM

Where every interaction matters.

External Network & Web Application Assessment. For The XXX Group LLC October 2012

Project 2: Web Security Pitfalls

Security features of ZK Framework

DNS REBINDING DENIS BARANOV, POSITIVE TECHNOLOGIES

Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

Check list for web developers

Chapter 1 Web Application (In)security 1

METHODS TO TEST WEB APPLICATION SCANNERS

Understanding Web Application Security Issues

Webapps Vulnerability Report

Penetration Testing with Kali Linux

Learn Ethical Hacking, Become a Pentester

Web application security: Testing for vulnerabilities

Transcription:

Improving Web Vulnerability Scanning 1 Daniel Zulla

Introduction Hey! 2 Hi there! I m Dan. This is my first year at DEFCON. I do programming and security start-ups. I do some penetration testing as well

More Introduction 3 Today I m going to talk about vulnerability scanning Primary on the web The cloud is involved as well Network security too I ll show some things, so there is plenty of demo time Have fun, thanks for being here!

Some Facts 4 There are a lot of web vulnerability scanners, fuzzers and penetration testing tools out there already Some of them work, some of them do not But basically all of them have one thing in common: They actually don t attack web applications on the application layer They mostly fuzz HTTP and sometimes perform injection attacks

Some more facts 5 The fundamental design of web scanners has not changed in over a decade But: The web has changed. So there seems to be a problem.

Software Architecture What web vulnerability scanners and fuzzers look like 6 Plugins A HTTP Library RXSS BSQLI EVAL The Core PXSS LFI OSC Output Engine Multithreading / Forking SQL RFI [...]

A pentesters point of view 7 Javascript/Ajax rich applications are still not supported Authenticated scanning is still incredibly challenging / not reliable Exploitation techniques are mostly poor I don t know which scanner will work for foo.com and which one for bar.com, so I use toolchains

A developers point of view 8 Javascript/Ajax rich applications are still not supported Authenticated scanning is still incredibly challenging / not reliable Exploitation techniques are mostly poor I don t know which scanner will work for foo.com and which one for bar.com, so I use toolchains HTTP Libraries don t support JS - Scanners are based on an HTTP Libraries Web Logins are not standarized - So how should they be detected No time for exploits (Already spent 100000 lines [and nights] of code making the crawler immune to encoding issues, malformed HTML, redirects and binary content!) A false positive is better than a false negative

How I see it 9 Both of them are right. The web is a mess. Nobody cares about RFCs anymore. (Especially these SEO guys!) 10 years ago, you would have expected a Query String at the end of a URL like https://foo.com/xxx/yyy?foo=bar Nowadays, https://foo.com/something.ext/foo/bar is good practice The result: It s incredibly hard for scanner developers to figure out the dynamic components of an HTTP request. Because of that, we feel overhelmed and fuzz nearly everything. Header Keys, Header Values, VHost, Cookie, Method, Path, Version,...

How I see it 10 Fuzzing HTTP is incredibly important. You never know if you are talking to an apache2, nginx or some hidden application server upstream But it has nothing to-do with web vulnerability scanning So - developers are struggling with websites because they use HTTP to crawl and attack them. Things like flash, images, javascript seems to be an unsolveable problem Redirects are hard to handle sometimes (wait there is more) Javascript redirects (after 10 seconds!) and of course: onmouseover, onclick, onfocus,... Flash isn t helpful either

Web 2.0 11 But - WE DO SECURITY Is it really our job to make sure that our software executed all the JS and grabbed all the links? When we spend 100 hours on the crawler, and 5 hours on the actual payloads (that s how it looks right now) something, somewhere, went terribly wrong So - Is there a (open source?) piece of software that we could use instead of the HTTP library? Something that has prooven its mastery in handling unpredictably broken web content already? There is.

Webkit! 12

Webkit knows 13 Javascript CSS Rendering Javascript events Binary Downloads Redirects Broken HTML Flash Broken CSS Images Performance Websockets Forking / Multiprocessing WebGL [...]

Software Architecture What it should look like 14 The Front-End A HTTP Library The Core RXSS PXSS BSQLI LFI EVAL OSC Reporting Engine SQL RFI [...] The Exploitation Engine

Changes? Improvments? 15 Replacing the HTTP library by a Webkit Engine Less code (A lot less code) 100% support for JS/Ajax/Broken HTML/JS Events/Crazy Redirects and all kinds of things The ability to simulate human user behaviour CSS Renderings (Two text fields beside each other: 10px - one of them is a input[type=password]) - May be a login!

Making it scale (heavily) 16 Webkit is slow (Website rendering, Executing JS,... - compared to - Speaking Plaintext HTTP) Downloading Images is slow Waiting for delayed JS events is slow Flash is even slower

Making it scale (heavily) Bad news: Qt / PyQt / PySide 17 QtWebkit does not support multithreading It tends to SEGFAULT from time to time :( Multiple QApplication instances are almost impossible to handle in one Python namespace

Making it scale (heavily) Good news: Building a preforking TCP Server 18 Spawning a pool of processes works quite well (one QApplication +one Browser instance per Process) Simultaneous downloads Better accessibility inside the scanner (multiprocessing insides loops to increase performance)

Missing pieces 19 Mastering Authentication Exploitation & Privilege Escalation Geographically distributed scanning: Using the cloud Reporting

Mastering Authentication 20 There is no such thing as a standarized web login Basically, everybody develops access control on the web slightly differently You can try to detect them by the name/id of the attributes, but that is not reliable But in the end, Web logins generally have a few things in common that makes them easily detectable. At least, for our browser engine

Mastering Authentication Not more than 2 visible (!) text fields 21 has_login_texts()

Mastering Authentication Man-Behind-You Protection 22 is_input_hidden()

Mastering Authentication Geometry! Usually, the two visible text fields are under(), next_to() or at least near(radius=10px) each other 23 X1 = X2! X1 = X2 Y1 = Y2

Mastering Authentication 24 That was easy! The common way to solve that problem, is to iterate through a wordlist (login, auth, signin, [...]) while checking the input[id], input[name] attributes That s not necessarily wrong or bad practice After putting the pieces together:.login( username, password )

Mastering Authentication Demo Time 25 Proof Of Concept 1: Twitter (Some Javascript) Proof Of Concept 2: Facebook (More Javascript) Proof Of Concept 3: Google Plus (Most Javascript + Browser Hacks)

Mastering Authentication When we are signed in 26 New problems occur: How can we let the scanner check if we are indeed signed in? Common practive: Looking for a /logout/i String The problem: Inefficient. Likely to cause false positives There has to be a better way: Introduction Strategies

Strategy.Authentication Step 1: Identification 27 Identifying a login form (3-way approach, input[type=password], geometry, [...])

Strategy.Authentication Step 2: Error messages (Why a browser engines rocks) 28 Verifying wrong credentials - Random strings - Failed login #BA... -> #E4...

Strategy.Authentication Step 3: Going in:.login(..,.. ) 29 Verifying valid credentials - Behaviour should not be similiar to the behaviour of a invalid login

Strategy.Authentication Step 4: Going out..logout() 30 Doing similiar work again for.logout() function seems obsolote But it really isn t. It is the basis to a.is_still_loggedin() function Which is really important to stay logged in during crawling And if the scanner logged itself out, it can simply.login() again That s cool. :-)

Exploitation and Privilege Escalation 31 There is a whole universe besides injection vulnerabilities Usually, scanners don t detect them But they should And now they can:.login( user1,... );.logout();.login( user2,... ) => Demo Time: Privilege Escalation, Multi-User Systems

Geographically distributed scanning: Using the cloud 32 When (injection) vulnerabilities are getting complicated: Scenario 1: The backend of a website creates a log entry for every new IP address. It logs the USERAGENT. The log entries are kept in a SQL database. The function that creates the log entries, is vulnerable. The User-Agent is injectable. The problem is: It only works once. As soon as the IP is in the database, the function won t be executed anymore :-( ==> SQLMap (and every other tool) will fail.

Geographically distributed scanning: Using the cloud 33 But they shouldn t! The limitation is totally detectable And a new IP is just as far away as a single EC2 API call

Geographically distributed scanning: Using the cloud 34 Indeed! The cloud is a good thing for security :) Demo Time: Introducing: sqlmap and w3af (on steroids)

Combining Strategies and the distributed scanning 35 Introducing next generation vulnerability scanning Exploiting a really amazingly hard SQL Injection Demo Time

Further Research & Additional Ideas 36 Country specific restrictions can be by-passed in a fully automatic manner (Error) messages can be parsed and interpreted: Wolfram Alpha Bloomfilters should be integrated Other Strategies should be implemented (the limitations are gone)

More Live Demos 37 Demonstrating a logical layer beyond Authentication:.pay( 0000111122223333, CVV=121, type=visa).search( search query ).sort( DESC UNION SELECT [...] ) Interpreting error messages Pivoting on penetrated hosts - Spawning another scanner instance And finally: Reporting!

Thanks! 38