PDF ATTACK. A Journey from the Exploit Kit to the Shellcode

Similar documents
RIA SECURITY TECHNOLOGY

Sandy. The Malicious Exploit Analysis. Static Analysis and Dynamic exploit analysis. Garage4Hackers

Automating Linux Malware Analysis Using Limon Sandbox Monnappa K A monnappa22@gmail.com

Advancements in Botnet Attacks and Malware Distribution

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Honeypots & Honeynets Overview. Adli Wahid Security Specialist, APNIC.net adli@apnic.net

Penetration Testing with Kali Linux

LASTLINE WHITEPAPER. Large-Scale Detection of Malicious Web Pages

Networks and Security Lab. Network Forensics

EyjafjallajöKull Framework (aka: Exploit Kits Krawler Framework)

Shane Hartman CISSP, GCIA, GREM Suncoast Security Society

DRIVE-BY DOWNLOAD WHAT IS DRIVE-BY DOWNLOAD? A Typical Attack Scenario

Intrusion detection for web applications

MALWARE ANALYSIS 1. STYX EXPLOIT PACK: INSIDIOUS DESIGN Aditya K. Sood & Richard J. Enbody Michigan State University, USA COMMUNICATION DESIGN

How to hack a website with Metasploit

Source Code Review Using Static Analysis Tools

Operation Liberpy : Keyloggers and information theft in Latin America

Cybercrime myths, challenges and how to protect our business. Vladimir Kantchev Managing Partner Service Centrix

Still Aren't Doing. Frank Kim

Criteria for web application security check. Version

EVILSEED: A Guided Approach to Finding Malicious Web Pages

Automatic vs. Manual Code Analysis

Dr. Seltsam, oder wie ich lernte, Malware zu lieben

Attacking MongoDB. Firstov Mihail

2015 TRUSTWAVE GLOBAL SECURITY REPORT

Best Practices for Deploying Behavior Monitoring and Device Control

F-Secure Internet Security 2014 Data Transfer Declaration

Malicious Network Traffic Analysis

VISA SECURITY ALERT December 2015 KUHOOK POINT OF SALE MALWARE. Summary. Distribution and Installation

EXTRA. Vulnerability scanners are indispensable both VULNERABILITY SCANNER

Optimized Mal-Ops Hack ad networks like a boss

Hardening Joomla 1. HARDENING PHP. 1.1 Installing Suhosin. 1.2 Disable Remote Includes. 1.3 Disable Unneeded Functions & Classes

HP AppPulse Mobile. Adding HP AppPulse Mobile to Your Android App

The Top Web Application Attacks: Are you vulnerable?

Prophiler: A Fast Filter for the Large-Scale Detection of Malicious Web Pages

Fighting Advanced Threats

Pwning Intranets with HTML5

Cloud Application Security Assessment, Guerrilla Style

1 Step 1: Select... Files to Encrypt 2 Step 2: Confirm... Name of Archive 3 Step 3: Define... Pass Phrase

Chapter 4 Accessing Data

CS 558 Internet Systems and Technologies

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

JW Player Quick Start Guide

Web Application Vulnerability Testing with Nessus

IBM WebSphere Application Server V8.5 lab Basic Liberty profile administration using the job manager

QualysGuard WAS. Getting Started Guide Version 3.3. March 21, 2014

Targeted attacks: Tools and techniques

Shellshock. Oz Elisyan & Maxim Zavodchik

Detecting and Exploiting XSS with Xenotix XSS Exploit Framework

Blackhole Exploit Kit: A Spam Campaign, Not a Series of Individual Spam Runs AN IN-DEPTH ANALYSIS

Comparison of Firewall, Intrusion Prevention and Antivirus Technologies

CHAD TILBURY.

Hidden Data and Metadata in Adobe PDF Files: Publication Risks and Countermeasures

IBM Endpoint Manager Version 9.1. Patch Management for Red Hat Enterprise Linux User's Guide


What do a banking Trojan, Chrome and a government mail server have in common? Analysis of a piece of Brazilian malware

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

Spam and All Things Salty: Spambot v2013

CLC Server Command Line Tools USER MANUAL

