mitmproxy.org How MITMproxy has been slaying SSL Dragons OWASP The OWASP Foundation



Similar documents
Penetration Testing for iphone Applications Part 1

Project X Mass interception of encrypted connections

Architecture and Data Flow Overview. BlackBerry Enterprise Service Version: Quick Reference

mitmproxy docs Release 0.18

ABSTRACT' INTRODUCTION' COMMON'SECURITY'MISTAKES'' Reverse Engineering ios Applications

Bust a cap in a web app with OWASP ZAP

Pentesting Mobile Applications

Zorp and KZorp: Integrating Packet Filtering and Userspace proxying

Ethical Hacking as a Professional Penetration Testing Technique

SSL implementieren aber sicher!

Bug Report. Date: March 19, 2011 Reporter: Chris Jarabek

Configuration Guide BES12. Version 12.2

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

How To Burp David Brown

(WAPT) Web Application Penetration Testing

Configuration Guide BES12. Version 12.1

How to configure HTTPS proxying in Zorp 6

HackPra. Burp Pro: Real-life tips & tricks

Pentesting iphone Applications. Satishb3

Configuration Guide. BlackBerry Enterprise Service 12. Version 12.0

How to configure SSL proxying in Zorp 6

HTTPS HTTP. ProxySG Web Server. Client. ProxySG TechBrief Reverse Proxy with SSL. 1 Technical Brief

Migrating the SSL Offloading Configuration of the Alteon Application Switch 2424-SSL to AlteonOS version

SSL EXPLAINED SSL EXPLAINED

Hack Yourself First. Troy troyhunt.com

Lab Exercise SSL/TLS. Objective. Step 1: Open a Trace. Step 2: Inspect the Trace

How to configure SSL proxying in Zorp 3 F5

Installation and configuration guide

DEF CON 19: Getting SSLizzard. Nicholas J. Percoco Trustwave SpiderLabs Paul Kehrer Trustwave SSL

How to configure HTTPS proxying in Zorp 5

Lecture 11 Web Application Security (part 1)

Web Application Firewall

Kaspersky Fraud Prevention: a Comprehensive Protection Solution for Online and Mobile Banking

BlackBerry Enterprise Service 10. Universal Device Service Version: Administration Guide

Sophos Mobile Control Technical guide

Configuration Guide. BES12 Cloud

BlackBerry Enterprise Service 10. Version: Configuration Guide

Lab Exercise SSL/TLS. Objective. Requirements. Step 1: Capture a Trace

Security Testing for Developers using OWASP ZAP

Configuration Guide BES12. Version 12.3

Sage Accpac CRM 5.8. Self Service Guide

Security Guide. BlackBerry Enterprise Service 12. for ios, Android, and Windows Phone. Version 12.0

BlackBerry Enterprise Service 10 version 10.2 preinstallation and preupgrade checklist

Websense Web Security Gateway: What to do when a Web site does not load as expected

CA Mobile Device Management 2014 Q1 Getting Started

Internet Banking System Web Application Penetration Test Report

Sophos Mobile Control Installation guide. Product version: 3.5

Deployment Guide Microsoft IIS 7.0

Configuring Nex-Gen Web Load Balancer

SaaS-Based Employee Benefits Enrollment System

Chapter 17. Transport-Level Security

Android App for SAP Business One. Z3moB1le App Version 1.00 Pagina 1 di 12.

7.0 Self Service Guide

<Insert Picture Here> Oracle Web Cache 11g Overview

Advanced Administration for Citrix NetScaler 9.0 Platinum Edition


Installation and configuration guide

Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh

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

ULTEO OPEN VIRTUAL DESKTOP OVD WEB APPLICATION GATEWAY

Basic & Advanced Administration for Citrix NetScaler 9.2

Chapter 1 Web Application (In)security 1

Topics in Network Security

Access Gateway Guide Access Manager 4.0 SP1

Cyber Security Workshop Ethical Web Hacking

REQUIREMENTS AND INSTALLATION OF THE NEFSIS DEDICATED SERVER

Out of the Fire - Adding Layers of Protection When Deploying Oracle EBS to the Internet

Debugging Mobile Apps

Certified Selenium Professional VS-1083

ScanJour PDF 2014 R8. Configuration Guide

Endian Unified Threat Management

Network Management Card Security Implementation

Using a Malicious Proxy to Pilfer Data & Wreak Havoc. Edward J. Zaborowski ed@thezees.net

What is Web Security? Motivation

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

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

Information Technology Policy

Cisco AnyConnect Secure Mobility Solution Guide

User-ID Best Practices

HTTP. Internet Engineering. Fall Bahador Bakhshi CE & IT Department, Amirkabir University of Technology

Introduction to the AirWatch Browser Guide

New Tricks For Defeating SSL In Practice. Moxie Marlinspike

Best Practice Guide (SSL Implementation) for Mobile App Development 最 佳 行 事 指 引. Jointly published by. Publication version 1.

Pentesting iphone & ipad Apps Hack In Paris 2011 June 17

Secure Web Appliance. SSL Intercept

IONA Security Platform

Secure Web Development Teaching Modules 1. Security Testing. 1.1 Security Practices for Software Verification

Integrating the F5 BigIP with Blackboard

Using EMC Unisphere in a Web Browsing Environment: Browser and Security Settings to Improve the Experience

Workday Mobile Security FAQ

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

