The Future of RE: Dynamic Binary Visualization

Slides:



Advertisements
Similar presentations
ByteWeight: Learning to Recognize Functions in Binary Code
Advertisements

Cs3102: Theory of Computation Class 21: Undecidability in Theory and Practice Spring 2010 University of Virginia David Evans Exam 2: Out at end of class.
AES Sub-Key Generation By Muhammad Naseem. Rotate Word 09CF4F3C.
Introduction to Machine/Assembler Language Noah Mendelsohn Tufts University Web:
© 2006 Nathan RosenblumMarch 2006Unconventional Code Constructs The New Dyninst Code Parser: Binary Code Isn't as Simple as it Used to Be Nathan Rosenblum.
Machine/Assembler Language Putting It All Together Noah Mendelsohn Tufts University Web:
COMP 2003: Assembly Language and Digital Logic
Introduction to Computer Engineering by Richard E. Haskell Multiplication and Division Instructions Module M16.4 Section 10.4.
Formal Verification of Hardware Support For Advanced Encryption Standard Anna Slobodová Centaur Technology This work was done while at Intel.
Reversing Microsoft Patches to reveal Vulnerable code Harsimran Walia
Assembly 02. Outline mov Command Registers Memory EFLAGS Arithmetic 1.
Visual Reverse Engineering
© 2007 Aladdin Knowledge Systems Ltd. All rights reserved. Aladdin, Aladdin Knowledge Systems, the Aladdin Knowledge Systems logo, HASP, HASP SRM, HASP.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
Chapter 4 Basic Instructions. 4.1 Copying Data mov Instructions mov (“move”) instructions are really copy instructions, like simple assignment statements.
Recitation: Bomb Lab June 5, 2015 Dipayan Bhattacharya.
Computer Viruses Preetha Annamalai Niranjan Potnis.
Chapter 3 Examining Computer Memory and Executing Instructions.
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 2 Instruction Addressing and Execution. Lesson plan Review some concepts in the first week First assembly program with EMU8086 Related concepts.
Executable Unpacking using Dynamic Binary Instrumentation Shubham Bansal (iN3O) Feb 2015 UndoPack 1.
Introduction to Information Security מרצים : Dr. Eran Tromer: Prof. Avishai Wool: מתרגלים : Itamar Gilad
AES (Advanced Encryption Standard) By- Sharmistha Roy M.Tech, CSE 1 st semester NIT, Agartala.
CS555Spring 2012/Topic 101 Cryptography CS 555 Topic 10: Block Cipher Security & AES.
Carnegie Mellon Recitation: Bomb Lab 21 Sep 2015 Monil Shah, Shelton D’Souza.
Computing the chromatic number for block intersection graphs of Latin squares Ed Sykes CS 721 project McMaster University, December 2004 Slide 1.
RIVERSIDE RESEARCH INSTITUTE Deobfuscator: An Automated Approach to the Identification and Removal of Code Obfuscation Eric Laspe, Reverse Engineer Jason.
Chapter 11 – Counting Methods Intro to Counting Methods Section 11.1: Counting by Systematic Listing.
Cryptography Lecture 17: Advanced Encryption Standard (AES) Piotr Faliszewski.
1 Logic, Shift, and Rotate Instructions Read Sections 6.2, 7.2 and 7.3 of textbook.
Assembly and Bomb Lab : Introduction to Computer Systems Recitation 4: Monday, Sept. 16, 2013 Marjorie Carlson Section A.
AMD64/EM64T – Dyninst & ParadynMarch 17, 2005 The AMD64/EM64T Port of Dyninst and Paradyn Greg Quinn Ray Chen
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
AES Encryption FIPS 197, November 26, Bit Block Encryption Key Lengths 128, 192, 256 Number of Rounds Key Length Rounds Block.
Introduction to Information Security מרצים : Dr. Eran Tromer: Prof. Avishai Wool: מתרגלים : Itamar Gilad
ECE Prof. John A. Copeland fax Office: GCATT Bldg.
COMP1070/2002/lec1/H.Melikian COMP1070 Lecture #2 Computers and Computer Languages Some terminology What is Software? Operating Systems.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Information Security - 2. CISC Vs RISC X86 is CISC while ARM is RISC CISC is Compiler’s heaven while RISC is Architecture’s heaven Orthogonal ISA in RISC.
Paradyn Project Paradyn / Dyninst Week Madison, Wisconsin April 12-14, 2010 Paradyn Project Safe and Efficient Instrumentation Andrew Bernat.
CSE 351 Caches. Before we start… A lot of people confused lea and mov on the midterm Totally understandable, but it’s important to make the distinction.
VideoGameAudio.com info {at} VideoGameAudio.com SIAT – Simon Fraser University Surrey, BC 1 Video Game Audio Leonard J. Paul VideoGameAudio.c om.
Instruction Set Architecture
Sequential Pattern Mining
Static and dynamic analysis of binaries
Credits and Disclaimers
or call for office visit, or call Kathy Cheek,
Assembly IA-32.
Combinations COURSE 3 LESSON 11-3
The Advanced Encryption Standard: Rijndael
Introduction to Assembly Language
Binary – Octal - Hexadecimal
Make an Organized List and Simulate a Problem
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
DEBUG.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Shift & Rotate Instructions)
Rotors and Secret-Key Encryption
Data Warehousing Mining & BI
Shift & Rotate Instructions)
Shift, Multiply, and Divide
A Series of Slides in 5 Parts Movement 2. BFS
Get To Know Your Compiler
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Credits and Disclaimers
Secure Execution: IoT Devices Workshop on IoT Security 11th Sept 2018
A Series of Slides in 5 Parts Movement 3. IDFS
Computer Architecture and System Programming Laboratory
Computer Architecture and System Programming Laboratory
Presentation transcript:

