SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
Binary instrumentation for
    hackers and security professionals

                  Gal Diskin / Intel

        Special thanks to Tevi Devor from the PIN
                    development team




1
Legal Disclaimer
    INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY
    ESTOPPEL OR OTHERWISE, ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS
    DOCUMENT. INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR
    IMPLIED WARRANTY, RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES
    RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF
    ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.

    Performance tests and ratings are measured using specific computer systems and/or components and
    reflect the approximate performance of Intel products as measured by those tests. Any difference in
    system hardware or software design or configuration may affect actual performance. Buyers should
    consult other sources of information to evaluate the performance of systems or components they are
    considering purchasing. For more information on performance tests and on the performance of Intel
    products, reference www.intel.com/software/products.

    Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.

    *Other names and brands may be claimed as the property of others.

    Copyright © 2010. Intel Corporation.




2
All code in this presentation is covered
    by the following:
    •    /*BEGIN_LEGAL
    •    Intel Open Source License

    •    Copyright (c) 2002-2010 Intel Corporation. All rights reserved.
    • 
    •    Redistribution and use in source and binary forms, with or without
    •    modification, are permitted provided that the following conditions are
    •    met:

    •    Redistributions of source code must retain the above copyright notice,
    •    this list of conditions and the following disclaimer. Redistributions
    •    in binary form must reproduce the above copyright notice, this list of
    •    conditions and the following disclaimer in the documentation and/or
    •    other materials provided with the distribution. Neither the name of
    •    the Intel Corporation nor the names of its contributors may be used to
    •    endorse or promote products derived from this software without
    •    specific prior written permission.
    • 
    •    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    •    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    •    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    •    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR
    •    ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    •    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    •    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    •    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    •    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    •    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    •    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    •    END_LEGAL */




3
Part 1

    INTRODUCTION


4
Agenda
    • Introduction
      –  What is Instrumentation
      –  Why should you care? Potential usages
    • PIN – A binary instrumentation engine
      –  About PIN
      –  Understanding PIN – a case study in instruction counting
    • A practical example – catching “double-free”
    • Advanced stuff and closing notes
      –  Probe mode and JIT mode
      –  Advanced PIN capabilities
      –  Alternatives
      –  How to learn more
      –  Call for action



5
Instrumentation
    A technique that inserts code into a program to collect
    run-time information
       q  Program analysis : performance profiling, error detection,
       capture & replay
       q  Architectural study : processor and cache simulation, trace
       collection

    •  Source-Code Instrumentation
    •  Static Binary Instrumentation
    •  Dynamic Binary Instrumentation
      q Instrument code just before it runs (Just In Time – JIT)
         –  No need to recompile or re-link
         –  Discover code at runtime
         –  Handle dynamically-generated code
         –  Attach to running processes

6
Why should you care?

    •  The previous slide didn’t mention all potential usages
    •  Potential security related usages:
      –  Sandboxing & Forcing security practices
      –  Behavior-based security
      –  Pre-patching
      –  Reversing, unpacking & de-obfuscation
      –  SW analysis, for example - Parallel studio
         –  Thread checking
         –  Memory checking
      –  Taint-analysis
      –  Anti-viruses
      –  Automated vulnerability classification / analysis
      –  Deterministic replay
      –  …
    •  Do you have tool ideas? Let me know and I might help

7
Part 1 - Summary

    • Instrumentation – a technique to inject code into a
      program

    • Dynamic binary instrumentation – what we will
      focus on today

    • Instrumentation has tons of uber kwel usages for
      offense and defense




8
Part 2

    PIN – A DYNAMIC BINARY
    INSTRUMENTATION ENGINE

9
What Does “Pin” Stand For?

     • Three Letter Acronyms @ Intel
       –  TLAs
       –  263 possible TLAs
              3
         –  26 -1 are in use at Intel
         –  Only 1 is not approved for use at Intel
         –  Guess which one:

     •  Pin Is Not an acronym




10
Pin Instrumentation

     • Multi-platform:
       –  Linux
       –  Windows
       –  OS X (not supported anymore)


     • Multi-architecture:
       –  IA32
       –  x86-64 (aka Intel64 / AMD64)
       –  Itanium (aka IA64, only Linux)
       –  ARM (not supported anymore)


     • Robust & Efficient


11
Pin availability
     • Popular and well supported
      –  40,000+ downloads, 400+ citations


     • Free Download
      –  www.pintool.org
      –  Free for non-commercial use
      –  Includes: Detailed user manual, source code for 100s of
         Pin tools


     • Pin User Group (PinHeads)
      –  http://tech.groups.yahoo.com/group/pinheads/
      –  Pin users and Pin developers answer questions




12
Pin and Pin Tools

     • Pin – the instrumentation engine
     • Pin Tool – the instrumentation program

     • Pin provides a framework, the Pin Tool uses the
       framework to do something meaningful

     • Pin Tools
       –  Written in C/C++ using Pin APIs
       –  Many open source examples provided with the Pin kit
       –  Certain do’s and dont’s apply




13
Instruction Counting Tool
     #include "pin.h"

     UINT64 icount = 0;

     void docount() { icount++; }

     void Instruction(INS ins, void *v)
     {
         INS_InsertCall(ins, IPOINT_BEFORE,
         (AFUNPTR)docount, IARG_END);
     }


                                                      Start
     void Fini(INT32 code, void *v)
     { std::cerr << "Count " << icount << endl; }

     int main(int argc, char * argv[])
     {
                                                      Here
         PIN_Init(argc, argv);
         INS_AddInstrumentFunction(Instruction, 0);
         PIN_AddFiniFunction(Fini, 0);
         PIN_StartProgram(); // Never returns
         return 0;
     }

14
Instrumentation vs. Analysis

     • Instrumentation routines define where
     instrumentation is inserted
        – e.g., before instruction
        C Occurs first time an instruction is executed


     • Analysis routines define what to do when
     instrumentation is activated
        – e.g., increment counter
        C Occurs every time an instruction is
          executed



