+ All Categories
Home > Documents > Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Date post: 24-Dec-2015
Category:
Upload: randell-bradley
View: 218 times
Download: 0 times
Share this document with a friend
Popular Tags:
71
CODE CAMP 2013 SPONSORS Gold Silv er Bronze NEXT TALK: DEBUGGING WITH FIDDLER
Transcript
Page 1: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

CODE CAMP 2013 SPONSORS

Gold

Silver Bronze

NEXT TALK: DEBUGGING WITH FIDDLER

Page 2: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

DEBUGGING WITH

FIDDLEREric Lawrence

@ericlaw

Follow along at http://getfiddler.com

Page 3: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Origins

Page 4: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Once upon a time…

Page 5: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Oh no! What happened?!?

Page 6: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

There must be a better way…

Page 7: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

A simple idea takes shape…

ApplicationsNetwork

APIsProxy Website

All problems in computer science can be solved by another level of indirection - David Wheeler

Page 8: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Fiddler: Evolution

Ten years,

~30k lines of C#,

120+ release builds,

a cross-country move to Telerik,

and two new supported Platforms later…

Page 9: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

My current side-project

Page 10: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

New Website New Documentation New Platforms Enhanced User-Interface

Roadmap

Page 11: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Fiddler Today

A quick tour of Fiddler

Demo

Page 12: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

UI Evolution - Web Sessions list

Page 13: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Fiddler on Linux

Linux Mint & Ubuntu

Page 14: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Fiddler on Mac OSX

It works, but due to UI glitches, you’re usually better off using Parallels

Page 15: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Browsers, applications, and devices

Traffic Monitoring

Page 16: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Typical Architecture

Page 17: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Debugging Across Devices

Fiddler

Mac

Internet

iOS

Pho

nes

PC

Tabl

ets

Page 18: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Fiddler as a Reverse Proxy

http://fiddler2.com/r/?reverseproxy

Page 19: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Firefox Configuration

Use the FiddlerHook add-on or configure Tools > Options > Advanced > Network > Connection Settings > Use system proxy settings

Page 20: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Win 8 “Store Apps” & IE11AppContainer blocks “loopback” network connections. For debugging purposes, you can disable that blocking.

Ctrl+Click to exempt all AppContainers

Page 21: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

.NET Applications

YourApp.exe.config

<configuration>  <system.net>    <defaultProxy>      <proxy bypassonlocal="false" usesystemdefault=“false" proxyaddress= "http://127.0.0.1:8888" />    </defaultProxy>  </system.net></configuration>

Page 22: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Protocols

Page 23: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

HTTPS Traffic DecryptionProxies cannot normally “see” HTTPS requests

Decrypting CONNECT tunnel to www.fiddler2.com

GET /fiddler2/

GET /Fiddler2/Fiddler.css

GET /Fiddler/images/FiddlerLogo.png

Page 24: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

HTTPS Traffic DecryptionFiddler dynamically generates interception certificates chained to a self-signed root.

Page 25: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

HTML5 WebSockets

Page 26: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

HTML5 WebSockets

WebSockets enable bi-directional socket

communications over a connection established using HTTP or HTTPS

Page 27: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

FTP

Fiddler supports FTP traffic via a built-in FTP gateway. FTP proxy is off-by-default.

Fiddler recognizes and tags SPDY connections if HTTPS-decryption is disabled.

SPDY/HTTP2.0

Page 28: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Protocol Violation

prefs set fiddler.lint.HTTP True

Page 29: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Traffic Archiving

Page 30: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Fiddler has many output options

Copy sessions to the clipboard Store as a plaintext file Extract binary response bodies Archive to a database Export a Visual Studio .WebTest file Build a HTML5 AppCache Manifest Build a WCAT load-test script

Page 31: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

…or write your own

Page 32: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

The SAZ file format

Session Archive Zip files contain:

Request and response bytes Timing and other metadata HTML index file

For security, SAZ files may be encrypted

Page 33: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

FiddlerCap – Lightweight capture tool

http://www.fiddlercap.com

User-interface localized to:

English | Français | Español | Português | 日本語 | русский

Page 34: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Examine Requests and Responses

Traffic Analysis

Page 35: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

TextWizardConvert text between popular web encodings.

Page 36: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Traffic Comparison

Use WinDiff or the differ of your choice to

compare Sessions’ requests and responses.

Page 37: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Traffic Comparison

Use the Differ Extension to compare sets of sessions at once.

Page 38: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Filtering Traffic

Ignore Images & CONNECTs Application Type Filter Process Filter Troubleshooting with Help menu

Selecting Traffic> Using QuickExec> Using Find

Page 39: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Regular Expression Support

Page 40: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

SyntaxView Reformatting

Page 41: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

ImageView DataURL Support

Page 42: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

ImageView Tools integration

Page 43: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

ImageView Metadata & GeoLocation

Page 44: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Better Together: X-Download-Initiator

https://fiddler2.com/dl/EnableDownloadInitiator.regcols add @request.X-Download-Initiator