Firewalls. Ingress Filtering. Ingress Filtering. Network Security. Firewalls. Access lists Ingress filtering. Egress filtering NAT

Secure Web Gateway 11.5 Release Notes

Gateway Apps - Security Summary SECURITY SUMMARY

Introduction to Mobile Access Gateway Installation

Transcription:

mitmproxy.org How MITMproxy has been slaying SSL Dragons April 14 2012 Jim Cheetham University of Otago Information Security Office jim.cheetham@otago.ac.nz Copyright The University of Otago Permission is granted to copy, distribute and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 3.0 New Zealand (CC BY-SA 3.0) licence. The Foundation http://www.owasp.org

Introduction What is MITMproxy? Why is it useful? Dragon-slaying successes How does it work? How do we use it? (Demos) 2

What is MITMproxy? An SSL-capable man-in-the-middle proxy Generic pentest/debug tool Interactive, console based intercept & modify Passive like tcpdump/tshark Replay previous data Preserve cookies & authentication Extensible invoke Python modules Or system commands Programmable via libmproxy 3

Not just good looks 4

Project maturity Initial: v0.2 March 2010 Current: v0.8 9 April 2012 License: GPL v3 (+OpenSSL) Author: Aldo Cortesi Network security, penetration testing, security architecture, source audits, risk assessment, software development 5

Why is MITMproxy useful? Balance of power has shifted The browser is not the only user of HTTPS The mobile platform is not generic HTTP-using code is increasingly opaque Large JavaScript 'applications' Application Stores: Free = Ads Existing tools are inflexible Wireshark is great, but read-only Webscarab ZAP, Fiddler, Paros, Charles all GUI Writing your own site-specific tests? 6

Feature highlights Rich filtering language ~t text/html ~hs Set-Cookie Anticache, anticomp Makes sure you capture all the traffic Replay Server-side replay fixes date,expired,last-modified Nice display modes Hex, EXIF, JSON, JS 7

Dragon-slaying success Apple GameCenter Super MegaWorm highscore Game switched to OpenFeint Apple UDID OpenFeint de-anonymized https://api.openfeint.com/users/for_device.xml?udid=xxx Apple withdrew UDID Apple Contacts data path.com, Hipster Apple withdrew implicit permission 8

How does MITMproxy do its job? Standard Proxy instance A Proxy is a Man-in-the-Middle But a proxy does not usually rewrite data HTTPS = TLS + HTTP MITM = TLS Man-in-the-Middle SSL Certificates are changed But who checks the CA provenance? 9

HTTPS = TLS + HTTP Establish TLS first Then use normal HTTP in the TLS session 10

TLS Man-in-the-Middle Default: just present a fake certificate Transparent: read data from the upstream certificate, and insert into the fake 11

How do we use MITMproxy? MITMproxy is not an attack tool Explicitly configure it as a proxy Transparent proxy in v0.8 This is not ideal data is lost Import the (auto-generated) CA Root cert Or configure your own sub-ca Or just keep pressing [Accept] if you can Run as interactive console app Or standalone 'mitmdump' Or in your own Python code 12

The Android Problem Android provides no API for proxy settings Bug 1273, 2008 Android provides no root access Rooting has implications for support/warranty Transparent proxy solutions are available SNI is of course broken Intent is lost: URLs IP addresses Large sites rely heavily on SAN fields v0.8 introduces --upstream-cert 13

Demos Inspect a browser session Login to a fastmail.fm account Intercept and edit a request or response i ~u google.*/search Edit 302 Location: response header 14

Demos Run all traffic through a script nowasp.py import re def request(context, flow): if (re.search('google\.',flow.request.host) and re.search('/search',flow.request.path)): flow.request.path = re.sub('q=','q=anonymous', flow.request.path,0,re.ignorecase) $ mitmdump -s nowasp.py 15

Demos Client replay / hotspot wifi login $ mitmdump -w session.mf $ mitmproxy -r session.mf # 'd' to delete un-needed requests # 'eb' to edit a request body # 'w' to save the final flow $ mitmdump -c session.mf BUT other tools are still useful :- $ echo POST http://1.1.1.1/logout.cgi grep 'You have used' You have used 1:37 16

Demos Upside-Down-Ternet Identify data by Content-Type Images (but not CSS sprites) Pass through OS utility ('convert' from ImageMagick) Or use native Python modules (as per project docs) Text (according to BeautifulSoup) Pass through upsidedown.py Decode the page first! 17

Upside-down-ternet code dump import re import subprocess from BeautifulSoup import BeautifulSoup import upsidedown def response(ctx, flow): try: # Flip images using ImageMagick if re.match('image/',flow.response.headers["content-type"][0]): proc = subprocess.popen('/usr/bin/convert -flip - -', shell=true, stdin=subprocess.pipe, stdout=subprocess.pipe,) flow.response.content=proc.communicate(flow.response.content)[0] proc.stdin.close() # Flip text using BeautifulSoup and upsidedown if re.match('text/html',flow.response.headers["content-type"][0]): flow.response.decode() soup = BeautifulSoup(flow.response.content) for text in soup.findall(text=true): text.replacewith(upsidedown.transform(text)) flow.response.content=str(soup) except IndexError: ctx.log("no content-type[0]") 18

Resources http://mitmproxy.org/ https://github.com/cortesi/mitmproxy http://corte.si/ 19