15
Instruction Counting Tool
     #include "pin.h"

     UINT64 icount = 0;

     void docount() { icount++; }

     void Instruction(INS ins, void *v)
     {
         INS_InsertCall(ins, IPOINT_BEFORE,
         (AFUNPTR)docount, IARG_END);
     }

     void Fini(INT32 code, void *v)
     { std::cerr << "Count " << icount << endl; }

     int main(int argc, char * argv[])
     {
         PIN_Init(argc, argv);
         INS_AddInstrumentFunction(Instruction, 0);
         PIN_AddFiniFunction(Fini, 0);
         PIN_StartProgram(); // Never returns
         return 0;
     }

16
Instrumentation Granularity

     • Instruction
     • Basic Block
     • Trace

     • Routine
     • Section
     • Image

     • Process
     • Thread
     • Exception

17
Instrumentation Points

     IPOINT_BEFORE         Insert a call before an instruction
                           or routine.
     IPOINT_AFTER          Insert a call on the fall thorugh
                           path of an instruction or return
                           path of a routine.
     IPOINT_ANYWHERE       Insert a call anywhere inside a
                           trace or a bbl.
     IPOINT_TAKEN_BRANCH   Insert a call on the taken edge of
                           branch, the side effects of the
                           branch are visible.




18
A Better Instruction Counting Tool
     #include "pin.H"
     UINT64 icount = 0;
     void PIN_FAST_ANALYSIS_CALL docount(INT32 c) { icount += c; }
     void Trace(TRACE trace, void *v){// Pin Callback
       for(BBL bbl = TRACE_BblHead(trace);
           BBL_Valid(bbl);
           bbl = BBL_Next(bbl))
           BBL_InsertCall(bbl, IPOINT_ANYWHERE,
                           (AFUNPTR)docount, IARG_FAST_ANALYSIS_CALL,
                           IARG_UINT32, BBL_NumIns(bbl),
                           IARG_END);
     }
     void Fini(INT32 code, void *v) {// Pin Callback
       fprintf(stderr, "Count %lldn", icount);
     }
     int main(int argc, char * argv[]) {
        PIN_Init(argc, argv);
        TRACE_AddInstrumentFunction(Trace, 0);
        PIN_AddFiniFunction(Fini, 0);
        PIN_StartProgram();
        return 0;
     }


19
Summary of Part 2

     • Pin is a dynamic binary instrumentation engine
     • Pin is available freely for non-commercial purposes
     • Pin is the engine, Pin Tools are programs controlling
       the engine

     • Instrumentation routines are called once, analysis
       routines are called every time
     • There are many levels of granularity
       –  You should try to use the lowest answering your needs
     • You can change instrumentation points




20
Part 3

     A PRACTICAL EXAMPLE
     CATCHING “DOUBLE-FREE”

21
Main + Includes
     #include             "pin.H"	
  
     #include             <iostream>	
  
     #include             <iomanip>	
  
     #include             <algorithm>	
  
     #include             <list>
     	
  
     int main(int argc, char *argv[])	
  
     {	
  
           // Initialize pin & symbol manager	
  
           PIN_InitSymbols();	
  
           PIN_Init(argc,argv);	
  
            	
  
                   // Register Image to be called to instrument functions.	
  
                   IMG_AddInstrumentFunction(Image, 0);	
  
                   	
  
                   PIN_StartProgram(); // Never returns	
  
                   	
  
                   return 0;	
  
     }	
  

22
Instrumentation Routine
     VOID Image(IMG img, VOID *v) {	
  
           // Find the malloc() function and add our function after it	
  
           RTN mallocRtn = RTN_FindByName(img, "malloc");	
  
           if (RTN_Valid(mallocRtn))	
  
           {	
  
                 RTN_Open(mallocRtn);	
  
                 RTN_InsertCall(mallocRtn, IPOINT_AFTER, (AFUNPTR)MallocAfter,	
  
                                IARG_FUNCRET_EXITPOINT_VALUE, IARG_END);	
  
                 RTN_Close(mallocRtn);	
  
           }	
  
           // Find the free() function and add our function before it	
  
           RTN freeRtn = RTN_FindByName(img, "free");	
  
           if (RTN_Valid(freeRtn))	
  
           {	
  
                 RTN_Open(freeRtn);	
  
                 RTN_InsertCall(freeRtn, IPOINT_BEFORE, (AFUNPTR)FreeBefore,	
  
                                IARG_ADDRINT, "free",	
  
                                IARG_FUNCARG_ENTRYPOINT_VALUE, 0,	
  
                                IARG_END);	
  
                 RTN_Close(freeRtn);	
  
           }	
  
     }	
  

23
Analysis routines
     list<ADDRINT> MallocAddrs;


     VOID MallocAfter(ADDRINT ret)
     {
           // Save teh address returned by malloc in our list
           MallocAddrs.push_back(ret);
     }	
  

     VOID FreeBefore(CHAR * name, ADDRINT target)
     {
        list<ADDRINT>::iterator p;

            p = find(MallocAddrs.begin(), MallocAddrs.end(), target);
            if (MallocAddrs.end() != p)
            {
                 p = MallocAddrs.erase(p);
            }    // Delete this from the allocated address list
            else
            {    // We caught a Free of an un-allocated address
                 cout << hex << target << endl;
            }    // Using cout is not a good practice, I do it for the example only
     }


24   	
  
Summary of part 3

     • It is relatively simple to write Pin Tools

     • Writing a tool to catch double free is very simple
       and takes less than 50 lines of actual code

     • Using simple tools we can catch vulnerabilities
       relatively easily

     • Did anyone notice the flaw in the tool?




25
Part 4

     ADVANCED STUFF AND
     CLOSING NOTES

26
Probe mode and JIT mode

     • JIT Mode
        – Pin creates a modified copy of the application on-
          the-fly
        – Original code never executes

             Ø More flexible, more common approach

     • Probe Mode
        – Pin modifies the original application instructions
        – Inserts jumps to instrumentation code
          (trampolines)

            Ø Lower overhead (less flexible) approach


27
Advanced Pin APIs
     • Transparent debugging and extending the debugger
     • Attaching and detaching
     • System call instrumentation
     • Managing Exceptions and Signals
     • Instrumenting a process tree
     • Accessing Decode API
     • CONTEXT* and IARG_CONST_CONTEXT,
       IARG_CONTEXT
     • Fast buffering API
     • Pin Code-Cache API