Page 45: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

HTML5 Media & Font previews

Page 46: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Fiddler vs. other tools

In Context

Page 47: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Internet Explorer F12 Developer tools

Internet Explorer 9 introduced the F12 Developer Tools, including a new Network tab…

Page 48: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

F12 Developer Tools vs. Fiddler

F12 Network Tab Fiddler

Display cache and network requests

Display and modify only network requests

Shows downloads from current process

Shows traffic from all processes

Shows post-decryption HTTPS traffic

Decrypts HTTPS traffic via “man-in-the-middle” approach

Excellent JavaScript Formatter

Less explicit mixed-content detection

Exports F12 NetworkData.xml Imports F12 NetworkData.xml

Page 49: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Scenario

Change the bytes

Traffic Manipulation

Page 50: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Automated Rewrites

Simple built-in Rules The HOSTS command

Page 51: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Breakpoint Debugging

Use Fiddler Inspectors to modify

requests and responses….

Page 52: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Simple Filters

Flag, modify or remove headers from all requests and responses.

Page 53: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Request Composer

Create hand-built HTTP requests, or modify and reissue a request previously captured.

Supports• Automatic

authentication• File Uploads• Redirect

chasing• Sequential

URL Crawling

Page 54: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

AutoResponder

Replay previously-captured or generated

traffic.

Page 55: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

FiddlerScript

Page 56: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

FiddlerScript – Request Modification

static function OnBeforeRequest(oS: Session){

if (oS.uriContains(".aspx")) { oS["ui-color"] = "red";}

if (m_DisableCaching){ oS.oRequest.headers.Remove("If-None-Match"); oS.oRequest.headers.Remove("If-Modified-Since"); oS.oRequest["Pragma"] = "no-cache"; }}

Page 57: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

FiddlerScript – Response Modification

static function OnBeforeResponse(oS: Session) {

oS.utilDecodeResponse(); oS.utilPrependToResponseBody("Injected Content!");

}

Page 58: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Powering up with

//fiddler2.com/add-ons

Extensions

Page 59: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Understanding ExtensibilityEach component in red is your code…

Fiddler.exe

Fiddler ScriptEngine

Inspector2

Inspector2

IFiddlerExtension

IFiddlerExtension

FiddlerCore

Exe

cAct

ion.

exe

Your FiddlerScript

Xceed*.dll Makecert.exe

Scr

ipt

/ B

atch

file

Page 60: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Understanding UI Extensibility

1. RulesOptions2. ToolsActions3. Custom menus4. Custom columns5. ContextActions6. QuickExec handlers7. Views8. Request Inspectors9. Response Inspectors10.Import & Export Transcoders

Page 61: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Type-specific Inspectors

Page 62: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Expert Perf Analysis with neXpert

Page 63: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

intruder21 Web Fuzzer

By yamagata21

Page 64: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Watcher & x5s Security Auditors

http://websecuritytool.codeplex.com/ http://xss.codeplex.com/

Page 65: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

WCF Binary Inspector

Page 66: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Integrating Fiddler into your tools

Test Integration

Page 67: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

ExecAction.exe

Calls into OnExecAction in script or extensions

Alternatively, invoke directly by sending a Windows Message:oCDS.dwData = 61181; // Magic CookieoCDS.cbData = lstrlen(wzData * sizeof(WCHAR));oCDS.lpData = wzData;

SendMessage( FindWindow(NULL, "Fiddler - HTTP Debugging

Proxy"),WM_COPYDATA,NULL,(LPARAM) &oCDS);

Page 68: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Fiddler.exe

Fiddler ScriptEngine

Inspector2

Inspector2

IFiddlerExtension

IFiddlerExtension

FiddlerCore

Exe

cAct

ion.

exe

YourApp.exe

FiddlerCore

Fiddler application with extensions

Your application hosting FiddlerCore

Your FiddlerScript

Xceed*.dll Makecert.exe CertMaker.dllDotNetZip

Page 69: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Programming with FiddlerCore

// Call Startup to tell FiddlerCore to begin // listening on the specified port, register as // the system proxy and decrypt HTTPS traffic.Fiddler.FiddlerApplication.Startup(8877, true, true);

Fiddler.FiddlerApplication.BeforeResponse += delegate(Fiddler.Session oS) { Console.WriteLine("{0}:HTTP {1} for {2}", oS.id, oS.responseCode, oS.fullUrl); }; // Call Shutdown to tell FiddlerCore to stop// listening and unregister as the system proxyFiddler.FiddlerApplication.Shutdown();

Page 70: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

Fiddler Futures

Enhanced WebSockets Support .NET 4.5.1 SPDY/HTTP2 You tell me!

Page 71: Gold Silver Bronze. Eric Lawrence @ericlaw Follow along at .

@ericlaw #fiddler2//fiddler2.com//fiddlerbook.com

Thank you!

~300 pages. Paper or DRM-free PDF.

Now Available


Recommended