Download - Catch Me If You Can

Transcript
Page 1: Catch Me If You Can

CATCH ME IF YOU CAN

Page 2: Catch Me If You Can

HUNTERHUNTEDand HAUNTED

Page 3: Catch Me If You Can

YOUR HUNTER TODAYMarion Marschalek

Page 4: Catch Me If You Can

ANALYST

aims to detect

MALWARE

MALWARE

aims to detect

ANALYST

Page 5: Catch Me If You Can

LEVELS of SOPHISTICATIONMass

Sophisticated Toolified

APT aAPT

EPT?

MalwareMalwareMalwareMalwareMalwareMalware

Page 6: Catch Me If You Can

while some are not all that sophisticated ....

Page 7: Catch Me If You Can

SIMULATION

DEBUGGING

VIRTUALIZATION

DISASSEMBLINGSTATIC ANALYSIS

ARTIFICIAL INTELLIGENCE

Page 8: Catch Me If You Can

SIMULATION

VIRTUALIZATION

STATIC ANALYSIS

DISASSEMBLING

DEBUGGING

ARTIFICIAL

INTELLIGENCE

Page 9: Catch Me If You Can

SIMULATION

VIRTUALIZATION

STATIC ANALYSIS

DISASSEMBLING

DEBUGGING

ARTIFICIAL

INTELLIGENCE

Page 10: Catch Me If You Can

SIMULATION

VIRTUALIZATION

STATIC ANALYSIS

DISASSEMBLING

DEBUGGING

ARTIFICIAL

INTELLIGENCE

Page 11: Catch Me If You Can

SIMULATION

VIRTUALIZATION

STATIC ANALYSIS

DISASSEMBLING

DEBUGGING

ARTIFICIAL

INTELLIGENCE

Page 12: Catch Me If You Can

SIMULATION

VIRTUALIZATION

STATIC ANALYSIS

DISASSEMBLING

DEBUGGING

ARTIFICIAL

INTELLIGENCE

...

Page 13: Catch Me If You Can

SIMULATION

VIRTUALIZATION

STATIC ANALYSIS

DISASSEMBLING

DEBUGGING

ARTIFICIAL

INTELLIGENCE

RANDOMNESS

Page 14: Catch Me If You Can

THE ANCIENT ART OF BYPASSING ANTI-ANALYSIS

Page 15: Catch Me If You Can

PEBBeingDebugged Flag: IsDebuggerPresent()

PEBNtGlobalFlag, Heap Flags

DebugPort: CheckRemoteDebuggerPresent() / NtQueryInformationProcess()

Debugger Interrupts

Timing Checks

SeDebugPrivilege

Parent Process

DebugObject: NtQueryObject()

Debugger Window

Debugger Process

Device Drivers

OllyDbg: Guard Pages

Software Breakpoint Detection

Hardware Breakpoint Detection

Patching Detection via Code Checksum Calculation

Encryption and Compression

Garbage Code and Code Permutation

Anti-Disassembly

Misdirection and Stopping Execution via Exceptions

Blocking Input

ThreadHideFromDebugger

Disabling Breakpoints

Unhandled Exception Filter

OllyDbg: OutputDebugString() Format String Bug

Process Injection

Debugger Blocker

TLS Callbacks

Stolen Bytes

API Redirection

Multi-Threaded Packers

Virtual Machines

Page 16: Catch Me If You Can

THE AWESOMENESS COMPILATIONTHE „ULTIMATE“ ANTI-DEBUGGING REFERENCE [Ferrie]http://pferrie.host22.com/papers/antidebug.pdf

THE ART OF UNPACKING [Yason]https://www.blackhat.com/presentations/bh-usa-07/Yason/Whitepaper/bh-usa-07-yason-WP.pdf

SCIENTIFIC BUT NOT ACADEMICAL OVERVIEW OF MALWARE ANTI-DEBUGGING, ANTI-DEBUGGING AND ANTI-VM TECHNIQUES [Branco, Barbosa, Neto]http://research.dissect.pe/docs/blackhat2012-paper.pdf

VIRTUAL MACHINE DETECTION ENHANCED [Rin, EP_X0FF]http://www.heise.de/security/downloads/07/1/1/8/3/5/5/9/vmde.pdf

Page 17: Catch Me If You Can

AWESOMENESS IMPLEMENTED

Page 18: Catch Me If You Can
Page 19: Catch Me If You Can
Page 20: Catch Me If You Can

UPATRESMALL | NASTY | THORNY | standardmalwareofftheshelf

PAYLOAD

PACKERPROTECTION

Page 21: Catch Me If You Can

ANTI-SIMULATION

Page 22: Catch Me If You Can

WINDOW CONFUSIONand implicit breakpoint detection

Page 23: Catch Me If You Can

*WANNABE* TIMING DEFENCE

Page 24: Catch Me If You Can

CITADEL IDA Stealth Bruteforcing

PEB!NtGlobalFlags Anti-debug r.e.d.a.c.t.e.d.

Let‘s start at the end .....

Page 25: Catch Me If You Can

. . .

Page 26: Catch Me If You Can
Page 27: Catch Me If You Can

WITH DEBUGGER

WITHOUT DEBUGGER

Page 28: Catch Me If You Can

CVE-2014-1776

.html vshow.swf

cmmon.js

Heap Preparation

Timer Registration

Eval ( something)

Prepare ROP Chain

Corrupt Memory

Fill SoundObject with Shellcode

Invoke SoundObject.toString()

Page 29: Catch Me If You Can

SNEAKY EXPLOITBEING SNEAKY

Page 30: Catch Me If You Can

...DECODING OF THE ACTUAL EXPLOIT

Page 31: Catch Me If You Can

ALMOST WONDERFUL wonderfl

Page 32: Catch Me If You Can
Page 33: Catch Me If You Can

MIUREF

Once upon a time ...

and it‘s packer

Page 34: Catch Me If You Can

Visual Basic 6.0Microsoft, 1998

Object-based / event-driven

Rapid Application Development

Replaced by VB .NET in 2002

End of support in 2008

VB6

Page 35: Catch Me If You Can

VB6 IS NOT DEAD

Page 36: Catch Me If You Can

NATIVE CODE

Page 37: Catch Me If You Can

PSEUDO CODE

Page 38: Catch Me If You Can

P-CODETRANSLATION

P-code mnemonics

interpreted

by msvbvm60.dll

handler13:ExitProcHresult...

handler14:ExitProc...

handler15:ExitProcI2...

... FC C8 13 76 ...

Page 39: Catch Me If You Can

DY

NA

MIC

A

NA

LYSIS

Page 40: Catch Me If You Can

DECOMPILATION

Page 41: Catch Me If You Can

ADVANCEDSTATIC

ANALYSIS

Page 42: Catch Me If You Can

DEBUGGING

Page 43: Catch Me If You Can

DEBUGGING

Page 44: Catch Me If You Can
Page 45: Catch Me If You Can

EVER HEARD OF.. kernel33.dll ?

Page 46: Catch Me If You Can

Dynamic API Loading

... Crap.

Page 47: Catch Me If You Can

BACK TO STEALTH MODE

Page 48: Catch Me If You Can

Ou lá lá... x86 !

POST VB6 PACKER POST C++ PACKER

Page 49: Catch Me If You Can

C++ PACKER VB6 PACKER

Page 50: Catch Me If You Can

THANK YOU!

Marion Marschalek

[email protected]@pinkflawd


Top Related