28
Alternative instrumentation engines

     •  DyanmoRIO
     •  Valgrind
     •  Dtrace
     •  SystemTap (based on kprobes)
     •  Frysk
     •  GDB can also be seen as a DBI
     •  Bistro (EOL)

     •  Add your favorite DBI engine here




29
Learning more about Pin

     •  Website – www.pintool.org
       –  Free Pin kit downloads
       –  Many open source Pin Tool examples
       –  An extensive manual
       –  Links to papers and extensive tutorials given in conferences


     • PinHeads - Mailing list / newsgroup
       –  http://tech.groups.yahoo.com/group/pinheads/




30
Call for action

     •  Start learning and using binary instrumentation
     •  Create your own Pin Tools and share with the DC9723
        community and all the security community

     •  Did anybody come up with a tool idea?
       –  Feel free to contact me




31
QUESTIONS?



     Contact details:
     -  gal.diskin@intel.com
     -  www.diskin.org

32

Mais conteúdo relacionado

Mais procurados

Embedded device hacking Session i
Embedded device hacking Session iEmbedded device hacking Session i
Embedded device hacking Session iMalachi Jones
 
Offensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonOffensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonMalachi Jones
 
Secure coding for developers
Secure coding for developersSecure coding for developers
Secure coding for developerssluge
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Tech_MX
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsenSilo
 
An Introduction of SQL Injection, Buffer Overflow & Wireless Attack
An Introduction of SQL Injection, Buffer Overflow & Wireless AttackAn Introduction of SQL Injection, Buffer Overflow & Wireless Attack
An Introduction of SQL Injection, Buffer Overflow & Wireless AttackTechSecIT
 
SyScan Singapore 2010 - Returning Into The PHP-Interpreter
SyScan Singapore 2010 - Returning Into The PHP-InterpreterSyScan Singapore 2010 - Returning Into The PHP-Interpreter
SyScan Singapore 2010 - Returning Into The PHP-InterpreterStefan Esser
 
Exploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsExploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsKoan-Sin Tan
 
Secure Coding Practices for Middleware
Secure Coding Practices for MiddlewareSecure Coding Practices for Middleware
Secure Coding Practices for MiddlewareManuel Brugnoli
 
[PH-Neutral 0x7db] Exploit Next Generation®
[PH-Neutral 0x7db] Exploit Next Generation®[PH-Neutral 0x7db] Exploit Next Generation®
[PH-Neutral 0x7db] Exploit Next Generation®Nelson Brito
 
[嵌入式系統] MCS-51 實驗 - 使用 IAR (3)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (3)[嵌入式系統] MCS-51 實驗 - 使用 IAR (3)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (3)Simen Li
 
Dynamic PHP web-application analysis
Dynamic PHP web-application analysisDynamic PHP web-application analysis
Dynamic PHP web-application analysisax330d
 
Implementation of the ZigBee ZCL Reporting Configuration Features
Implementation of the ZigBee ZCL Reporting Configuration FeaturesImplementation of the ZigBee ZCL Reporting Configuration Features
Implementation of the ZigBee ZCL Reporting Configuration FeaturesSimen Li
 
FFR GreenKiller - Automatic kernel-mode malware analysis system
FFR GreenKiller - Automatic kernel-mode malware analysis systemFFR GreenKiller - Automatic kernel-mode malware analysis system
FFR GreenKiller - Automatic kernel-mode malware analysis systemFFRI, Inc.
 

Mais procurados (20)

Embedded device hacking Session i
Embedded device hacking Session iEmbedded device hacking Session i
Embedded device hacking Session i
 
Offensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonOffensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with Python
 
Secure coding for developers
Secure coding for developersSecure coding for developers
Secure coding for developers
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)
 
Sysprog 11
Sysprog 11Sysprog 11
Sysprog 11
 
Vhdl programming
Vhdl programmingVhdl programming
Vhdl programming
 
Lecture7
Lecture7Lecture7
Lecture7
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
 
An Introduction of SQL Injection, Buffer Overflow & Wireless Attack
An Introduction of SQL Injection, Buffer Overflow & Wireless AttackAn Introduction of SQL Injection, Buffer Overflow & Wireless Attack
An Introduction of SQL Injection, Buffer Overflow & Wireless Attack
 
SyScan Singapore 2010 - Returning Into The PHP-Interpreter
SyScan Singapore 2010 - Returning Into The PHP-InterpreterSyScan Singapore 2010 - Returning Into The PHP-Interpreter
SyScan Singapore 2010 - Returning Into The PHP-Interpreter
 
Exploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsExploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source Tools
 
ShinoBOT Suite
ShinoBOT SuiteShinoBOT Suite
ShinoBOT Suite
 
Programs of VHDL
Programs of VHDLPrograms of VHDL
Programs of VHDL
 
VHDL CODES
VHDL CODES VHDL CODES
VHDL CODES
 
Secure Coding Practices for Middleware
Secure Coding Practices for MiddlewareSecure Coding Practices for Middleware
Secure Coding Practices for Middleware
 
[PH-Neutral 0x7db] Exploit Next Generation®
[PH-Neutral 0x7db] Exploit Next Generation®[PH-Neutral 0x7db] Exploit Next Generation®
[PH-Neutral 0x7db] Exploit Next Generation®
 
[嵌入式系統] MCS-51 實驗 - 使用 IAR (3)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (3)[嵌入式系統] MCS-51 實驗 - 使用 IAR (3)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (3)
 
Dynamic PHP web-application analysis
Dynamic PHP web-application analysisDynamic PHP web-application analysis
Dynamic PHP web-application analysis
 
Implementation of the ZigBee ZCL Reporting Configuration Features
Implementation of the ZigBee ZCL Reporting Configuration FeaturesImplementation of the ZigBee ZCL Reporting Configuration Features
Implementation of the ZigBee ZCL Reporting Configuration Features
 