The Future of RE: Dynamic Binary Visualization { christopher.domas // REcon 2013 // 22.06.2013

Myself Myself Battelle Chris Domas Embedded Systems Engineer Cyber Innovation Unit National Security Division The Battelle Memorial Institute Battelle World’s largest non-profit R&D organization Manages leading national laboratories Awesome Including Brookhaven National Laboratory Idaho National Laboratory Oak Ridge National Laboratory Pacific Northwest National Laboratory Lawrence Livermore National Laboratory Myself

Information Analysis Reverse Engineering

In other words What IS this? 48 3B C3 74 2A 4C 89 6C 24 20 45 33 C9 45 33 C0 41 8D 51 04 FF 15 F6 80 00 00 48 8B F0 48 89 44 24 68 48 8B 4C 24 58 FF 15 EB 81 00 00 EB 00 48 8B 0D 82 C0 00 00 FF 15 DC 81 00 00 49 83 CB FF 4C 89 1D 71 C0 00 00 48 3B F3 0F 84 A7 30 00 00 48 8B C6 48 89 44 24 40 45 3B E3 0F 85 D5 31 00 00 0F B7 0E BA EF BB 00 00 3B CA 0F 84 D0 30 00 00 81 F9 FF FE 00 00 0F 85 96 30 00 00 41 BF 01 00 00 00 44 89 7C 24 48 45 8B E7 44 89 7C 24 34 49 8B C5 48 D1 E8 48 FF C8 8B F8 89 44 24 30 48 8B 44 24 40 EB 00 44 3B FB 0F 84 98 32 00 00 45 33 C9 45 33 C0 45 8D 71 0B 41 8B D6 48 8B 0D DD BF 00 00 FF 15 AF 84 00 00 45 33 C9 45 33 C0 BA B1 00 00 00 48 8B 0D C5 BF 00 00 FF 15 97 84 00 00 45 33 C9 45 33 C0 BA B7 00 00 00 48 8B 0D AD BF 00 00 FF 15 7F 84 00 00 8D 57 01 48 03 D2 45 8D 46 F7 48 8B 0D DE BF 00 00 FF 15 F0 7F 00 00 48 89 84 24 90 00 00 00 48 3B C3 0F 84 47 32 00 00 48 8B C8 FF 15 56 80 00 00 4C 8B F0 48 89 84 24 80 00 00 00 44 3B FB 0F 84 BD 33 00 00 B8 FF FE 00 00 66 39 06 0F 85 37 33 00 00 44 8B C7 4D 03 C0 48 8D 56 02 49 8B CE E8 4E F3 FF FF EB 00 44 89 25 21 BF 00 00 4C 8B 64 24 78 EB 00 48 8D 44 24 50 48 3B F0 74 09 48 8B CE FF 15 77 7F 00 00 4C 3B F3 0F 84 17 34 00 00 49 8B C6 3B FB 76 22 8B CF 90 90 90 90 90 90 90 90 90 90 90 90 90 66 39 18 0F 84 BD 33 00 00 48 83 C0 02 48 83 E9 01 75 ED 8B C7 66 41 89 1C 46 66 41 83 3E 2E 0F 84 AE 33 00 00 8B F3 EB 00 4C 8B AC 24 90 00 00 00 49 8B CD FF 15 9E 7F 00 00 4C 89 2D 07 BF 00 00 B9 04 01 00 00 48 8D 15 53 C9 00 00 4D 8B C4 4C 2B C2 48 8D 81 FA FE FF 7F 48 3B C3 74 17 41 0F B7 04 10 66 3B C3 74 0D 66 89 02 48 83 C2 02 48 83 E9 01 75 DD 48 3B CB 0F 84 8B 33 00 00 66 89 1A 49 8B CC E8 6E EC FF FF 89 1D E0 BD 00 00 C7 05 0A BE 00 00 01 00 00 00 45 33 C9 4C 8B 05 A4 BE 00 00 BA BC 00 00 00 48 8B 0D 50 BE 00 00 FF 15 22 83 00 00 83 3D E7 BD 00 00 02 0F 84 50 33 00 00 89 1D DB BD 00 00 45 33 C9 45 33 C0 BA C5 00 00 00 48 8B 0D 25 BE 00 00 FF 15 E7 82 00 00 3B F3 0F 85 88 33 00 00 45 33 C9 BA 15 01 00 00 44 8D 42 A9 48 8B 0D 04 BE 00 00 FF 15 D6 82 00 00 4C 8B C0 BA 01 00 00 00 44 8B CA 48 8B 0D DC BD 00 00 FF 15 16 81 00 00 45 33 C9 41 8D 51 0B 45 8D 41 01 48 8B 0D D4 BD 00 00 FF 15 A6 82 00 00 33 D2 44 8D 42 01 48 8B 0D C1 BD 00 00 FF 15 F3 80 00 00 48 8B 0D B4 BD 00 00 FF 15 EE 80 00 00 48 8B 0D E7 BD 00 00 FF 15 01 82 00 00 B8 01 00 00 00 EB 00 48 8B 8C 24 10 03 00 00 48 33 CC E8 EA CE FF FF 4C 8D 9C 24 20 03 00 00 49 8B 5B 38 49 8B 73 40 49 8B E3 41 5F 41 5E 41 5D 41 5C 5F C3 48 8D 54 24 50 48 8B CF FF 15 5F 7E 00 00 41 B8 04 01 00 00 48 8D 94 24 A0 03 00 00 48 8B D8 48 83 F8 FF 0F 84 D4 12 00 00 48 8D 4C 24 7C FF 15 11 83 00 00 48 8B CB FF 15 20 7E 00 00 E9 D1 EB FF FF 48 8B D6 48 8D 35 C1 C7 00 00 44 8B C3 48 8B CE E8 66 00 00 00 41 BD 80 00 00 00 48 89 7C 24 30 45 8D 65 83 45 33 C9 BA 00 00 00 80 48 8B CE 45 8B C4 44 89 6C 24 28 44 89 64 24 20 FF 15 89 7E 00 00 48 89 05 FA BC 00 00 48 83 F8 FF 0F 84 F0 18 00 00 8B 15 6E BC 00 00 48 8B CE E8 3A FB FF FF 90 E9 D7 E8 FF FF 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 48 89 5C 24 08 48 89 6C 24 18 57 48 81 EC 90 04 00 00 48 8B 05 6F BC 00 00 48 33 C4 48 89 84 24 80 04 00 00 44 0F B7 02 33 FF 48 8B DA 48 8B EA 66 41 83 F8 22 0F 84 72 13 00 00 66 41 83 F8 27 0F 84 67 13 00 00 48 8B CB FF 15 F9 82 00 00 3B C7 48 8D 3D F8 C6 00 00 0F 85 A2 13 00 00 45 33 C9 4C 8B C7 BA 04 01 00 00 48 8B CB FF 15 06 7D 00 00 48 8D 54 24 20 48 8B CF FF 15 30 7D 00 00 48 83 F8 FF 0F 84 8B 13 00 00 48 8B C8 FF 15 0D 7D 00 00 48 8B C5 48 8B 8C 24 80 04 00 00 48 33 CC E8 6A CD FF FF 4C 8D 9C 24 90 04 00 00 49 8B 5B 10 49 8B 6B 20 49 8B E3 5F C3 39 1D 5F BB 00 00 4C 8D 2D 88 C6 00 00 44 89 3D 8D BB 00 00 49 8B CD 48 0F 45 0D 66 BE 00 00 E8 1D 00 00 00 89 1D 77 BB 00 00 8B E8 83 F8 06 0F 85 C3 D2 FF FF E9 1F 0C 00 00 90 90 90 90 90 90 90 48 89 5C 24 10 48 89 74 24 18 57 48 81 EC E0 08 00 00 48 8B 05 73 BB 00 00 48 33 C4 48 89 84 24 D0 08 00 00 48 8B F9 48 8D 4C 24 34 33 D2 41 B8 9C 00 00 00 E8 03 CD FF FF 48 8B 05 64 BB 00 00 48 8B 0D 9D BB 00 00 48 89 44 24 34 48 8D 05 01 89 00 00 4C 8D 84 24 D0 00 00 00 41 B9 00 04 00 00 BA B9 0B 00 00 C7 44 24 30 A0 00 00 00 48 89 44 24 70 48 89 4C 24 3C C7 44 24 48 08 00 00 00 48 C7 44 24 4C B8 0B 00 00 C7 44 24 6C 02 00 00 00 FF 15 6D 7F 00 00 85 C0 0F 84 6F 0B 00 00 48 85 FF 0F 84 5F 0B 00 00 48 8B CF FF 15 43 7C 00 00 8B D8 EB 00 48 8D 8C 24 D0 00 00 00 FF 15 31 7C 00 00 B9 40 00 00 00 8D 74 18 01 48 63 D6 48 03 D2 FF 15 3C 7C 00 00 48 8B D8 48 85 C0 0F 84 2A 0B 00 00 48 8D 8C 24 D0 00 00 00 44 8B CE 4C 8B C0 48 8B D7 E8 EE 00 00 00 48 8D 54 24 20 48 8D 4C 24 30 45 33 C9 45 33 C0 48 89 5C 24 5C FF 15 67 81 00 00 8B 4C 24 20 BA 06 00 00 00 85 C0 0F 48 CA 89 4C 24 20 48 8B CB FF 15 3C 7C 00 00 8B 54 24 20 EB 00 8B C2 48 8B 8C 24 D0 08 00 00 48 33 CC E8 CC CB FF FF 4C 8D 9C 24 E0 08 00 00 49 8B 5B 18 49 8B 73 20 49 8B E3 5F C3 FF 15 A9 7B 00 00 90 E9 DA D0 FF FF FF 15 9D 7B 00 00 90 E9 DE D0 FF FF 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 30 48 8B F1 49 8B C8 49 8B D8 48 8B FA FF 15 4F 7B 00 00 41 B9 01 00 00 00 8D 44 00 02 45 33 C0 48 8B D7 89 44 24 28 48 8B CE 48 89 5C 24 20 FF 15 4D 79 00 00 48 8B 5C 24 40 48 8B 74 24 48 48 83 C4 30 5F C3 1B C0 83 D8 FF E9 13 D0 FF FF 90 90 90 90 90 90 90 48 89 5C 24 08 44 0F B7 1D 27 B9 00 00 33 DB 41 FF C9 44 8B D3 EB 00 66 44 39 19 74 24 45 3B D1 73 1F 0F B7 01 41 FF C2 66 41 89 00 0F B7 01 49 83 C0 02 48 What IS this? In other words

The ever-present issues How we conceptualize binary information How we use our conceptualization for analysis The ever-present issues

The RE Dichotomy Flexible Exact Complex Rigid Rules Succinct 66 52 66 8B D0 FA B4 1B D0 C0 66 D1 C8 E6 74 E4 75 F6 C4 80 74 08 86 C4 E6 74 E4 75 86 C4 8A E6 66 5A C3 66 52 66 8B D0 86 C4 B4 1B D0 C0 66 D1 C8 FA 66 50 8A E0 8A C2 86 C4 E6 74 86 C4 E6 75 66 58 F6 C4 80 74 06 86 C4 E6 74 E4 75 66 8B C2 66 5A C3 E6 72 E4 73 C3 66 50 86 C4 E6 72 86 C4 E6 73 66 58 C3 66 9C 66 50 66 51 FA 66 8B CB 66 33 DB 8A C1 E8 87 FF FF FF 02 D8 80 D7 00 FE C1 38 E9 76 EE 66 59 66 58 66 9D C3 66 50 66 53 80 E4 80 B3 10 0A DC push dx mov dx, ax cli mov ah, 1Bh rol al, 1 ror ax, 1 out 74h, al in al, 75h test ah, 80h jz $+0x0A xchg al, ah mov ah, dh Flexible Exact Complex Rigid Rules Succinct The RE Dichotomy

Investigating the concept xor edx, edx ; int lea rcx, [rsp+78h] ; void * mov [rsp+arg_68], ebx lea r8d, [rdx+60h] ; size_t call memset xor ecx, ecx ; hWnd call cs:GetDC mov rdi, rax cmp rax, rbx jz loc_1000015A4 lea rsi, stru_1000101A0 mov edx, 5Ah ; int mov rcx, rax ; HDC mov [rsp+arg_68], 68h mov [rsp+78h], rbp mov [rsp+88h], rsi call cs:GetDeviceCaps mov ecx, cs:nNumber mov r8d, 2D0h mov edx, eax call cs:MulDiv mov rdx, rdi ; hDC neg eax mov dword ptr [rsp+94h], 1000041h mov eax, 2000h mov [rsp+0C8h], ax call cs:ReleaseDC call cs:ChooseFontW cmp eax, ebx mov rcx, cs:hCursor ; hCursor call cs:SetCursor mov rcx, rsi ; LOGFONTW * call cs:CreateFontIndirectW jz short loc_100001B8C mov rcx, cs:wParam ; HGDIOBJ call cs:DeleteObject mov rcx, cs:qword_1000100A0 ; hWnd mov r9, r14 ; lParam mov r8, rdi ; wParam mov edx, 30h ; Msg mov cs:wParam, rdi call cs:SendMessageW What does this do? Where’s the vulnerability? Reverse engineering as an art Intuition and instinct. Investigating the concept

Reverse Engineering Let’s fix this. Bridge the analysis gap Change RE from an ART to a SCIENCE Reverse Engineering

How? Visual RE Statistical Exploration Address the conceptualization Address the analysis How?

Visual RE Idea: Take a computationally difficult task Translate it to a problem our brains do naturally Visual RE

…what? In other words in 20 seconds 48 3B C3 74 2A 4C 89 6C 24 20 45 33 C9 45 33 C0 41 8D 51 04 FF 15 F6 80 00 00 48 8B F0 48 89 44 24 68 48 8B 4C 24 58 FF 15 EB 81 00 00 EB 00 48 8B 0D 82 C0 00 00 FF 15 DC 81 00 00 49 83 CB FF 4C 89 1D 71 C0 00 00 48 3B F3 0F 84 A7 30 00 00 48 8B C6 48 89 44 24 40 45 3B E3 0F 85 D5 31 00 00 0F B7 0E BA EF BB 00 00 3B CA 0F 84 D0 30 00 00 81 F9 FF FE 00 00 0F 85 96 30 00 00 41 BF 01 00 00 00 44 89 7C 24 48 45 8B E7 44 89 7C 24 34 49 8B C5 48 D1 E8 48 FF C8 8B F8 89 44 24 30 48 8B 44 24 40 EB 00 44 3B FB 0F 84 98 32 00 00 45 33 C9 45 33 C0 45 8D 71 0B 41 8B D6 48 8B 0D DD BF 00 00 FF 15 AF 84 00 00 45 33 C9 45 33 C0 BA B1 00 00 00 48 8B 0D C5 BF 00 00 FF 15 97 84 00 00 45 33 C9 45 33 C0 BA B7 00 00 00 48 8B 0D AD BF 00 00 FF 15 7F 84 00 00 8D 57 01 48 03 D2 45 8D 46 F7 48 8B 0D DE BF 00 00 FF 15 F0 7F 00 00 48 89 84 24 90 00 00 00 48 3B C3 0F 84 47 32 00 00 48 8B C8 FF 15 56 80 00 00 4C 8B F0 48 89 84 24 80 00 00 00 44 3B FB 0F 84 BD 33 00 00 B8 FF FE 00 00 66 39 06 0F 85 37 33 00 00 44 8B C7 4D 03 C0 48 8D 56 02 49 8B CE E8 4E F3 FF FF EB 00 44 89 25 21 BF 00 00 4C 8B 64 24 78 EB 00 48 8D 44 24 50 48 3B F0 74 09 48 8B CE FF 15 77 7F 00 00 4C 3B F3 0F 84 17 34 00 00 49 8B C6 3B FB 76 22 8B CF 90 90 90 90 90 90 90 90 90 90 90 90 90 66 39 18 0F 84 BD 33 00 00 48 83 C0 02 48 83 E9 01 75 ED 8B C7 66 41 89 1C 46 66 41 83 3E 2E 0F 84 AE 33 00 00 8B F3 EB 00 4C 8B AC 24 90 00 00 00 49 8B CD FF 15 9E 7F 00 00 4C 89 2D 07 BF 00 00 B9 04 01 00 00 48 8D 15 53 C9 00 00 4D 8B C4 4C 2B C2 48 8D 81 FA FE FF 7F 48 3B C3 74 17 41 0F B7 04 10 66 3B C3 74 0D 66 89 02 48 83 C2 02 48 83 E9 01 75 DD 48 3B CB 0F 84 8B 33 00 00 66 89 1A 49 8B CC E8 6E EC FF FF 89 1D E0 BD 00 00 C7 05 0A BE 00 00 01 00 00 00 45 33 C9 4C 8B 05 A4 BE 00 00 BA BC 00 00 00 48 8B 0D 50 BE 00 00 FF 15 22 83 00 00 83 3D E7 BD 00 00 02 0F 84 50 33 00 00 89 1D DB BD 00 00 45 33 C9 45 33 C0 BA C5 00 00 00 48 8B 0D 25 BE 00 00 FF 15 E7 82 00 00 3B F3 0F 85 88 33 00 00 45 33 C9 BA 15 01 00 00 44 8D 42 A9 48 8B 0D 04 BE 00 00 FF 15 D6 82 00 00 4C 8B C0 BA 01 00 00 00 44 8B CA 48 8B 0D DC BD 00 00 FF 15 16 81 00 00 45 33 C9 41 8D 51 0B 45 8D 41 01 48 8B 0D D4 BD 00 00 FF 15 A6 82 00 00 33 D2 44 8D 42 01 48 8B 0D C1 BD 00 00 FF 15 F3 80 00 00 48 8B 0D B4 BD 00 00 FF 15 EE 80 00 00 48 8B 0D E7 BD 00 00 FF 15 01 82 00 00 B8 01 00 00 00 EB 00 48 8B 8C 24 10 03 00 00 48 33 CC E8 EA CE FF FF 4C 8D 9C 24 20 03 00 00 49 8B 5B 38 49 8B 73 40 49 8B E3 41 5F 41 5E 41 5D 41 5C 5F C3 48 8D 54 24 50 48 8B CF FF 15 5F 7E 00 00 41 B8 04 01 00 00 48 8D 94 24 A0 03 00 00 48 8B D8 48 83 F8 FF 0F 84 D4 12 00 00 48 8D 4C 24 7C FF 15 11 83 00 00 48 8B CB FF 15 20 7E 00 00 E9 D1 EB FF FF 48 8B D6 48 8D 35 C1 C7 00 00 44 8B C3 48 8B CE E8 66 00 00 00 41 BD 80 00 00 00 48 89 7C 24 30 45 8D 65 83 45 33 C9 BA 00 00 00 80 48 8B CE 45 8B C4 44 89 6C 24 28 44 89 64 24 20 FF 15 89 7E 00 00 48 89 05 FA BC 00 00 48 83 F8 FF 0F 84 F0 18 00 00 8B 15 6E BC 00 00 48 8B CE E8 3A FB FF FF 90 E9 D7 E8 FF FF 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 48 89 5C 24 08 48 89 6C 24 18 57 48 81 EC 90 04 00 00 48 8B 05 6F BC 00 00 48 33 C4 48 89 84 24 80 04 00 00 44 0F B7 02 33 FF 48 8B DA 48 8B EA 66 41 83 F8 22 0F 84 72 13 00 00 66 41 83 F8 27 0F 84 67 13 00 00 48 8B CB FF 15 F9 82 00 00 3B C7 48 8D 3D F8 C6 00 00 0F 85 A2 13 00 00 45 33 C9 4C 8B C7 BA 04 01 00 00 48 8B CB FF 15 06 7D 00 00 48 8D 54 24 20 48 8B CF FF 15 30 7D 00 00 48 83 F8 FF 0F 84 8B 13 00 00 48 8B C8 FF 15 0D 7D 00 00 48 8B C5 48 8B 8C 24 80 04 00 00 48 33 CC E8 6A CD FF FF 4C 8D 9C 24 90 04 00 00 49 8B 5B 10 49 8B 6B 20 49 8B E3 5F C3 39 1D 5F BB 00 00 4C 8D 2D 88 C6 00 00 44 89 3D 8D BB 00 00 49 8B CD 48 0F 45 0D 66 BE 00 00 E8 1D 00 00 00 89 1D 77 BB 00 00 8B E8 83 F8 06 0F 85 C3 D2 FF FF E9 1F 0C 00 00 90 90 90 90 90 90 90 48 89 5C 24 10 48 89 74 24 18 57 48 81 EC E0 08 00 00 48 8B 05 73 BB 00 00 48 33 C4 48 89 84 24 D0 08 00 00 48 8B F9 48 8D 4C 24 34 33 D2 41 B8 9C 00 00 00 E8 03 CD FF FF 48 8B 05 64 BB 00 00 48 8B 0D 9D BB 00 00 48 89 44 24 34 48 8D 05 01 89 00 00 4C 8D 84 24 D0 00 00 00 41 B9 00 04 00 00 BA B9 0B 00 00 C7 44 24 30 A0 00 00 00 48 89 44 24 70 48 89 4C 24 3C C7 44 24 48 08 00 00 00 48 C7 44 24 4C B8 0B 00 00 C7 44 24 6C 02 00 00 00 FF 15 6D 7F 00 00 85 C0 0F 84 6F 0B 00 00 48 85 FF 0F 84 5F 0B 00 00 48 8B CF FF 15 43 7C 00 00 8B D8 EB 00 48 8D 8C 24 D0 00 00 00 FF 15 31 7C 00 00 B9 40 00 00 00 8D 74 18 01 48 63 D6 48 03 D2 FF 15 3C 7C 00 00 In other words how to traverse a hundred thousand pages of in 20 seconds …what?

If we change the way we process binary information…

… we find unexpected ways of making sense of it.

Why bother? obfuscated file headers no headers multiple binaries embedded in a single blob unique instruction sets proprietary data formats overwhelming complexity steganography memory dumps rapid RE triage firmware forensics Why bother?

Our best RE tools are completely dependent on known structure Information is evolving faster than our tools can keep up Gate’s Law Software is getting slower more rapidly than hardware becomes faster The amount of information we need to analyze is growing exponentially We’re left in the dust by this avalanche of information. Every day there's a new instruction set, a new file format, a new data type that our tools need to adapt to; trying to keep them up to date is a losing battle. Why bother?

Some interesting ideas Greg Conti United States Military Academy Black Hat 2010 Aldo Cortesi Nullcube corte.si Some interesting ideas

Digraphs (conti) Idea: Even in unstructured data, there is structure Sequential bytes have an implicit relationship Digraphs (conti)

recon re (72,65) ec (65,72) co (63,6F) on (6F,6E) Digraphs (conti)

(0x20, 0x20) (0x20, 0x35 ) Digraphs (conti)

ASCII Digraphs (conti)

Image Digraphs (conti)

Audio Digraphs (conti)

Hilbert Translation (cortesi) Introducing the Hilbert Curve Continuous fractal space filling curve Maps 1D space to an alternate dimensional space Preserves Locality Unexpected utility in computer science Hilbert Translation (cortesi)

Hilbert Translation (cortesi) Traditional byte plot “Zig-Zag” order on left Hilbert byte plot on right Shaded by Byte Class Hilbert Translation (cortesi)

Our software Build on these concepts Goal understand data independent of format Unknown code Format deviations Proprietary structure a priori Independent of format is key! We should work as well on x86 as ARM as some random instruction set nobody’s ever seen. Our software is not tied to any specific type of file or data – it treats all data equally, as arbitrary binary information, so that any file can be explored. Our software

Introducing ..cantor.dust.. Named after this guy → Illustrating concepts Doesn’t need to be this software Introducing ..cantor.dust..

..cantor.dust.. // background An embarrassing mistake ..cantor.dust.. // background

..cantor.dust.. // background 66 52 66 8B D0 FA B4 1B D0 C0 66 D1 C8 E6 74 E4 75 F6 C4 80 74 08 86 C4 E6 74 E4 75 86 C4 8A E6 66 5A C3 66 52 66 8B D0 86 C4 B4 1B D0 C0 66 D1 C8 FA 66 50 8A E0 8A C2 86 C4 E6 74 86 C4 E6 75 66 58 F6 C4 80 74 06 86 C4 E6 74 E4 75 66 8B C2 66 5A C3 E6 72 E4 73 C3 66 50 86 C4 E6 72 86 C4 E6 73 66 58 C3 66 9C 66 50 66 51 FA 66 8B CB 66 33 DB 8A C1 E8 87 FF FF FF 02 D8 80 D7 00 FE C1 38 E9 76 EE 66 59 66 58 66 9D C3 66 50 66 53 80 E4 80 B3 10 0A DC 66 52 66 8B D0 FA B4 1B D0 C0 66 D1 C8 E6 74 E4 75 F6 C4 80 74 08 86 C4 E6 74 E4 75 86 C4 8A E6 66 5A C3 66 52 66 8B D0 86 C4 B4 1B D0 C0 66 D1 C8 FA 66 50 8A E0 8A C2 86 C4 E6 74 86 C4 E6 75 66 58 F6 C4 80 74 06 86 C4 E6 74 E4 75 66 8B C2 66 5A C3 E6 72 E4 73 C3 66 50 86 C4 E6 72 86 C4 E6 73 66 58 C3 66 9C 66 50 66 51 FA 66 8B CB 66 33 DB 8A C1 E8 87 FF FF FF 02 D8 80 D7 00 FE C1 38 E9 76 EE 66 59 66 58 66 9D C3 66 50 66 53 80 E4 80 B3 10 0A DC 66 52 66 8B D0 FA B4 1B D0 C0 66 D1 C8 E6 74 E4 75 F6 C4 80 74 08 86 C4 E6 74 E4 75 86 C4 8A E6 66 5A C3 66 52 66 8B D0 86 C4 B4 1B D0 C0 66 D1 C8 FA 66 50 8A E0 8A C2 86 C4 E6 74 86 C4 E6 75 66 58 F6 C4 80 74 06 86 C4 E6 74 E4 75 66 8B C2 66 5A C3 E6 72 E4 73 C3 66 50 86 C4 E6 72 86 C4 E6 73 66 58 C3 66 9C 66 50 66 51 FA 66 8B CB 66 33 DB 8A C1 E8 87 FF FF FF 02 D8 80 D7 00 FE C1 38 E9 76 EE 66 59 66 58 66 9D C3 66 50 66 53 80 E4 80 B3 10 0A DC 66 52 66 8B D0 FA B4 1B D0 C0 66 D1 C8 E6 74 E4 75 F6 C4 80 74 08 86 C4 E6 74 E4 75 86 C4 8A E6 66 5A C3 66 52 66 8B D0 86 C4 B4 1B D0 C0 66 D1 C8 FA 66 52 66 8B D0 FA B4 1B D0 C0 66 D1 C8 E6 74 E4 75 F6 C4 80 74 08 86 C4 E6 74 E4 75 86 C4 8A E6 66 5A C3 66 52 66 8B D0 86 C4 B4 1B D0 C0 66 D1 C8 FA 66 50 8A E0 8A C2 86 C4 E6 74 86 C4 E6 75 66 58 F6 C4 80 74 06 86 C4 E6 74 E4 75 66 8B C2 66 5A C3 E6 72 E4 73 C3 66 50 86 C4 E6 72 86 C4 E6 73 66 58 C3 66 9C 66 50 66 51 FA 66 8B CB 66 33 DB 8A C1 E8 87 FF FF FF 02 D8 80 D7 00 FE C1 38 E9 76 EE 66 59 66 58 66 9D C3 66 50 66 53 80 E4 80 B3 10 0A DC 66 52 66 8B D0 FA B4 1B D0 C0 66 D1 C8 E6 74 E4 75 F6 C4 80 74 08 86 C4 E6 74 E4 75 86 C4 8A E6 66 5A C3 66 52 66 8B D0 86 C4 B4 1B D0 C0 66 D1 C8 FA 66 50 8A E0 8A C2 86 C4 E6 74 86 C4 E6 75 66 58 F6 C4 80 74 06 86 C4 E6 74 ..cantor.dust.. // background

..cantor.dust.. // background An embarrassing mistake Spare time ..cantor.dust.. // background

Interface Patterns ..cantor.dust.. // demo

..cantor.dust.. // demo Visualizations Tuple systems Why Time/Space Coordinate Systems Fun ..cantor.dust.. // demo

..cantor.dust.. // demo Visualizations Metric map Entropy Uses Encryption Keys Packing Obfuscation Examples Malware Key check ..cantor.dust.. // demo

Notepad.exe dissection ..cantor.dust.. // demo

..cantor.dust.. // classificaton Binary region identification through statistical analysis Naïve Bayes classification of n-gram models Identify regions of an object based on supplied templates Uses: Custom/proprietary formats Unique Instruction Sets Data/code features ..cantor.dust.. // classificaton

..cantor.dust.. // parsing Conventional parsing A new approach? Recursive descent Linear sweep A new approach? “Probabilistic parsing” Identify structure based on statistical patterns, not grammar definitions ..cantor.dust.. // parsing

..cantor.dust.. // case study “Attacking Intel BIOS” Invisible Things Lab Rafal Wojtczuk and Alexander Tereshkin Black Hat 2009 ..cantor.dust.. // case study

..cantor.dust.. // case study Goal: Bypass EFI signing protection ..cantor.dust.. // case study

..cantor.dust.. // case study Background: EFI is a BIOS replacement Update images can be signed and checked before they are flashed Hardware protections prevent flashing from the OS EFI sets these protections early in the boot process “Update” exe places image on disk, flags update on reboot Hardware protections prevent access to the lowest levels of the processor ..cantor.dust.. // case study

..cantor.dust.. // case study Background Update image “envelope” Signed module Unsigned module ← ..cantor.dust.. // case study

..cantor.dust.. // case study Background Update image “envelope” Signed module Unsigned module ← Attack Vector! ..cantor.dust.. // case study

..cantor.dust.. // case study Why have an unsigned module? Boot Splash Logo Can be changed by the OEMs ..cantor.dust.. // case study

..cantor.dust.. // case study Exploit! Goal: Unsigned Code Execution Can’t update code, can update bitmap Vulnerability identified in bitmap parser for splash screen In EFI template code used by most IBVs Flash the bitmap with an invalid image Overflow with width & height Cause an overflow, get execution ..cantor.dust.. // case study

..cantor.dust.. // case study Observations No one is really “EFI” There’s just “more” or “less” EFI for now This means Less structure More headache ..cantor.dust.. // case study

..cantor.dust.. // case study ITL covered the exploit Let’s figure out everything else ..cantor.dust.. // case study

case study // step 1 Choose a victim Targeting my junk laptop Don’t care if I brick it Grab the update executable from vendor’s website case study // step 1

case study // step 2 Quick RE to extract the firmware image Ultra-secret secure flags have been encrypted by adding 1 to each character We’re looking for “WRITEROMFILE” a.k.a. “XSJUFSPNGJMF” case study // step 2

case study // step 3 RE image Find a custom decompression routine But only one module Where are the others? case study // step 3

case study // step 4 Use ..cantor.dust.. Crop out the known module Use as a template for statistical analysis Identify regions of the binary image with patterns that match the template case study // step 4

case study // step 5 Decompress the located modules Use Chris Eagle’s x86emu No need to understand the algorithm case study // step 5

Modules contain proprietary headers case study // step 6

case study // step 6 How do we find the splash screen? Too time consuming at a binary level! Use visual abstractions to locate the “bitmap data” fingerprint case study // step 6

Examine in a hex editor – follows the bitmap format, minus the ‘BM’ signature Easy to find width/height case study // step 7

Repackage the splash screen with modified information case study // step 8

case study // step 9 Try to flash Image is not accepted Modules are signed Bitmap is not “Envelope” is checksum’d Need to fix the checksum Drop first module into IDA There’s no known structure to this module IDA tells us nothing case study // step 9

Use probabilistic parsing to identify key functions Find debug_printf Find calls to debug_printf Isolate CRC checksum routine Identify CRC algorithm Locate checksum position in image case study // step 10

Repackage the image with proper checksum Success! case study // step X

Without ..cantor.dust..? Took me 37 hours case study // results

Hope I’ve shown… case study // results

Useful: User interface ..cantor.dust.. // future

Useful: Complete integration ..cantor.dust.. // future

..cantor.dust.. // future

..cantor.dust.. // future

..cantor.dust.. // future

Pointless: Hands free ..cantor.dust.. // future

..cantor.dust.. // future

..cantor.dust.. // future

..cantor.dust.. // future ..minority.report..

Conclusions We need new ways to understand and analyze information Otherwise RE will stagnate Conclusions

Conclusions We need new ways to understand and analyze information Otherwise RE will stagnate Use this software Start thinking differently Conclusions

Thank you Getting a copy We’ve just gotten started sites.google.com/site/xxcantorxdustxx/home the.delta.axiom@gmail.com hammera@battelle.org We’ve just gotten started Thank you

..cantor.dust.. // redux