fiddler

54
Advanced Web Debugging with Fiddler Mehdi Khalili Readify Live Backchannel: #dddbrisbane #web01

Upload: sarvesh-singh

Post on 30-Nov-2015

199 views

Category:

Documents


0 download

DESCRIPTION

fiddler

TRANSCRIPT

Page 1: Fiddler

Advanced Web Debugging with Fiddler

Mehdi KhaliliReadify

Live Backchannel: #dddbrisbane #web01

Page 2: Fiddler

Mehdi KhaliliReadify Blog: www.Mehdi-Khalili .comTwitter: @MehdiKhaliliEmail: me@mehdi-khalili .com

Advanced Web Debugging with

Fiddler

Page 3: Fiddler

Fiddler Web Debugger

Tight scheduleYour answer may be in the next slideWe will have a Q&A at the endIf we run out of time:

− Do not hesitate to shoot me an email with your questions

− You can also read an extensive two part tutorial on my blog: http://www.mehdi-khalili.com/fiddler-in-action/part-1 http://www.mehdi-khalili.com/fiddler-in-action/part-2

Please leave your questions to the end

Page 4: Fiddler

Fiddler Web Debugger

What is Fiddler and how does it work?Alternative toolsFiddler featuresFiddlerCore and FiddlerCapQuick tour of remaining featuresQ&ALots of positive feedback and tweets from you

;-)

Agenda

Page 5: Fiddler

Fiddler Web Debugger

What is Fiddler?

A Web Debugging ProxyIt is free and has millions of usersA necessary tool in a developer’s toolbox!!

Page 6: Fiddler

Fiddler Web Debugger

Fiddler features in a nutshellWith Fiddler you can perform:

• HTTP(S) traffic monitoring and Analysis• HTTP request and response modification

Page 7: Fiddler

Fiddler Web Debugger

A networking protocolIn the application layerSits on top of TCP protocol (usually)

What is HTTP again?

Page 8: Fiddler

Fiddler Web Debugger

An HTTP communication is called a sessionAn example of that is web browsing:

1. You type an address in your browser2. Your browser does a DNS lookup for the URL3. Then creates a TCP connection to the server4. And creates and sends an HTTP request 5. The server receives the request6. Processes it (and optionally maps it to a resource)7. And creates and returns an HTTP response

HTTP Session

Page 9: Fiddler

Fiddler Web Debugger

An HTTP request is composed of:− A request line− Header lines− A blank line− An optional body

GET http://www.google.com.au/ HTTP/1.1Host: www.google.com.auConnection: keep-aliveAccept: text/html,application/xhtml+xml,application/xml;Accept-Encoding: gzip,deflate,sdchAccept-Language: en-US,en;q=0.8

HTTP Request

Page 10: Fiddler

Fiddler Web Debugger

An HTTP response is composed of:− A status code− Header lines− An optional body

HTTP/1.1 200 OKDate: Tue, 22 Nov 2011 20:38:20 GMTExpires: -1Cache-Control: private, max-age=0Content-Type: text/html; charset=UTF-8Server: gwsContent-Length: 57556

HTTP Response

Page 11: Fiddler

Fiddler Web Debugger

Back to Fiddler: Where to get it from?

http://www.fiddler2.com● Application● Documentation● Fiddler extensions

Page 12: Fiddler

Fiddler Web Debugger

How does it work?

Internet Explorer

WinINET

Office

CryptoAPI WinHTTP

Fiddler

Firefox

CorpNET Proxy

example.com

Firewall

Page 13: Fiddler

FIDDLER AND WININET

Demo

Page 14: Fiddler

Fiddler Web Debugger

If you can use a proxy you can use Fiddler

Fiddler

Ma c

Web Server

Lin

ux

Mob

ile

PC

Page 15: Fiddler

Fiddler Web Debugger

What is Fiddler and how does it work?Alternative toolsFiddler featuresFiddlerCore and FiddlerCapQuick tour of remaining featuresQ&ALots of positive feedback and tweets from you

;-)

What is next?

Page 16: Fiddler

Fiddler Web Debugger

Alternatives and similar tools

Packet Analysers: − WireShark− NetMon

Proxies: − Charles − Burp Suite

Browser Dev Tools:− HttpWatch for IE and FireFox− FireBug for FireFox− Chrome developer tools and FireBug Lite for Chrome− IE Dev Tools

Page 17: Fiddler

Fiddler Web Debugger

Sniffer vs Proxy vs Browser Dev Tools

Feature Sniffer Proxy Browser ToolsHTTP only No Yes Yes

Nice visualisation

No Yes Yes

From all processes

Yes Yes Only Browser session

Local traffic No Yes Yes

Cached traffic No No Yes

Page 18: Fiddler

Fiddler Web Debugger

What is Fiddler and how does it work?Alternative toolsFiddler featuresFiddlerCore and FiddlerCapQuick tour of remaining featuresQ&ALots of positive feedback and tweets from you

;-)

What is next?

Page 19: Fiddler

Fiddler Web Debugger

HTTP(S) Traffic

Result - The Result code

Protocol - HTTP/HTTPS/FTP

Host - The hostname

URL - The path and file requested from the server

Body - The number of bytes in the response body

Caching - Response's Expires or Cache-Control

headers

Process - The local Windows Process

Content-Type - The Content-Type header

Page 20: Fiddler

HTTP TRAFFIC

Demo

Page 21: Fiddler

Fiddler Web Debugger

Traffic Comparison

Compare sessions using a diff tool

Page 22: Fiddler

TRAFFIC COMPARISON

Demo

Page 23: Fiddler

Fiddler Web Debugger

It allows you to compare two sessionsIf you want to compare two traffic profiles

