Adventures in Large Scale HTTP Header Abuse Zachary Wolff.

Slides:



Advertisements
Similar presentations
DClass and Varnish Reza Naghibi VUG 7 May 2013.
Advertisements

Compiling Web Scripts for Apache Jacob Matthews Luke Hoban Robby Findler Rice University.
Automating Bespoke Attack Ruei-Jiun Chapter 13. Outline Uses of bespoke automation ◦ Enumerating identifiers ◦ Harvesting data ◦ Web application fuzzing.
Servlets and a little bit of Web Services Russell Beale.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
Input Validation For Free Text Fields ADD Project Members: Hagar Offer & Ran Mor Academic Advisor: Dr Gera Weiss Technical Advisors: Raffi Lipkin & Nadav.
By Morris Wright, Ryan Caplet, Bryan Chapman. Overview  Crawler-Based Search Engine (A script/bot that searches the web in a methodical, automated manner)
Crawler-Based Search Engine By Ryan Caplet, Morris Wright and Bryan Chapman.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Crawler-Based Search Engine By: Bryan Chapman, Ryan Caplet, Morris Wright.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
WEB SECURITY WORKSHOP TEXSAW 2013 Presented by Joshua Hammond Prepared by Scott Hand.
Presenter Deddie Tjahjono.  Introduction  Website Application Layer  Why Web Application Security  Web Apps Security Scanner  About  Feature  How.
Nikto LUCA ALEXANDRA ADELA. Nikto  Web server assessment tool  Written by Chris Solo and David Lodge  Released on December 27, 2001  Stable release:
W3af LUCA ALEXANDRA ADELA – MISS 1. w3af  Web Application Attack and Audit Framework  Secures web applications by finding and exploiting web application.
Secure Software Engineering: Input Vulnerabilities
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
PHP Security.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
HTTP and Server Security James Walden Northern Kentucky University.
Brad Baker CS526 May 7 th, /7/ Project goals 2. Test Environment 3. The Problem 4. Some Solutions 5. ModSecurity Overview 6. ModSecurity.
Cookies Set a cookie – setcookie() Extract data from a cookie - $_COOKIE Augment user authentication script with a cookie.
Dynamic Web Pages (Flash, JavaScript)
Server-side Scripting Powering the webs favourite services.
Introduction to InfoSec – Recitation 7 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
Guidelines for Homework 6. Getting Started Homework 6 requires that you complete Homework 5. –All of HW5 must run on the GridFarm. –HW6 may run elsewhere.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
CGI Security COEN 351. CGI Security Security holes are exploited by user input. We need to check user input against Buffer overflows etc. that cause a.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Prof Frankl, Spring 2008CS Polytechnic University 1 Overview of Web database applications with PHP.
Beyond negative security Signatures are not always enough Or Katz Trustwave ot.com/
CS 4720 Dynamic Web Applications CS 4720 – Web & Mobile Systems.
nd Joint Workshop between Security Research Labs in JAPAN and KOREA Marking Scheme for Semantic- aware Web Application Security HPC.
Building Secure Web Applications With ASP.Net MVC.
Finding Security Vulnerabilities in Java Applications with Static Analysis Reviewed by Roy Ford.
Cookies and Sessions IDIA 618 Fall 2014 Bridget M. Blodgett.
PwC New Technologies New Risks. PricewaterhouseCoopers Technology and Security Evolution Mainframe Technology –Single host –Limited Trusted users Security.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
PHP Error Handling & Reporting. Error Handling Never allow a default error message or error number returned by the mysql_error() and mysql_errno() functions.
WebWatcher A Lightweight Tool for Analyzing Web Server Logs Hervé DEBAR IBM Zurich Research Laboratory Global Security Analysis Laboratory
PHP Security Ryan Dunn Jason Pack. Outline PHP Overview PHP Overview Common Security Issues Common Security Issues Advanced Security Issues Advanced Security.
Review Please turn in your homework and practicals Packages, installation, rpm command Apache – Quick and easy way to set up a web server to play around.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
LOGIN FORMS.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
Data mining in web applications
BUILD SECURE PRODUCTS AND SERVICES
Group 18: Chris Hood Brett Poche
API Security Auditing Be Aware,Be Safe
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
Marking Scheme for Semantic-aware Web Application Security
PHP / MySQL Introduction
Web Browser server client 3-Tier Architecture Apache web server PHP
Lecture 2 - SQL Injection
Architecture of the web
Exploring DOM-Based Cross Site Attacks
Web Application Development Using PHP
Presentation transcript:

Adventures in Large Scale HTTP Header Abuse Zachary Wolff

About Me SIEM Deployments, Research Engineer for LogRhythm (Labs) | 2+ years Threat Research Analyst for Webroot Software | 2+ years

Lets Talk About HTTP Headers Browser Web Server