WRITING HONEYPOINT PLUGINS WITH HONEYPOINT SECURITY SERVER

Semantic based Web Application Firewall (SWAF V 1.6) Operations and User Manual. Document Version 1.0

SPAM, VIRUSES AND PHISHING, OH MY! Michael Starks, CISSP, CISA ISSA Fellow 10/08/2015

Protect Your IT Infrastructure from Zero-Day Attacks and New Vulnerabilities

EVALUATION ONLY. WA2088 WebSphere Application Server 8.5 Administration on Windows. Student Labs. Web Age Solutions Inc.

TELNET CLIENT 5.11 SSH SUPPORT

Yandex: Webmaster Tools Overview and Guidelines

Intrusion Detection in AlienVault

White Paper BMC Remedy Action Request System Security

Security Intelligence Blacklisting

IBM Protocol Analysis Module

TZWorks Windows Event Log Viewer (evtx_view) Users Guide

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

What is Web Security? Motivation

Load testing with. WAPT Cloud. Quick Start Guide

Network Monitoring using MMT:

Penetration Test JSPLC. Contact: James, APS (CCNA, CEH) mail.biz

IBM BPM V8.5 Standard Consistent Document Managment

Ruby on Rails Secure Coding Recommendations

WebSphere Application Server security auditing

Forensic analysis of a Linux web server

Monitoring System Status

MySQL Security: Best Practices

Beyond The Web Drupal Meets The Desktop (And Mobile) Justin Miller Code Sorcery Workshop, LLC

Vulnerability Assessment and Penetration Testing

RSA Security Analytics

McAfee Web Gateway 7.4.1

Enterprise Application Security Workshop Series

Streamlining Web and Security

How To Protect Your Computer From Being Hacked By A Hacker (For A Fee)

Authoring for System Center 2012 Operations Manager

AppUse - Android Pentest Platform Unified

Enterprise Incident Response: Network Intrusion Case Studies and Countermeasures

A Study on the Live Forensic Techniques for Anomaly Detection in User Terminals

Transcription:

PDF ATTACK A Journey from the Exploit Kit to the Shellcode Jose Miguel Esparza @EternalTodo

Who am I Jose Miguel Esparza Senior Cybercrime Analyst at Fox-IT InTELL Malware, Botnets, C&Cs, Exploit Kits, Security Researcher at Home ;p PDF, NFC, http://eternal-todo.com @EternalTodo on Twitter

Agenda A Journey from the Exploit Kit to the Shellcode Exploit Kits: the source of evil PDF basics Some basic peepdf commands Analyzing PDF exploits Extracting and analyzing shellcodes Obfuscation of PDF files

Requirements Linux distribution Libemu / Pylibemu V8 / PyV8 Last peepdf version Checkout from the repository or update!

Exploit Kits: the source of evil Best way to infect a computer Effective and fresh exploits IE Java PDF Flash Average of 6-7 exploits

Exploit Kits: the source of evil

Exploit Kits: the source of evil Java 7u11 Java Byte Verify Java CMM Java < 7u17

Exploit Kits: the source of evil Most used nowadays Magnitude (TopExp) Neutrino Infinity (Goon/RedKit v2) Ramayana (DotkaChef) Fiesta Styx Nuclear KahuSecurity

Exploit Kits: the source of evil Infection steps Visit injected website / Click SPAM link Redirection (maybe more than one) Obfuscated Javascript Plugin detection Trying exploits Done!

Exploit Kits: the source of evil Traffic Distribution Systems (TDS) Country specific attacks TDS + Exploit Kits = WIN!

Exploit Kits: the source of evil Analyzing exploit kits Avoiding researchers Filtering by User-Agent and/or Referer Blocking IPs One-time infections Country filters

Exploit Kits: the source of evil Analyzing obfuscated Javascript code The easy way Automatic tools Online services» Wepawet» JSUNPACK Low-interaction honeyclient» Thug You can miss some info

Exploit Kits: the source of evil Analyzing obfuscated Javascript code The traditional way Executing different stages of JS code Beautify the code Looking for the eval function» s/eval/print/ Hooking the eval function with Javascript engines Looking for exploits / shellcodes You cannot miss any detail

