ekfiddle: a framework to study exploit kits

35
EKFiddle: a framework to study Exploit Kits Jérôme Segura, @jeromesegura, Lead Malware Intelligence Analyst BSides Vancouver March 13-14 2017 2017

Upload: jerome-segura

Post on 21-Mar-2017

1.093 views

Category:

Internet


2 download

TRANSCRIPT

Page 1: EKFiddle: a framework to study Exploit Kits

EKFiddle: a framework to study Exploit Kits

Jérôme Segura, @jeromesegura, Lead Malware Intelligence Analyst

BSides Vancouver March 13-14 2017 2017

Page 2: EKFiddle: a framework to study Exploit Kits

Agenda

•Quick primer on Exploit Kits and drive-by downloads•Tools to view and capture malicious traffic•Introducing EKFiddle for the Fiddler web debugger•Researching and cataloging EKs with EKFiddle

Page 3: EKFiddle: a framework to study Exploit Kits

Exploit Kits: a quick definition

An exploit kit is a set of tools designed to facilitate the

exploitation of client-side vulnerabilities most commonly

found in browsers and their plugins in order to execute

malicious code on end users’ machines.

Page 4: EKFiddle: a framework to study Exploit Kits

Exploit Kits: basic flow

Landing page

Exploits Payload

Page 5: EKFiddle: a framework to study Exploit Kits

Exploit Kits: some names

•Angler EK (defunct)

•Nuclear Pack (defunct)

•Astrum EK

•RIG EK

•Neutrino EK

•Sundown EK

•Magnitude EK

Page 6: EKFiddle: a framework to study Exploit Kits

Drive-by campaigns: traffic to exploit kits

•Compromised websites

•EITest, Pseudo-Darkleech

•Malvertising

• [ insert various ad networks here ]

Page 7: EKFiddle: a framework to study Exploit Kits

Compromised sites and Exploit Kits

Legitimate siteGate

(optional) Exploit Kit Malware

Page 8: EKFiddle: a framework to study Exploit Kits

Malvertising and Exploit Kits

Malicious ad Exploit Kit MalwareGate

(optional)

Page 9: EKFiddle: a framework to study Exploit Kits

Tools for traffic analysis

•Full packet capture (tcpdump, WireShark, etc.)•Security Suites (Security Onion)•IDS/IPS (Suricata)•HTTP/S (Fiddler, Charles, etc.)

Page 10: EKFiddle: a framework to study Exploit Kits

What about EK traffic only?

•Full packet captures are nice but not required•Web debugger easier to inspect/replay web traffic•Personal preference?

Page 11: EKFiddle: a framework to study Exploit Kits

EKFiddle

•Based on Telerik’s Fiddler Web Debugger•Multi OS compatibility via C# CustomRules•Extends Fiddler’s ContextAction•Adds support for custom EK regexes

Page 12: EKFiddle: a framework to study Exploit Kits

The standard Fiddler UI

Page 13: EKFiddle: a framework to study Exploit Kits

Extend Fiddler’s UI with EKFiddle

Page 14: EKFiddle: a framework to study Exploit Kits

Set up EKFiddle: Install Fiddler

•Download and install the latest version of Fiddler from http://www.telerik.com/fiddler

•For Mac and Linux, you will need to set up the Mono framework firsthttp://www.telerik.com/blogs/introducing-fiddler-for-os-x-beta-1http://www.telerik.com/blogs/fiddler-for-linux-beta-is-here

Page 15: EKFiddle: a framework to study Exploit Kits

Download EKFiddle (CustomRules.cs)

•Download/clone CustomRules.cs from the GitHub pagehttps://github.com/malwareinfosec/EKFiddle

• Windows (7/10)C:\Users\[username]\Documents\Fiddler2\Scripts\

• Ubuntu/home/[username]/Fiddler2/Scripts/

• Mac/Users/[username]/Fiddler2/Scripts/

Page 16: EKFiddle: a framework to study Exploit Kits

Change the default Text Editor (optional) (Tools -> Telerik Fiddler options -> Tools)

Page 17: EKFiddle: a framework to study Exploit Kits

Change the default scripting language to C# (Windows only: Tools -> Telerik Fiddler options -> Scripting)

Page 18: EKFiddle: a framework to study Exploit Kits

Finalize EKFiddle’s installation

Page 19: EKFiddle: a framework to study Exploit Kits

Get traffic captures

•Malware Traffic Analysis (PCAPs) http://www.malware-traffic-analysis.net/

• Broad Analysis (PCAPs) http://www.broadanalysis.com/

• PacketTotal (PCAPs) https://www.packettotal.com/

•Malware Don’t Need Coffee (SAZ) http://malware.dontneedcoffee.com/

• VirusTotal (need API) https://www.virustotal.com/

Page 20: EKFiddle: a framework to study Exploit Kits

Import traffic captures

Page 21: EKFiddle: a framework to study Exploit Kits

Main features: ContextAction items

•A list of useful ‘shortcuts’•Designed to collect IOCs and artifacts•Inspect each session and create signatures

Page 22: EKFiddle: a framework to study Exploit Kits

Check Host (pDNS, Whois) on VT

Page 23: EKFiddle: a framework to study Exploit Kits

Check IP (Geo, pDNS) on VT

Page 24: EKFiddle: a framework to study Exploit Kits

Extract IOCs

Page 25: EKFiddle: a framework to study Exploit Kits

Extract artifacts

Page 26: EKFiddle: a framework to study Exploit Kits

Main features: Regular expressions

•Regex matching in 3 different ways:

•URL patterns (URLRegexes.txt)

•Source code patterns (SourceCodeRegexes.txt)

•Server Headers patterns (HeadersRegexes.txt)

Page 27: EKFiddle: a framework to study Exploit Kits

Build URL Regex (paste from clipboard)

Page 28: EKFiddle: a framework to study Exploit Kits

Build source code Regex (paste from clipboard)

Page 29: EKFiddle: a framework to study Exploit Kits

View/edit Regexes

Page 30: EKFiddle: a framework to study Exploit Kits

Save Regexes

•One signature per line: [Name of sig] TAB [regex]

Page 31: EKFiddle: a framework to study Exploit Kits

Run Regexes against traffic

Page 32: EKFiddle: a framework to study Exploit Kits

Visualize results

•Each matched session is colour coded and commented•Malware type (Landing Page, Flash Exploit, Malware Payload) is ‘guessed’ automatically

Page 33: EKFiddle: a framework to study Exploit Kits

Demo

Page 34: EKFiddle: a framework to study Exploit Kits

Recap

•EKFiddle extends the Fiddler web debugger for EK analysis•Get it here: https://github.com/malwareinfosec/EKFiddle•Questions? @jeromesegura

Page 35: EKFiddle: a framework to study Exploit Kits

Thank You!