FFR GreenKiller - Automatic kernel-mode malware analysis system
FFR GreenKiller - Automatic kernel-mode malware analysis systemFFR GreenKiller - Automatic kernel-mode malware analysis system
FFR GreenKiller - Automatic kernel-mode malware analysis system
 

Destaque

Developing Tizen OS Based Solutions (IDF13) - Chris Norman
Developing Tizen OS Based Solutions (IDF13) - Chris NormanDeveloping Tizen OS Based Solutions (IDF13) - Chris Norman
Developing Tizen OS Based Solutions (IDF13) - Chris NormanRyo Jin
 
Sthack 2015 - Jonathan "@JonathanSalwan" Salwan - Dynamic Behavior Analysis U...
Sthack 2015 - Jonathan "@JonathanSalwan" Salwan - Dynamic Behavior Analysis U...Sthack 2015 - Jonathan "@JonathanSalwan" Salwan - Dynamic Behavior Analysis U...
Sthack 2015 - Jonathan "@JonathanSalwan" Salwan - Dynamic Behavior Analysis U...StHack
 
Demand-Driven Structural Testing with Dynamic Instrumentation (ICSE 2005)
Demand-Driven Structural Testing with Dynamic Instrumentation (ICSE 2005)Demand-Driven Structural Testing with Dynamic Instrumentation (ICSE 2005)
Demand-Driven Structural Testing with Dynamic Instrumentation (ICSE 2005)James Clause
 
Risk Management Webinar
Risk Management WebinarRisk Management Webinar
Risk Management Webinarjanemangat
 
Code Instrumentation, Dynamic Tracing
Code Instrumentation, Dynamic TracingCode Instrumentation, Dynamic Tracing
Code Instrumentation, Dynamic TracingMartin Děcký
 
Covering a function using a Dynamic Symbolic Execution approach
Covering a function using a Dynamic Symbolic Execution approach Covering a function using a Dynamic Symbolic Execution approach
Covering a function using a Dynamic Symbolic Execution approach Jonathan Salwan
 