Exploit Kits: the source of evil Analyzing obfuscated Javascript code The traditional way Let s play ;)

PDF basics PDF format? PDF structure? Objects? Filters?

Header Body Cross reference table Trailer

PDF basics Body Sequence of objects Object types Boolean: true false Numbers: 123-98 4. -.002 123.6 Strings: (hola) <686f6c61> 68 (h) 6f (o) 6c (l) 61 (a) Names: /Type /Filter Dictionaries: << /Type /Catalog /Root 1 0 R >> Arrays: [ 1.0 (test) <</Length 273>> ] Streams

PDF basics

PDF basics Object types Indirect objects Reference: object_id generation_number R

PDF basics Object types Indirect objects Reference: object_id generation_number R

PDF basics Tree structure References Root node /Catalog If an element isn t in the downward path from the /Catalog DOES NOT EXIST

PDF basics You can use just a text editor!!

peepdf peepdf sounds like the Swiss army knife of PDF security apps http://peepdf.eternal-todo.com

peepdf Characteristics Python Command line Interactive console (colorized) Included in REMnux and BackTrack / Kali Linux http://peepdf.eternal-todo.com

peepdf http://peepdf.eternal-todo.com

peepdf Characteristics Command file option Batch / Automation XML output Easily updated from repository http://peepdf.eternal-todo.com

peepdf Why peepdf? Support for: Encryption Object Streams (compressed objects) Most used filters FlateDecode / LZWDecode Parameters Javascript Analysis Shellcode emulation

peepdf Why peepdf? Shows Suspicious Elements Shows potential Vulnerabilities Powerful Interactive Console Easy extraction of objects / JS code / shellcode PDF Obfuscation Alive project!!

peepdf Recent commits s/spidermonkey/pyv8/g

peepdf Recent commits vtcheck

peepdf Recent commits js_vars js_jjdecode

peepdf Commands Console help log open reset quit exit

Commands Showing information Whole document info tree offsets hash bytes metadata changelog save_version errors peepdf

peepdf Commands Showing information Objects object rawobject stream rawstream references hash

peepdf Commands Extracting information Output redirection is possible set» set output file path_to_my_file» set output variable myvar

peepdf Commands Extracting information Shell redirection is easier ;) Files» stream 6 > stream6_file» js_code 12 >> pdf_js_code_file Variables» js_unescape variable myvar $> unescaped_sh» rawstream 5 $>> all_my_rawstreams_var

peepdf Commands Javascript functions js_code js_eval js_analyse js_unescape js_join

peepdf Commands Shellcode emulation sctest pylibemu: libemu wrapper for Python

Commands Modification / Creation modify filters decode encode encode_strings embed encrypt malformed_output create save peepdf

peepdf Commands Misc set search show xor xor_search

Analyzing PDF exploits How to identify malicious files Suspicious elements /Action /OpenAction /AA /AcroForm /Names /JavaScript /EmbeddedFile Known vulnerabilities

Analyzing PDF exploits Most used vulnerabilities LibTiff (TIFF images) Collab.collectEmailInfo Collab.getIcon Doc.media.newPlayer

Analyzing PDF exploits How to identify malicious files Obfuscation Strange codification in objects Encryption Malformed objects Embeded PDFs Javascript

Analyzing PDF exploits How to identify malicious files Patterns One page without content Big objects Gaps between objects (offsets) Strange structure Characteristic strings Metadata Tools

Analyzing PDF exploits How to identify malicious files Malformed documents Headers Objects Tags

Analyzing real exploits Practicing all the theory Not a sample exploit, a real one Extracting the interesting parts Extracting the shellcode Analyzing the shellcode

Analyzing real exploits Playing with real exploits

Using peepdf as a library Some developments based on peepdf SWF Mastah (Brandon Dixon)

PDF obfuscation Remove characteristic strings Split up Javascript code (/Names) If the code is in: String octal encoding (\143\172) Stream filters (not usual, parameters) Compress (object streams) Encrypt (default password) Malform (endobj, header) Nest PDFs

THANKS!! Jose Miguel Esparza jesparza AT eternal-todo.com http://eternal-todo.com @EternalTodo