Standard Fields for Request & Response defined in RFC (RTFRFC) GET / HTTP/1.0 is a legitimate request but may not return expected results RFC sets no limits on size of header, field name, value or number of headers Most webservers now impose their own limits : HTTP Headers Basics IIS v4 – 2MB v5 – 128K-16KB* V6 – 16 KB* V7 – 16 KB* Apache v2.3 – 8KB* *Per Header Field

Existing/Past HTTP Header Attacks

The Premise I want to break some logging applications!

par exemple, to begin

Round 1: Begin Original Premise: GET Request returns 302, 200, (valid response) then send a second GET with a malicious User Agent string* to see if we can get 500 response 1.Crawler to collect URL’s 2.Python script to send attack/test UA String 3.Store results in SQLite3 DB 4.Profit!

Round 1: Results Data set: 400K URL’s Lots of 500’s! Lots of smaller, low traffic site, some bigger high traffic sites Various different errors….

Round 1: Results Custom 500’s…

Regular expression parsing errors….

le yawn.. Non verbose IIS Errors…

Not as boring, generic apache 500 and the x.x.gov sites….?

Round 1: Conclusion What did we find? Some SQL injectable 500’s Possible application level DOS Lots of websites are not expecting malicious Header requests… Further exploration is warranted

the Question How extensive is the problem of improper HTTP header handling?

Round 2: Begin 1.Need a more effective way to identify vulnerabilities 2.Lets attack/audit more than just User-Agent Header 3.Expand beyond backtick, additional attack strings 4.Larger sample set, 1.6 Million URL’s 5.Must be able to store and access very large set of result data efficiently (Shodan is amazing)

Round 2: Vulnerability Identification 500’s are ok, but much to broad What is a good indication of a possible SQLi vulnerability? Run regular Expression against HTML.data response to match on, “you have an error in your sql syntax”

Round 2: Vulnerability Identification Improved error detection, basic SQLi & beyond *Thanks for contributing to regEx list

Beyond RegEx based Error Detection Byte Anomaly Detection Added (--bad) Compare content-length of response data from original/clean GET to data from malicious GET. * Set margin of alert to 150 bytes above and 150 bytes below clean request, log results (including HTML response data) to file

Round 2: Additional Header Fields Let’s test: Host, From*, X-Forwarded-For, Referer, User-Agent, Non existent Header Smart Mode (-s) : Will look at all Header fields returned by the server and test those (minus whitelist of rarely dynamic Headers) Cookies!

Cookie Support Cookie Support added. Server Sends us this: PyLobster Responds with this: And the server says?

Round 3: Updates Updated Testing Values: “,;,%00, %00’

Round 2: Design “I Improved the crawler to harvest 500K+ URL’s a day. You should put my picture in your whitepaper” Output additions (beyond SQLite): Elasticsearch Indexing support added (fast, efficient, JSON to webinterface) Flat File logging Mark Vankempen, LogRhythm Labs

More Improvments Added Footprint mode (-g) 1.Generate random(ish) Hash or value 2.Save to key.txt file in same directory as pylobster.py 3.Activate Footprint mode:./pylobster.py –g pyLobster will now send your unique string/hash as a request like so: Then, Wait for it… Days, Weeks, Months Google/Bing/duckduckgo your hash/string to discover unprotected Log directories ;)

pyLobsters maiden voyage Ready Begin! pyLobster is currently a single threaded tool so I divided my 1.6 Million URL’s into 78 unique lists and spawned 78 instances #!/bin/bash nohup python pyLobster.py -f a --bad -s -l -g & nohup python pyLobster.py -f b --bad -s -l -g & nohup python pyLobster.py -f c --bad -s -l -g & nohup python pyLobster.py -f d --bad -s -l -g & And so on……

PyLobster’s Maiden Voyage Results Sending a null byte in your HTTP Headers will catch a fair bit of IDS attention ;) Grep response HTML on regEx error match directory to find patterns & specific components/module/application/CMS vulnerabilities. (highest value finding: one vulnerable component can lead to many others, shared DB’s as well) Various vulnerable components identified

Findings: Breakdown by RegEx # * Out of 1.6 Million Unique URL’s, 14,500 Error RegEx’s Matched! *0,1 & 2 are MySQL errors, 18 & 19 are PHP

Findings: Error Breakdown by Test String Of the 14,500 Error RegEx’s Matched

Findings: Error breakdown by HTTP Header *Cookies: 1584

Findings: error #0, breakdown by header field Error #0: “you have an error in you SQL syntax"

Findings: Footprint Mode Footprint Mode 12/13/2012  02/25/2013 

Foot Print Mode 3/27/2013 

Findings: (--bad) Byte Anomaly Detection Results Work to be done…. grep over dir for [wordpress|joomla|error|pass.*=|cms|.*?|] Sort response files by size for like errors Sort by status code response & file size

Defending Against HTTP Header Attacks Raise developer awareness that any dynamically handled Header values need to be seen as user input and processed accordingly Audit your sites HTTP Header Processing (pyLobster on github, SQLmap now supports custom Header testing too. bingo!) Proactively review/monitor your web logs

This: Creates this Log trail:

The End Thank