then use Traffic Differ extension

Traffic Comparison

Page 24: Fiddler

Fiddler Web Debugger

Statistics

Get a "total page weight and wait"—the number of requests and the bytes transferred.

Page 25: Fiddler

STATISTICS TAB

Demo

Page 26: Fiddler

Fiddler Web Debugger

Quick Exec

Page 27: Fiddler

A FEW HANDY QUICKEXEC COMMANDS

Demo

Page 28: Fiddler

Fiddler Web Debugger

Inspectors

Inspectors allow you to visualize requests and responses in meaningful ways.

Page 29: Fiddler

INSPECTORS

Demo

Page 30: Fiddler

Fiddler Web Debugger

HTTPS Traffic Decryption

Fiddler can decrypt HTTPS traffic using the Man-In-The-Middle attack

Page 31: Fiddler

Fiddler Web Debugger

Man In The Middle Attack

HTTPS Traffic Decryption

Fiddler can decrypt HTTPS traffic using the Man-In-The-Middle attack

ClientServe

r

1

2MITM

Page 32: Fiddler

Fiddler Web Debugger

Man In The Middle Attack

HTTPS Traffic Decryption

Fiddler can decrypt HTTPS traffic using the Man-In-The-Middle attack

ClientServe

r

1

4

2

3MITM

Page 33: Fiddler

SETTING UP HTTPS DECRYPTION

Demo

Page 34: Fiddler

Fiddler Web Debugger

Changing the traffic on the fly

You can set breakpoints and change the request and/or response on the fly. Fiddler is the MITM.

Page 35: Fiddler

HOW TO SET BREAKPOINTS AND

CHANGE REQUESTS AND/OR RESPONSES

Demo

Page 36: Fiddler

Fiddler Web Debugger

Test your JavaScript code with less than perfect response

Test your website for security holesTroubleshoot your third party web clientTroubleshoot your third party web service

Changing the traffic on the fly

Page 37: Fiddler

Fiddler Web Debugger

Auto Responder

Create a fake web server using Auto Responder

Page 38: Fiddler

HOW TO SETUP AND USE AUTO RESPONDER

Demo

Page 39: Fiddler

Fiddler Web Debugger

Replace a JavaScript or css or image fileReplace an entire trafficForce a redirectionWork without a connection!

Auto Responder

Page 40: Fiddler

Fiddler Web Debugger

Request Builder

Create a fake web client using Request Builder

Avoid coding html pages or test clients. Use Request Builder instead to send a hand rolled request to your server/service

Page 41: Fiddler

HOW TO SETUP AND USE REQUEST BUILDER

Demo

Page 42: Fiddler

Fiddler Web Debugger

Filters

Filter and flag traffic and perform some lightweight modifications

Page 43: Fiddler

QUICK TOUR OF FILTERS

Demo

Page 44: Fiddler

Fiddler Web Debugger

Clean up your Web Sessions pageFilter out some status codesFilter out traffic from some urlsFlag some of the trafficVery useful on a high traffic server/machine

Filters

Page 45: Fiddler

Fiddler Web Debugger

What is Fiddler and how does it work?Alternative toolsFiddler featuresFiddlerCore and FiddlerCapQuick tour of remaining featuresQ&ALots of positive feedback and tweets from you

;-)

What is next?

Page 46: Fiddler

Fiddler Web Debugger

Fiddler Core

Fiddler 2

Fiddler ScriptEngine

Inspector2

Inspector2

IFiddlerExtension

IFiddlerExtension

FiddlerCore

Exec

Actio

n.ex

e

YourApp.exe

FiddlerCore

Fiddler application with extensions Your application hosting FiddlerCore

Your FiddlerScript

Xceed*.dll Makecert.exe Xceed*.dll Makecert.exe

Page 47: Fiddler

Fiddler Web Debugger

FiddlerCap

Built on top of FiddlerCore It is bin deployable A handy tool for production support

Page 48: Fiddler

FIDDLER CAP

Demo

Page 49: Fiddler

Fiddler Web Debugger

Quick Summary

Requirement Feature

Watch the traffic Web Sessions

Compare two sessions Web Sessions -> compare

Run commands QuickExec

Inspect requests & responses Inspectors

Fiddle with the traffic Breakpoints + Inspectors

Return an HTTP response locally Auto Responder

Make an HTTP request Request Builder

Filter and flag sessions Filters

Fiddler for end user FiddlerCap

As a quick summary here is the list of Fiddler features you are likely to use more

Page 50: Fiddler

Fiddler Web Debugger

What is Fiddler and how does it work?Alternative toolsFiddler featuresFiddlerCore and FiddlerCapQuick tour of remaining featuresQ&ALots of positive feedback and tweets from you

;-)

What is next?

Page 51: Fiddler

QUICK TOUR OF WHAT IS NOT COVERED

Demo

Page 52: Fiddler

Fiddler Web Debugger

ExtensionsSyntaxViewWcfBinaryInspectorTraffic DifferGalleryneXpert Performance Report GeneratorStresStimulus aids in load-testing

Find out more on Fiddler website

Page 53: Fiddler

Fiddler Web Debugger

What is Fiddler and how does it work?Alternative toolsFiddler featuresFiddlerCore and FiddlerCapQuick tour of remaining featuresQuick overview of useful extensionsQ&ALots of positive feedback and tweets from you

;-)

That is all from me

Page 54: Fiddler

Fiddler Web Debugger

Thanks for attending

Q&ATutorials:

− http://www.mehdi-khalili.com/fiddler-in-action/part-1− http://www.mehdi-khalili.com/fiddler-in-action/part-2

Contact Details:− Email: [email protected]− Twitter: @MehdiKhalili