[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...
[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...
[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...GangSeok Lee
 
2010 02 instrumentation_and_runtime_measurement
2010 02 instrumentation_and_runtime_measurement2010 02 instrumentation_and_runtime_measurement
2010 02 instrumentation_and_runtime_measurementPTIHPA
 
G4H Webcast: Automated Security Analysis of Mobile Applications with Mobile S...
G4H Webcast: Automated Security Analysis of Mobile Applications with Mobile S...G4H Webcast: Automated Security Analysis of Mobile Applications with Mobile S...
G4H Webcast: Automated Security Analysis of Mobile Applications with Mobile S...Ajin Abraham
 
Control Flow Analysis
Control Flow AnalysisControl Flow Analysis
Control Flow AnalysisEdgar Barbosa
 
GeeCon2016- High Performance Instrumentation (handout)
GeeCon2016- High Performance Instrumentation (handout)GeeCon2016- High Performance Instrumentation (handout)
GeeCon2016- High Performance Instrumentation (handout)Jaroslav Bachorik
 
«Вредоносные браузерные расширения и борьба с ними», Александра Сватикова (Од...
«Вредоносные браузерные расширения и борьба с ними», Александра Сватикова (Од...«Вредоносные браузерные расширения и борьба с ними», Александра Сватикова (Од...
«Вредоносные браузерные расширения и борьба с ними», Александра Сватикова (Од...OWASP Russia
 

Destaque (14)

Developing Tizen OS Based Solutions (IDF13) - Chris Norman
Developing Tizen OS Based Solutions (IDF13) - Chris NormanDeveloping Tizen OS Based Solutions (IDF13) - Chris Norman
Developing Tizen OS Based Solutions (IDF13) - Chris Norman
 
Sthack 2015 - Jonathan "@JonathanSalwan" Salwan - Dynamic Behavior Analysis U...
Sthack 2015 - Jonathan "@JonathanSalwan" Salwan - Dynamic Behavior Analysis U...Sthack 2015 - Jonathan "@JonathanSalwan" Salwan - Dynamic Behavior Analysis U...
Sthack 2015 - Jonathan "@JonathanSalwan" Salwan - Dynamic Behavior Analysis U...
 
Demand-Driven Structural Testing with Dynamic Instrumentation (ICSE 2005)
Demand-Driven Structural Testing with Dynamic Instrumentation (ICSE 2005)Demand-Driven Structural Testing with Dynamic Instrumentation (ICSE 2005)
Demand-Driven Structural Testing with Dynamic Instrumentation (ICSE 2005)
 
Risk Management Webinar
Risk Management WebinarRisk Management Webinar
Risk Management Webinar
 
Code Instrumentation, Dynamic Tracing
Code Instrumentation, Dynamic TracingCode Instrumentation, Dynamic Tracing
Code Instrumentation, Dynamic Tracing
 
Covering a function using a Dynamic Symbolic Execution approach
Covering a function using a Dynamic Symbolic Execution approach Covering a function using a Dynamic Symbolic Execution approach
Covering a function using a Dynamic Symbolic Execution approach
 
[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...
[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...
[2011 CodeEngn Conference 05] Deok9 - DBI(Dynamic Binary Instrumentation)를 이용...
 
Valgrind
ValgrindValgrind
Valgrind
 
2010 02 instrumentation_and_runtime_measurement
2010 02 instrumentation_and_runtime_measurement2010 02 instrumentation_and_runtime_measurement
2010 02 instrumentation_and_runtime_measurement
 
Format string vunerability
Format string vunerabilityFormat string vunerability
Format string vunerability
 
G4H Webcast: Automated Security Analysis of Mobile Applications with Mobile S...
G4H Webcast: Automated Security Analysis of Mobile Applications with Mobile S...G4H Webcast: Automated Security Analysis of Mobile Applications with Mobile S...
G4H Webcast: Automated Security Analysis of Mobile Applications with Mobile S...
 
Control Flow Analysis
Control Flow AnalysisControl Flow Analysis
Control Flow Analysis
 
GeeCon2016- High Performance Instrumentation (handout)
GeeCon2016- High Performance Instrumentation (handout)GeeCon2016- High Performance Instrumentation (handout)
GeeCon2016- High Performance Instrumentation (handout)
 
«Вредоносные браузерные расширения и борьба с ними», Александра Сватикова (Од...
«Вредоносные браузерные расширения и борьба с ними», Александра Сватикова (Од...«Вредоносные браузерные расширения и борьба с ними», Александра Сватикова (Од...
«Вредоносные браузерные расширения и борьба с ними», Александра Сватикова (Од...
 

Semelhante a Binary instrumentation - dc9723

HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talkHES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talkHackito Ergo Sum
 
TRITON: How it Disrupted Safety Systems and Changed the Threat Landscape of I...
TRITON: How it Disrupted Safety Systems and Changed the Threat Landscape of I...TRITON: How it Disrupted Safety Systems and Changed the Threat Landscape of I...
TRITON: How it Disrupted Safety Systems and Changed the Threat Landscape of I...Priyanka Aash
 
App Optimizations Using Qualcomm Snapdragon LLVM Compiler for Android
App Optimizations Using Qualcomm Snapdragon LLVM Compiler for AndroidApp Optimizations Using Qualcomm Snapdragon LLVM Compiler for Android
App Optimizations Using Qualcomm Snapdragon LLVM Compiler for AndroidQualcomm Developer Network
 
HH QUALCOMM using qualcomm® snapdragon™ llvm compiler to optimize apps for 32...
HH QUALCOMM using qualcomm® snapdragon™ llvm compiler to optimize apps for 32...HH QUALCOMM using qualcomm® snapdragon™ llvm compiler to optimize apps for 32...
HH QUALCOMM using qualcomm® snapdragon™ llvm compiler to optimize apps for 32...Satya Harish
 
Using Pin++ to Author Highly Configurable Pintools for Pin
Using Pin++ to Author Highly Configurable Pintools for PinUsing Pin++ to Author Highly Configurable Pintools for Pin
Using Pin++ to Author Highly Configurable Pintools for PinJames Hill
 
KazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh OjhaKazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh OjhaYogesh Ojha
 
Brillo/Weave Part 2: Deep Dive
Brillo/Weave Part 2: Deep DiveBrillo/Weave Part 2: Deep Dive
Brillo/Weave Part 2: Deep DiveJalal Rohani
 
ELC North America 2021 Introduction to pin muxing and gpio control under linux
ELC  North America 2021 Introduction to pin muxing and gpio control under linuxELC  North America 2021 Introduction to pin muxing and gpio control under linux
ELC North America 2021 Introduction to pin muxing and gpio control under linuxNeil Armstrong
 
IPLOOK IMS product information
IPLOOK IMS product informationIPLOOK IMS product information
IPLOOK IMS product informationIPLOOK Networks
 
No liftoff, touchdown, or heartbeat shall miss because of a software failure
No liftoff, touchdown, or heartbeat shall miss because of a software failureNo liftoff, touchdown, or heartbeat shall miss because of a software failure
No liftoff, touchdown, or heartbeat shall miss because of a software failureRogue Wave Software
 
Arduino Platform with C programming.
Arduino Platform with C programming.Arduino Platform with C programming.
Arduino Platform with C programming.Govind Jha
 
Piratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPiratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPriyanka Aash
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangLyon Yang
 
Webinar–Mobile Application Hardening Protecting Business Critical Apps
Webinar–Mobile Application Hardening Protecting Business Critical AppsWebinar–Mobile Application Hardening Protecting Business Critical Apps
Webinar–Mobile Application Hardening Protecting Business Critical AppsSynopsys Software Integrity Group
 
Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8Intel Developer Zone Community
 
Software Protection Techniques
Software Protection TechniquesSoftware Protection Techniques
Software Protection TechniquesChaitanya Anpat
 
How Automated Vulnerability Analysis Discovered Hundreds of Android 0-days
How Automated Vulnerability Analysis Discovered Hundreds of Android 0-daysHow Automated Vulnerability Analysis Discovered Hundreds of Android 0-days
How Automated Vulnerability Analysis Discovered Hundreds of Android 0-daysPriyanka Aash
 
NSC #2 - D2 01 - Andrea Allievi - Windows 8.1 Patch Protections
NSC #2 - D2 01 - Andrea Allievi - Windows 8.1 Patch ProtectionsNSC #2 - D2 01 - Andrea Allievi - Windows 8.1 Patch Protections
NSC #2 - D2 01 - Andrea Allievi - Windows 8.1 Patch ProtectionsNoSuchCon
 

Semelhante a Binary instrumentation - dc9723 (20)

HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talkHES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
HES 2011 - Gal Diskin - Binary instrumentation for hackers - Lightning-talk
 
TRITON: How it Disrupted Safety Systems and Changed the Threat Landscape of I...
TRITON: How it Disrupted Safety Systems and Changed the Threat Landscape of I...TRITON: How it Disrupted Safety Systems and Changed the Threat Landscape of I...
TRITON: How it Disrupted Safety Systems and Changed the Threat Landscape of I...
 
App Optimizations Using Qualcomm Snapdragon LLVM Compiler for Android
App Optimizations Using Qualcomm Snapdragon LLVM Compiler for AndroidApp Optimizations Using Qualcomm Snapdragon LLVM Compiler for Android
App Optimizations Using Qualcomm Snapdragon LLVM Compiler for Android
 
HH QUALCOMM using qualcomm® snapdragon™ llvm compiler to optimize apps for 32...
HH QUALCOMM using qualcomm® snapdragon™ llvm compiler to optimize apps for 32...HH QUALCOMM using qualcomm® snapdragon™ llvm compiler to optimize apps for 32...
HH QUALCOMM using qualcomm® snapdragon™ llvm compiler to optimize apps for 32...
 
Using Pin++ to Author Highly Configurable Pintools for Pin
Using Pin++ to Author Highly Configurable Pintools for PinUsing Pin++ to Author Highly Configurable Pintools for Pin
Using Pin++ to Author Highly Configurable Pintools for Pin
 
Android Native Apps Development
Android Native Apps DevelopmentAndroid Native Apps Development
Android Native Apps Development
 
Rsockets ofa12
Rsockets ofa12Rsockets ofa12
Rsockets ofa12
 
KazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh OjhaKazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
KazHackStan Doing The IoT Penetration Testing - Yogesh Ojha
 
Brillo/Weave Part 2: Deep Dive
Brillo/Weave Part 2: Deep DiveBrillo/Weave Part 2: Deep Dive
Brillo/Weave Part 2: Deep Dive
 
ELC North America 2021 Introduction to pin muxing and gpio control under linux
ELC  North America 2021 Introduction to pin muxing and gpio control under linuxELC  North America 2021 Introduction to pin muxing and gpio control under linux
ELC North America 2021 Introduction to pin muxing and gpio control under linux
 
IPLOOK IMS product information
IPLOOK IMS product informationIPLOOK IMS product information
IPLOOK IMS product information
 
No liftoff, touchdown, or heartbeat shall miss because of a software failure
No liftoff, touchdown, or heartbeat shall miss because of a software failureNo liftoff, touchdown, or heartbeat shall miss because of a software failure
No liftoff, touchdown, or heartbeat shall miss because of a software failure
 
Arduino Platform with C programming.
Arduino Platform with C programming.Arduino Platform with C programming.
Arduino Platform with C programming.
 
Piratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigationPiratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigation
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
 
Webinar–Mobile Application Hardening Protecting Business Critical Apps
Webinar–Mobile Application Hardening Protecting Business Critical AppsWebinar–Mobile Application Hardening Protecting Business Critical Apps
Webinar–Mobile Application Hardening Protecting Business Critical Apps
 
Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8
 
Software Protection Techniques
Software Protection TechniquesSoftware Protection Techniques
Software Protection Techniques
 
How Automated Vulnerability Analysis Discovered Hundreds of Android 0-days
How Automated Vulnerability Analysis Discovered Hundreds of Android 0-daysHow Automated Vulnerability Analysis Discovered Hundreds of Android 0-days
How Automated Vulnerability Analysis Discovered Hundreds of Android 0-days
 
NSC #2 - D2 01 - Andrea Allievi - Windows 8.1 Patch Protections
NSC #2 - D2 01 - Andrea Allievi - Windows 8.1 Patch ProtectionsNSC #2 - D2 01 - Andrea Allievi - Windows 8.1 Patch Protections
NSC #2 - D2 01 - Andrea Allievi - Windows 8.1 Patch Protections
 

Mais de Iftach Ian Amit

Cyber Risk Quantification - CyberTLV
Cyber Risk Quantification - CyberTLVCyber Risk Quantification - CyberTLV
Cyber Risk Quantification - CyberTLVIftach Ian Amit
 
BSidesTLV Closing Keynote
BSidesTLV Closing KeynoteBSidesTLV Closing Keynote
BSidesTLV Closing KeynoteIftach Ian Amit
 
Social Media Risk Metrics
Social Media Risk MetricsSocial Media Risk Metrics
Social Media Risk MetricsIftach Ian Amit
 
From your Pocket to your Heart and Back
From your Pocket to your Heart and BackFrom your Pocket to your Heart and Back
From your Pocket to your Heart and BackIftach Ian Amit
 
Painting a Company Red and Blue
Painting a Company Red and BluePainting a Company Red and Blue
Painting a Company Red and BlueIftach Ian Amit
 
"Cyber" security - all good, no need to worry?
"Cyber" security - all good, no need to worry?"Cyber" security - all good, no need to worry?
"Cyber" security - all good, no need to worry?Iftach Ian Amit
 
Seeing Red In Your Future?
Seeing Red In Your Future?Seeing Red In Your Future?
Seeing Red In Your Future?Iftach Ian Amit
 
Passwords good badugly181212-2
Passwords good badugly181212-2Passwords good badugly181212-2
Passwords good badugly181212-2Iftach Ian Amit
 
Advanced Data Exfiltration - the way Q would have done it
Advanced Data Exfiltration - the way Q would have done itAdvanced Data Exfiltration - the way Q would have done it
Advanced Data Exfiltration - the way Q would have done itIftach Ian Amit
 
Infecting Python Bytecode
Infecting Python BytecodeInfecting Python Bytecode
Infecting Python BytecodeIftach Ian Amit
 
Cheating in Computer Games
Cheating in Computer GamesCheating in Computer Games
Cheating in Computer GamesIftach Ian Amit
 

Mais de Iftach Ian Amit (20)

Cyber Risk Quantification - CyberTLV
Cyber Risk Quantification - CyberTLVCyber Risk Quantification - CyberTLV
Cyber Risk Quantification - CyberTLV
 
Devsecops at Cimpress
Devsecops at CimpressDevsecops at Cimpress
Devsecops at Cimpress
 
BSidesTLV Closing Keynote
BSidesTLV Closing KeynoteBSidesTLV Closing Keynote
BSidesTLV Closing Keynote
 
Social Media Risk Metrics
Social Media Risk MetricsSocial Media Risk Metrics
Social Media Risk Metrics
 
ISTS12 Keynote
ISTS12 KeynoteISTS12 Keynote
ISTS12 Keynote
 
From your Pocket to your Heart and Back
From your Pocket to your Heart and BackFrom your Pocket to your Heart and Back
From your Pocket to your Heart and Back
 
Painting a Company Red and Blue
Painting a Company Red and BluePainting a Company Red and Blue
Painting a Company Red and Blue
 
"Cyber" security - all good, no need to worry?
"Cyber" security - all good, no need to worry?"Cyber" security - all good, no need to worry?
"Cyber" security - all good, no need to worry?
 
Armorizing applications
Armorizing applicationsArmorizing applications
Armorizing applications
 
Seeing Red In Your Future?
Seeing Red In Your Future?Seeing Red In Your Future?
Seeing Red In Your Future?
 
Hacking cyber-iamit
Hacking cyber-iamitHacking cyber-iamit
Hacking cyber-iamit
 
Passwords good badugly181212-2
Passwords good badugly181212-2Passwords good badugly181212-2
Passwords good badugly181212-2
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Sexy defense
Sexy defenseSexy defense
Sexy defense
 
Cyber state
Cyber stateCyber state
Cyber state
 
Advanced Data Exfiltration - the way Q would have done it
Advanced Data Exfiltration - the way Q would have done itAdvanced Data Exfiltration - the way Q would have done it
Advanced Data Exfiltration - the way Q would have done it
 
Infecting Python Bytecode
Infecting Python BytecodeInfecting Python Bytecode
Infecting Python Bytecode
 
Exploiting Second life
Exploiting Second lifeExploiting Second life
Exploiting Second life
 
Dtmf phreaking
Dtmf phreakingDtmf phreaking
Dtmf phreaking
 
Cheating in Computer Games
Cheating in Computer GamesCheating in Computer Games
Cheating in Computer Games
 

Último

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Binary instrumentation - dc9723

  • 1. Binary instrumentation for hackers and security professionals Gal Diskin / Intel Special thanks to Tevi Devor from the PIN development team 1
  • 2. Legal Disclaimer INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. Performance tests and ratings are measured using specific computer systems and/or components and reflect the approximate performance of Intel products as measured by those tests. Any difference in system hardware or software design or configuration may affect actual performance. Buyers should consult other sources of information to evaluate the performance of systems or components they are considering purchasing. For more information on performance tests and on the performance of Intel products, reference www.intel.com/software/products. Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries. *Other names and brands may be claimed as the property of others. Copyright © 2010. Intel Corporation. 2
  • 3. All code in this presentation is covered by the following: •  /*BEGIN_LEGAL •  Intel Open Source License •  Copyright (c) 2002-2010 Intel Corporation. All rights reserved. •  •  Redistribution and use in source and binary forms, with or without •  modification, are permitted provided that the following conditions are •  met: •  Redistributions of source code must retain the above copyright notice, •  this list of conditions and the following disclaimer. Redistributions •  in binary form must reproduce the above copyright notice, this list of •  conditions and the following disclaimer in the documentation and/or •  other materials provided with the distribution. Neither the name of •  the Intel Corporation nor the names of its contributors may be used to •  endorse or promote products derived from this software without •  specific prior written permission. •  •  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS •  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT •  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR •  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR •  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, •  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT •  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, •  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY •  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT •  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE •  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. •  END_LEGAL */ 3
  • 4. Part 1 INTRODUCTION 4
  • 5. Agenda • Introduction –  What is Instrumentation –  Why should you care? Potential usages • PIN – A binary instrumentation engine –  About PIN –  Understanding PIN – a case study in instruction counting • A practical example – catching “double-free” • Advanced stuff and closing notes –  Probe mode and JIT mode –  Advanced PIN capabilities –  Alternatives –  How to learn more –  Call for action 5
  • 6. Instrumentation A technique that inserts code into a program to collect run-time information q  Program analysis : performance profiling, error detection, capture & replay q  Architectural study : processor and cache simulation, trace collection •  Source-Code Instrumentation •  Static Binary Instrumentation •  Dynamic Binary Instrumentation q Instrument code just before it runs (Just In Time – JIT) –  No need to recompile or re-link –  Discover code at runtime –  Handle dynamically-generated code –  Attach to running processes 6
  • 7. Why should you care? •  The previous slide didn’t mention all potential usages •  Potential security related usages: –  Sandboxing & Forcing security practices –  Behavior-based security –  Pre-patching –  Reversing, unpacking & de-obfuscation –  SW analysis, for example - Parallel studio –  Thread checking –  Memory checking –  Taint-analysis –  Anti-viruses –  Automated vulnerability classification / analysis –  Deterministic replay –  … •  Do you have tool ideas? Let me know and I might help 7
  • 8. Part 1 - Summary • Instrumentation – a technique to inject code into a program • Dynamic binary instrumentation – what we will focus on today • Instrumentation has tons of uber kwel usages for offense and defense 8
  • 9. Part 2 PIN – A DYNAMIC BINARY INSTRUMENTATION ENGINE 9
  • 10. What Does “Pin” Stand For? • Three Letter Acronyms @ Intel –  TLAs –  263 possible TLAs 3 –  26 -1 are in use at Intel –  Only 1 is not approved for use at Intel –  Guess which one: •  Pin Is Not an acronym 10
  • 11. Pin Instrumentation • Multi-platform: –  Linux –  Windows –  OS X (not supported anymore) • Multi-architecture: –  IA32 –  x86-64 (aka Intel64 / AMD64) –  Itanium (aka IA64, only Linux) –  ARM (not supported anymore) • Robust & Efficient 11
  • 12. Pin availability • Popular and well supported –  40,000+ downloads, 400+ citations • Free Download –  www.pintool.org –  Free for non-commercial use –  Includes: Detailed user manual, source code for 100s of Pin tools • Pin User Group (PinHeads) –  http://tech.groups.yahoo.com/group/pinheads/ –  Pin users and Pin developers answer questions 12
  • 13. Pin and Pin Tools • Pin – the instrumentation engine • Pin Tool – the instrumentation program • Pin provides a framework, the Pin Tool uses the framework to do something meaningful • Pin Tools –  Written in C/C++ using Pin APIs –  Many open source examples provided with the Pin kit –  Certain do’s and dont’s apply 13
  • 14. Instruction Counting Tool #include "pin.h" UINT64 icount = 0; void docount() { icount++; } void Instruction(INS ins, void *v) { INS_InsertCall(ins, IPOINT_BEFORE, (AFUNPTR)docount, IARG_END); } Start void Fini(INT32 code, void *v) { std::cerr << "Count " << icount << endl; } int main(int argc, char * argv[]) { Here PIN_Init(argc, argv); INS_AddInstrumentFunction(Instruction, 0); PIN_AddFiniFunction(Fini, 0); PIN_StartProgram(); // Never returns return 0; } 14
  • 15. Instrumentation vs. Analysis • Instrumentation routines define where instrumentation is inserted – e.g., before instruction C Occurs first time an instruction is executed • Analysis routines define what to do when instrumentation is activated – e.g., increment counter C Occurs every time an instruction is executed 15
  • 16. Instruction Counting Tool #include "pin.h" UINT64 icount = 0; void docount() { icount++; } void Instruction(INS ins, void *v) { INS_InsertCall(ins, IPOINT_BEFORE, (AFUNPTR)docount, IARG_END); } void Fini(INT32 code, void *v) { std::cerr << "Count " << icount << endl; } int main(int argc, char * argv[]) { PIN_Init(argc, argv); INS_AddInstrumentFunction(Instruction, 0); PIN_AddFiniFunction(Fini, 0); PIN_StartProgram(); // Never returns return 0; } 16
  • 17. Instrumentation Granularity • Instruction • Basic Block • Trace • Routine • Section • Image • Process • Thread • Exception 17
  • 18. Instrumentation Points IPOINT_BEFORE Insert a call before an instruction or routine. IPOINT_AFTER Insert a call on the fall thorugh path of an instruction or return path of a routine. IPOINT_ANYWHERE Insert a call anywhere inside a trace or a bbl. IPOINT_TAKEN_BRANCH Insert a call on the taken edge of branch, the side effects of the branch are visible. 18
  • 19. A Better Instruction Counting Tool #include "pin.H" UINT64 icount = 0; void PIN_FAST_ANALYSIS_CALL docount(INT32 c) { icount += c; } void Trace(TRACE trace, void *v){// Pin Callback for(BBL bbl = TRACE_BblHead(trace); BBL_Valid(bbl); bbl = BBL_Next(bbl)) BBL_InsertCall(bbl, IPOINT_ANYWHERE, (AFUNPTR)docount, IARG_FAST_ANALYSIS_CALL, IARG_UINT32, BBL_NumIns(bbl), IARG_END); } void Fini(INT32 code, void *v) {// Pin Callback fprintf(stderr, "Count %lldn", icount); } int main(int argc, char * argv[]) { PIN_Init(argc, argv); TRACE_AddInstrumentFunction(Trace, 0); PIN_AddFiniFunction(Fini, 0); PIN_StartProgram(); return 0; } 19
  • 20. Summary of Part 2 • Pin is a dynamic binary instrumentation engine • Pin is available freely for non-commercial purposes • Pin is the engine, Pin Tools are programs controlling the engine • Instrumentation routines are called once, analysis routines are called every time • There are many levels of granularity –  You should try to use the lowest answering your needs • You can change instrumentation points 20
  • 21. Part 3 A PRACTICAL EXAMPLE CATCHING “DOUBLE-FREE” 21
  • 22. Main + Includes #include "pin.H"   #include <iostream>   #include <iomanip>   #include <algorithm>   #include <list>   int main(int argc, char *argv[])   {   // Initialize pin & symbol manager   PIN_InitSymbols();   PIN_Init(argc,argv);     // Register Image to be called to instrument functions.   IMG_AddInstrumentFunction(Image, 0);     PIN_StartProgram(); // Never returns     return 0;   }   22
  • 23. Instrumentation Routine VOID Image(IMG img, VOID *v) {   // Find the malloc() function and add our function after it   RTN mallocRtn = RTN_FindByName(img, "malloc");   if (RTN_Valid(mallocRtn))   {   RTN_Open(mallocRtn);   RTN_InsertCall(mallocRtn, IPOINT_AFTER, (AFUNPTR)MallocAfter,   IARG_FUNCRET_EXITPOINT_VALUE, IARG_END);   RTN_Close(mallocRtn);   }   // Find the free() function and add our function before it   RTN freeRtn = RTN_FindByName(img, "free");   if (RTN_Valid(freeRtn))   {   RTN_Open(freeRtn);   RTN_InsertCall(freeRtn, IPOINT_BEFORE, (AFUNPTR)FreeBefore,   IARG_ADDRINT, "free",   IARG_FUNCARG_ENTRYPOINT_VALUE, 0,   IARG_END);   RTN_Close(freeRtn);   }   }   23
  • 24. Analysis routines list<ADDRINT> MallocAddrs; VOID MallocAfter(ADDRINT ret) { // Save teh address returned by malloc in our list MallocAddrs.push_back(ret); }   VOID FreeBefore(CHAR * name, ADDRINT target) { list<ADDRINT>::iterator p; p = find(MallocAddrs.begin(), MallocAddrs.end(), target); if (MallocAddrs.end() != p) { p = MallocAddrs.erase(p); } // Delete this from the allocated address list else { // We caught a Free of an un-allocated address cout << hex << target << endl; } // Using cout is not a good practice, I do it for the example only } 24  
  • 25. Summary of part 3 • It is relatively simple to write Pin Tools • Writing a tool to catch double free is very simple and takes less than 50 lines of actual code • Using simple tools we can catch vulnerabilities relatively easily • Did anyone notice the flaw in the tool? 25
  • 26. Part 4 ADVANCED STUFF AND CLOSING NOTES 26
  • 27. Probe mode and JIT mode • JIT Mode – Pin creates a modified copy of the application on- the-fly – Original code never executes Ø More flexible, more common approach • Probe Mode – Pin modifies the original application instructions – Inserts jumps to instrumentation code (trampolines) Ø Lower overhead (less flexible) approach 27
  • 28. Advanced Pin APIs • Transparent debugging and extending the debugger • Attaching and detaching • System call instrumentation • Managing Exceptions and Signals • Instrumenting a process tree • Accessing Decode API • CONTEXT* and IARG_CONST_CONTEXT, IARG_CONTEXT • Fast buffering API • Pin Code-Cache API 28
  • 29. Alternative instrumentation engines •  DyanmoRIO •  Valgrind •  Dtrace •  SystemTap (based on kprobes) •  Frysk •  GDB can also be seen as a DBI •  Bistro (EOL) •  Add your favorite DBI engine here 29
  • 30. Learning more about Pin •  Website – www.pintool.org –  Free Pin kit downloads –  Many open source Pin Tool examples –  An extensive manual –  Links to papers and extensive tutorials given in conferences • PinHeads - Mailing list / newsgroup –  http://tech.groups.yahoo.com/group/pinheads/ 30
  • 31. Call for action •  Start learning and using binary instrumentation •  Create your own Pin Tools and share with the DC9723 community and all the security community •  Did anybody come up with a tool idea? –  Feel free to contact me 31
  • 32. QUESTIONS? Contact details: -  gal.diskin@intel.com -  www.diskin.org 32