SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
Fermín J. Serna – MSRC Engineering @ Microsoft

EXPLOITS & MITIGATIONS: EMET
Fermín J. Serna – MSRC @ Microsoft

Agenda

 Introduction
   Exploits
   Mitigations
 EMET
   V.1.02 (public available)
   Next version (soon to be available)
 QA
Fermín J. Serna – MSRC @ Microsoft

Introduction

 Who am I?
   Security Engineer at MSRC Engineering React (former
    SWI).
     Technical background of MSRC for externally reported
      security issues: MSo8-67, Aurora IE case …
   HPUX PA-RISC, Solaris SPARC: assembly, shellcode
    and exploit lover.
   Published several docs and exploits: Phrack (58-9) HP-
    UX PA-RISC exploitation techniques long time ago, …
   Developer of a PAX implementation on win32 long
    time ago…
Fermín J. Serna – MSRC @ Microsoft

Exploits

  A bit of history on the windows side…
    Old days were good and easy to write exploits…
      Smash the * for fun and profit: stack, heap, vtable,…
    These days is more difficult but challenges are fun
        Better code…
        Mitigations…
        Mitigations…
        Did I say mitigations?
        No… wait… something is left…


                    Mitigations!!!
Fermín J. Serna – MSRC @ Microsoft

Exploits

  Stack overflows
                         Target SEH record
     0x41414141
     SEH record

   Arguments to the
     0x41414141
       function        Target saved EIP… one
                           return needed
     0x41414141
      Saved EIP

     0x41414141
      Saved EBP        Target saved EBP… two
                           returns needed
 AAAAAAAAAAAAAAA
 AAAAAAAAAAAAAAA
    Local Variables    Target a local variable
                              pointer.
Fermín J. Serna – MSRC @ Microsoft

Exploits

      SEH record overwrite



 N     H     app!_except_handler4   N      H          0x7c1408ac


 N     H     k32!_except_handler4
                                                  pop eax
                                    0x414106eb
                                                  pop eax
0xffffffff                           [jmp +6]
                                                  ret
Fermín J. Serna – MSRC @ Microsoft

Exploits

  Heap overflows
    Target heap structures (unlink exploits)
    Target an object vtable
    Any variable/structure at the heap could be
     interesting for a write AV.
Fermín J. Serna – MSRC @ Microsoft

Exploits

  C++ touch already freed objects
    Somehow object was deleted but there are
     references to it on other objects… (ref counting
     bugs)
    Target vtable calls: call [reg+offset]
    Any member variable at the heap could be
     interesting for a write AV.
Fermín J. Serna – MSRC @ Microsoft

Exploits

  Return oriented programming

   Crash at call [ecx + 100h]
   We assume attacker controls content of [ecx-
     500h,ecx+500h]
   Attacker places at [ecx+100h] some fixed address of:
     mov esp, ecx; «some other non-deref ins»;      ret
   Esp is pointing inside the controlled range
   Next ret will grab arguments and saved eip from controlled
     range.
   Chain of Virtualloc, strcpy, jmp will defeat DEP
   Full ASLR breaks ROP!!!!
Fermín J. Serna – MSRC @ Microsoft

Mitigations

  Had been introduced historically in new OS and its
   Service Packs.
    XPSP2 was a big security push: /SAFESEH, DEP, /GS,
     SAFE Unlinking…
    Server 2k3 SP2: Improved GS
    Vista: User mode ASLR + DEP (big win), heap
     structures encoded
    Vista SP1: Kernel mode ASLR + SEHOP (disabled by
     default)
    Server 2k8: SEHOP (enabled by default)
Fermín J. Serna – MSRC @ Microsoft

Mitigations

 GS (stack cookie)
   Arguments to the            Arguments to the
       function                    function

      Saved EIP                  0x41414141
                                  Saved EIP

      Saved EBP                  0x41414141
                                  Saved EBP

      GS cookie       !=         0x41414141
                                  GS cookie

                            AAAAAAAAAAAAAAA
                            AAAAAAAAAAAAAAA
    Local Variables            Local Variables
Fermín J. Serna – MSRC @ Microsoft

Mitigations

 GS (stack cookie)
   Prevents
     Saved Return address overwrite usage
     Saved EBP overwrite usage
     Local function pointers usage (new /GS)
   Does not prevent
     SEH overwrite usage
     Other local varibles usage
     Weird overwrites MS08-67
Fermín J. Serna – MSRC @ Microsoft

Mitigations

 DEP (Hardware one)
   Processor check check when executing instructions.
   Page’s protection can be RWX (Read, Write and
    Executable) + other properties

    Logic behind:

    if (has_exec_bit((PAGE_PROTECTION(eip))==FALSE)
    {
      Raise_exception();
    }
Fermín J. Serna – MSRC @ Microsoft

Mitigations

 DEP (Hardware one)
   ASLR makes it more robust
   Full ASLR + DEP + no memory leaks = robust
    mitigation

   Prevents
     Placing and executing shellcode at writable pages:
      recv() buffers, javascript strings, …
     Old type of exploits need to be re-written
Fermín J. Serna – MSRC @ Microsoft

Mitigations

 ASLR
  Randomizes:
    Modules base address
    Heap allocations
    Stack base
    TEB address
   …
  Prevents
    Fixed address assumptions…
      F.i. ROP or return into ntdll for DEP bypass
       (Uninformed – technique).
Fermín J. Serna – MSRC @ Microsoft

Mitigations

 ASLR
          Boot 1                  Boot 2                     Boot 3
                                   user32.dll               kernel32.dll
           app.exe
                                                             app.exe
process    user32.dll               ntdll.dll
address
space     kernel32.dll             app.exe                    ntdll.dll


            ntdll.dll                                        user32.dll
                                  kernel32.dll



                         Region           Entropy
                         Image            8 bits
                         Heap             5 bits
                         Stack            14 bits
Fermín J. Serna – MSRC @ Microsoft

Mitigations

 /SAFESEH (also refered as Software DEP)
   When a SEH is called:
     Verifies if SEH record is in executable memory
     Verifies if the SEH function is inside a module
     Also verifies if the function is defined in the module
       Safe SEH table located at the PE binary
   If the PE file was not compiled with /SAFESEH it
    allows the handler execution
     Attackers are taking advantage of this “app compat”
      scenario
    64 bits processes SEH works differently…
Fermín J. Serna – MSRC @ Microsoft

Mitigations

 SEHOP
  32 bits OS mitigation
  When an exception happens the SEH chain is
   verified.
    Last SEH record points to
     ntdll!FinalExceptionHandler? (SEHOP without ASLR
     = no sense)
      Yes? chain is not corrupted
      No? chain is corrupted and could lead to untrusted
       code execution… stop the process!
Fermín J. Serna – MSRC @ Microsoft

Exploits

     SEHOP operation record overwrite


    Valid SEH Chain                                  Invalid SEH Chain
N    H        app!_except_handler4            N       H         app!_main+0x1c

N    H        k32!_except_handler4           0x41414141

            ntdll!FinalExceptionHandle
N    H                    r              ?
                                                  Can’t reach validation frame!
Fermín J. Serna – MSRC @ Microsoft

EMET

 Purpose of EMET:
   Break current exploitation techniques, exploits
    and shellcodes
   Bring to older OS current mitigations
   Per process opt-in
   Test potential future OS mitiations
 Some of the mitigations can by bypassed.
   Yes ,we know… but they will break exploits as they
    are publicly developed currently.
Fermín J. Serna – MSRC @ Microsoft

EMET

 v1.02
   Free (with limited support)
   Published on November
   Mitigations:
     Enable DEP per process
     SEHOP (similar but no the same)
     Common memory pages pre-allocation
Fermín J. Serna – MSRC @ Microsoft

EMET

 DEP per process
   Easy one… enable DEP if SetProcessDepPolicy()
    exists in the system
   API available at XPSP3 +, Vista SP1+ and 2k8/Win7
Fermín J. Serna – MSRC @ Microsoft

EMET

 SEHOP
  Similar to the OS SEHOP version
  OS version final «handler» is
   ntdll!FinalExceptionHandler
  EMET’s version final «record» is at a random
   offset of a random page.
  A Vector Exception Handler (VEH) validates the
   exception chain before any SEH is executed
  Works downlevel!
Fermín J. Serna – MSRC @ Microsoft

EMET

 Common memory pages pre-allocation
   Common browser exloits rely on fixed addresses
    to be allocated… 0x0c0c0c0c, 0x0d0d0d0d, …
   Pages address can be added at the registry
   Pre-allocate them as PAGE_NOACCESS so a heap
    spray cannot get them
   NULL allocation in case a new technique for
    allocating it comes into play
Fermín J. Serna – MSRC @ Microsoft

EMET

 Next version…
   Available soon
   Potential new mitigations in next version:
     EAT Hardware breakpoint mitigation
     Stack pivot mitigation
     Mandatory ASLR
   Some can be circunvented… we know how to do
    it… but breaks a lot of currnet shellcodes/exploits
    
Fermín J. Serna – MSRC @ Microsoft

EMET

 EAT hardware breakpoint mitigation
   Metasploit’s and most shellcodes do:
     Go to the TEB fs:[0]
     Grab a pointer to the PEB TEB[30] – fs:[30]
     Go the Ldr structures at the PEB
       Linked list of loaded modules
       Contains name and image base
     Loop through all modules looking for specific
      exported functions at the Export Addess Table (EAT)
     Once found go to EAT.AddressOffunctions[offset]
      for the address of the required function
Fermín J. Serna – MSRC @ Microsoft

EMET

 EAT hardware breakpoint mitigation
   X86 has 4 debug registers… acting as data
    breakpoints
   On windows 4 per thread since they are saved
    when OS switch to other tasks
   Place a 4 byte read data breakpoint at:
     Kernel32!EAT.AddressOffunctions
     Ntdll!EAT.AddressOfFunctions
   A VEH will monitor accesses to these: single step
    exception
     Is eip inside a module? 
Fermín J. Serna – MSRC @ Microsoft

EMET

 Stack pivot mitigation
   Hook some interesting functions:
    NtAllocateVirtualMemory,
    NtProtectVirtualMemory, LdrLoadDll,
    NtSetInformationProcess, …
   At the hook check:
     Is esp inside the bounds defined at the TEB:
      StackBase, StackLimit?
   Mitigates all aurora exploits I have seen 
Fermín J. Serna – MSRC @ Microsoft

EMET

 Mandatory ASLR
   ASLR aware modules contains DYNAMIC BASE
    on its Dll Characteristics at the PE Header.
   Hook ntdll!LdrLoadDll, check if the module is
    ASLR aware.
     Yes? Allow the dll load
     No? Allocate a page at its imagebase and let the OS
      figure out if it can relocate it 
   Only works for dll loads after EMET has been
    loaded and not for imports…
Fermín J. Serna – MSRC @ Microsoft

Greetings

 Thank you guys!
   MSRC/MSEC (former SWI): Andrew Roths,
    Matt Miller, Damian Hasse and Ken
    Johnson.
Fermín J. Serna – MSRC @ Microsoft

Questions

  Now or...



                      Twitter: fjserna
              http://zhodiac.hispahack.com

Mais conteúdo relacionado

Destaque

MT 69 Tripwire Defense: Advanced Endpoint Detection by a Thousand Tripwires
MT 69 Tripwire Defense: Advanced Endpoint Detection by a Thousand Tripwires MT 69 Tripwire Defense: Advanced Endpoint Detection by a Thousand Tripwires
MT 69 Tripwire Defense: Advanced Endpoint Detection by a Thousand Tripwires Dell EMC World
 
MT54 Better security is better business
MT54 Better security is better businessMT54 Better security is better business
MT54 Better security is better businessDell EMC World
 
How Functions Work
How Functions WorkHow Functions Work
How Functions WorkSaumil Shah
 
Finding Product Market Fit
Finding Product Market FitFinding Product Market Fit
Finding Product Market FitScott Bales
 
Lean Product Management for Enterprises: The Art of Known Unknowns
Lean Product Management for Enterprises: The Art of Known Unknowns Lean Product Management for Enterprises: The Art of Known Unknowns
Lean Product Management for Enterprises: The Art of Known Unknowns Thoughtworks
 
Recommendation system
Recommendation system Recommendation system
Recommendation system Vikrant Arya
 

Destaque (7)

Nethemba - Writing exploits
Nethemba - Writing exploitsNethemba - Writing exploits
Nethemba - Writing exploits
 
MT 69 Tripwire Defense: Advanced Endpoint Detection by a Thousand Tripwires
MT 69 Tripwire Defense: Advanced Endpoint Detection by a Thousand Tripwires MT 69 Tripwire Defense: Advanced Endpoint Detection by a Thousand Tripwires
MT 69 Tripwire Defense: Advanced Endpoint Detection by a Thousand Tripwires
 
MT54 Better security is better business
MT54 Better security is better businessMT54 Better security is better business
MT54 Better security is better business
 
How Functions Work
How Functions WorkHow Functions Work
How Functions Work
 
Finding Product Market Fit
Finding Product Market FitFinding Product Market Fit
Finding Product Market Fit
 
Lean Product Management for Enterprises: The Art of Known Unknowns
Lean Product Management for Enterprises: The Art of Known Unknowns Lean Product Management for Enterprises: The Art of Known Unknowns
Lean Product Management for Enterprises: The Art of Known Unknowns
 
Recommendation system
Recommendation system Recommendation system
Recommendation system
 

Semelhante a Fermín J. Serna - Exploits & Mitigations: EMET [RootedCON 2010]

Memory Attack - The Memory Attack Techniques
Memory Attack - The Memory Attack TechniquesMemory Attack - The Memory Attack Techniques
Memory Attack - The Memory Attack TechniquesUbuntu Korea Community
 
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming BasicsReversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basicssecurityxploded
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Elvin Gentiles
 
OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...
OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...
OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...The Linux Foundation
 
Crash Dump Analysis 101
Crash Dump Analysis 101Crash Dump Analysis 101
Crash Dump Analysis 101John Howard
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingPositive Hack Days
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory AnalysisMoabi.com
 
Low Level Exploits
Low Level ExploitsLow Level Exploits
Low Level Exploitshughpearse
 
Dive into exploit development
Dive into exploit developmentDive into exploit development
Dive into exploit developmentPayampardaz
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory AnalysisMoabi.com
 
[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory AnalysisMoabi.com
 
SEH overwrite and its exploitability
SEH overwrite and its exploitabilitySEH overwrite and its exploitability
SEH overwrite and its exploitabilityFFRI, Inc.
 
Csw2016 economou nissim-getting_physical
Csw2016 economou nissim-getting_physicalCsw2016 economou nissim-getting_physical
Csw2016 economou nissim-getting_physicalCanSecWest
 
Reversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basicsReversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basicsCysinfo Cyber Security Community
 
AllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW SecurityAllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW SecurityAllBits BVBA (freelancer)
 
[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit AutomationMoabi.com
 
The Best Programming Practice for Cell/B.E.
The Best Programming Practice for Cell/B.E.The Best Programming Practice for Cell/B.E.
The Best Programming Practice for Cell/B.E.Slide_N
 

Semelhante a Fermín J. Serna - Exploits & Mitigations: EMET [RootedCON 2010] (20)

Memory Attack - The Memory Attack Techniques
Memory Attack - The Memory Attack TechniquesMemory Attack - The Memory Attack Techniques
Memory Attack - The Memory Attack Techniques
 
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming BasicsReversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
 
OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...
OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...
OSSEU17: How Open Source Project Xen Puts Security Software Vendors Ahead of ...
 
Return Oriented Programming (ROP) Based Exploits - Part I
Return Oriented Programming  (ROP) Based Exploits  - Part IReturn Oriented Programming  (ROP) Based Exploits  - Part I
Return Oriented Programming (ROP) Based Exploits - Part I
 
Crash Dump Analysis 101
Crash Dump Analysis 101Crash Dump Analysis 101
Crash Dump Analysis 101
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
 
Low Level Exploits
Low Level ExploitsLow Level Exploits
Low Level Exploits
 
Dive into exploit development
Dive into exploit developmentDive into exploit development
Dive into exploit development
 
Local Exploits
Local ExploitsLocal Exploits
Local Exploits
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis
 
Advanced Windows Exploitation
Advanced Windows ExploitationAdvanced Windows Exploitation
Advanced Windows Exploitation
 
[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis
 
SEH overwrite and its exploitability
SEH overwrite and its exploitabilitySEH overwrite and its exploitability
SEH overwrite and its exploitability
 
Csw2016 economou nissim-getting_physical
Csw2016 economou nissim-getting_physicalCsw2016 economou nissim-getting_physical
Csw2016 economou nissim-getting_physical
 
Reversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basicsReversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basics
 
AllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW SecurityAllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW Security
 
[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation
 
The Best Programming Practice for Cell/B.E.
The Best Programming Practice for Cell/B.E.The Best Programming Practice for Cell/B.E.
The Best Programming Practice for Cell/B.E.
 

Mais de RootedCON

Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro VillaverdeRooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro VillaverdeRootedCON
 
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...RootedCON
 
Rooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amadoRooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amadoRootedCON
 
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_RootedCON
 
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...RootedCON
 
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...RootedCON
 
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...RootedCON
 
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguerRooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguerRootedCON
 
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...RootedCON
 
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemyRooted2020 stefano maccaglia--_the_enemy_of_my_enemy
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemyRootedCON
 
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...RootedCON
 
Rooted2020 virtual pwned-network_-_manel_molina
Rooted2020 virtual pwned-network_-_manel_molinaRooted2020 virtual pwned-network_-_manel_molina
Rooted2020 virtual pwned-network_-_manel_molinaRootedCON
 
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...RootedCON
 
Rooted2020 todo a-siem_-_marta_lopez
Rooted2020 todo a-siem_-_marta_lopezRooted2020 todo a-siem_-_marta_lopez
Rooted2020 todo a-siem_-_marta_lopezRootedCON
 
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRootedCON
 
Rooted2020 live coding--_jesus_jara
Rooted2020 live coding--_jesus_jaraRooted2020 live coding--_jesus_jara
Rooted2020 live coding--_jesus_jaraRootedCON
 
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...RootedCON
 
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...RootedCON
 
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste
Rooted2020 evading deep-learning_malware_detectors_-_javier_yusteRooted2020 evading deep-learning_malware_detectors_-_javier_yuste
Rooted2020 evading deep-learning_malware_detectors_-_javier_yusteRootedCON
 
Rooted2020 encontrando 0days-en_2020_-_antonio_morales
Rooted2020 encontrando 0days-en_2020_-_antonio_moralesRooted2020 encontrando 0days-en_2020_-_antonio_morales
Rooted2020 encontrando 0days-en_2020_-_antonio_moralesRootedCON
 

Mais de RootedCON (20)

Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro VillaverdeRooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
Rooted2020 A clockwork pentester - Jose Carlos Moral & Alvaro Villaverde
 
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
rooted2020 Sandbox fingerprinting -_evadiendo_entornos_de_analisis_-_victor_c...
 
Rooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amadoRooted2020 hunting malware-using_process_behavior-roberto_amado
Rooted2020 hunting malware-using_process_behavior-roberto_amado
 
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
Rooted2020 compliance as-code_-_guillermo_obispo_-_jose_mariaperez_-_
 
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
Rooted2020 the day i_ruled_the_world_deceiving_software_developers_through_op...
 
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
Rooted2020 si la-empresa_ha_ocultado_el_ciberataque,_como_se_ha_enterado_el_r...
 
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
Rooted2020 wordpress-another_terror_story_-_manuel_garcia_-_jacinto_sergio_ca...
 
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguerRooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
Rooted2020 Atacando comunicaciones-de_voz_cifradas_-_jose_luis_verdeguer
 
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
rooted2020-Rootkit necurs no_es_un_bug,_es_una_feature_-_roberto_santos_-_jav...
 
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemyRooted2020 stefano maccaglia--_the_enemy_of_my_enemy
Rooted2020 stefano maccaglia--_the_enemy_of_my_enemy
 
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
Rooted2020 taller de-reversing_de_binarios_escritos_en_golang_-_mariano_palom...
 
Rooted2020 virtual pwned-network_-_manel_molina
Rooted2020 virtual pwned-network_-_manel_molinaRooted2020 virtual pwned-network_-_manel_molina
Rooted2020 virtual pwned-network_-_manel_molina
 
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
Rooted2020 van a-mear_sangre_como_hacer_que_los_malos_lo_paguen_muy_caro_-_an...
 
Rooted2020 todo a-siem_-_marta_lopez
Rooted2020 todo a-siem_-_marta_lopezRooted2020 todo a-siem_-_marta_lopez
Rooted2020 todo a-siem_-_marta_lopez
 
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valeroRooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
Rooted2020 roapt evil-mass_storage_-_tu-ya_aqui_-_david_reguera_-_abel_valero
 
Rooted2020 live coding--_jesus_jara
Rooted2020 live coding--_jesus_jaraRooted2020 live coding--_jesus_jara
Rooted2020 live coding--_jesus_jara
 
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
Rooted2020 legalidad de-la_prueba_tecnologica_indiciaria_cuando_tu_papi_es_un...
 
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
Rooted2020 hackeando el-mundo_exterior_a_traves_de_bluetooth_low-energy_ble_-...
 
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste
Rooted2020 evading deep-learning_malware_detectors_-_javier_yusteRooted2020 evading deep-learning_malware_detectors_-_javier_yuste
Rooted2020 evading deep-learning_malware_detectors_-_javier_yuste
 
Rooted2020 encontrando 0days-en_2020_-_antonio_morales
Rooted2020 encontrando 0days-en_2020_-_antonio_moralesRooted2020 encontrando 0days-en_2020_-_antonio_morales
Rooted2020 encontrando 0days-en_2020_-_antonio_morales
 

Último

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Último (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

Fermín J. Serna - Exploits & Mitigations: EMET [RootedCON 2010]

  • 1. Fermín J. Serna – MSRC Engineering @ Microsoft EXPLOITS & MITIGATIONS: EMET
  • 2. Fermín J. Serna – MSRC @ Microsoft Agenda  Introduction  Exploits  Mitigations  EMET  V.1.02 (public available)  Next version (soon to be available)  QA
  • 3. Fermín J. Serna – MSRC @ Microsoft Introduction  Who am I?  Security Engineer at MSRC Engineering React (former SWI).  Technical background of MSRC for externally reported security issues: MSo8-67, Aurora IE case …  HPUX PA-RISC, Solaris SPARC: assembly, shellcode and exploit lover.  Published several docs and exploits: Phrack (58-9) HP- UX PA-RISC exploitation techniques long time ago, …  Developer of a PAX implementation on win32 long time ago…
  • 4. Fermín J. Serna – MSRC @ Microsoft Exploits  A bit of history on the windows side…  Old days were good and easy to write exploits…  Smash the * for fun and profit: stack, heap, vtable,…  These days is more difficult but challenges are fun  Better code…  Mitigations…  Mitigations…  Did I say mitigations?  No… wait… something is left… Mitigations!!!
  • 5. Fermín J. Serna – MSRC @ Microsoft Exploits  Stack overflows Target SEH record 0x41414141 SEH record Arguments to the 0x41414141 function Target saved EIP… one return needed 0x41414141 Saved EIP 0x41414141 Saved EBP Target saved EBP… two returns needed AAAAAAAAAAAAAAA AAAAAAAAAAAAAAA Local Variables Target a local variable pointer.
  • 6. Fermín J. Serna – MSRC @ Microsoft Exploits  SEH record overwrite N H app!_except_handler4 N H 0x7c1408ac N H k32!_except_handler4 pop eax 0x414106eb pop eax 0xffffffff [jmp +6] ret
  • 7. Fermín J. Serna – MSRC @ Microsoft Exploits  Heap overflows  Target heap structures (unlink exploits)  Target an object vtable  Any variable/structure at the heap could be interesting for a write AV.
  • 8. Fermín J. Serna – MSRC @ Microsoft Exploits  C++ touch already freed objects  Somehow object was deleted but there are references to it on other objects… (ref counting bugs)  Target vtable calls: call [reg+offset]  Any member variable at the heap could be interesting for a write AV.
  • 9. Fermín J. Serna – MSRC @ Microsoft Exploits  Return oriented programming Crash at call [ecx + 100h] We assume attacker controls content of [ecx- 500h,ecx+500h] Attacker places at [ecx+100h] some fixed address of: mov esp, ecx; «some other non-deref ins»; ret Esp is pointing inside the controlled range Next ret will grab arguments and saved eip from controlled range. Chain of Virtualloc, strcpy, jmp will defeat DEP Full ASLR breaks ROP!!!!
  • 10. Fermín J. Serna – MSRC @ Microsoft Mitigations  Had been introduced historically in new OS and its Service Packs.  XPSP2 was a big security push: /SAFESEH, DEP, /GS, SAFE Unlinking…  Server 2k3 SP2: Improved GS  Vista: User mode ASLR + DEP (big win), heap structures encoded  Vista SP1: Kernel mode ASLR + SEHOP (disabled by default)  Server 2k8: SEHOP (enabled by default)
  • 11. Fermín J. Serna – MSRC @ Microsoft Mitigations  GS (stack cookie) Arguments to the Arguments to the function function Saved EIP 0x41414141 Saved EIP Saved EBP 0x41414141 Saved EBP GS cookie != 0x41414141 GS cookie AAAAAAAAAAAAAAA AAAAAAAAAAAAAAA Local Variables Local Variables
  • 12. Fermín J. Serna – MSRC @ Microsoft Mitigations  GS (stack cookie)  Prevents  Saved Return address overwrite usage  Saved EBP overwrite usage  Local function pointers usage (new /GS)  Does not prevent  SEH overwrite usage  Other local varibles usage  Weird overwrites MS08-67
  • 13. Fermín J. Serna – MSRC @ Microsoft Mitigations  DEP (Hardware one)  Processor check check when executing instructions.  Page’s protection can be RWX (Read, Write and Executable) + other properties Logic behind: if (has_exec_bit((PAGE_PROTECTION(eip))==FALSE) { Raise_exception(); }
  • 14. Fermín J. Serna – MSRC @ Microsoft Mitigations  DEP (Hardware one)  ASLR makes it more robust  Full ASLR + DEP + no memory leaks = robust mitigation  Prevents  Placing and executing shellcode at writable pages: recv() buffers, javascript strings, …  Old type of exploits need to be re-written
  • 15. Fermín J. Serna – MSRC @ Microsoft Mitigations  ASLR  Randomizes:  Modules base address  Heap allocations  Stack base  TEB address …  Prevents  Fixed address assumptions…  F.i. ROP or return into ntdll for DEP bypass (Uninformed – technique).
  • 16. Fermín J. Serna – MSRC @ Microsoft Mitigations  ASLR Boot 1 Boot 2 Boot 3 user32.dll kernel32.dll app.exe app.exe process user32.dll ntdll.dll address space kernel32.dll app.exe ntdll.dll ntdll.dll user32.dll kernel32.dll Region Entropy Image 8 bits Heap 5 bits Stack 14 bits
  • 17. Fermín J. Serna – MSRC @ Microsoft Mitigations  /SAFESEH (also refered as Software DEP)  When a SEH is called:  Verifies if SEH record is in executable memory  Verifies if the SEH function is inside a module  Also verifies if the function is defined in the module Safe SEH table located at the PE binary  If the PE file was not compiled with /SAFESEH it allows the handler execution  Attackers are taking advantage of this “app compat” scenario 64 bits processes SEH works differently…
  • 18. Fermín J. Serna – MSRC @ Microsoft Mitigations  SEHOP  32 bits OS mitigation  When an exception happens the SEH chain is verified.  Last SEH record points to ntdll!FinalExceptionHandler? (SEHOP without ASLR = no sense)  Yes? chain is not corrupted  No? chain is corrupted and could lead to untrusted code execution… stop the process!
  • 19. Fermín J. Serna – MSRC @ Microsoft Exploits  SEHOP operation record overwrite Valid SEH Chain Invalid SEH Chain N H app!_except_handler4 N H app!_main+0x1c N H k32!_except_handler4 0x41414141 ntdll!FinalExceptionHandle N H r ? Can’t reach validation frame!
  • 20. Fermín J. Serna – MSRC @ Microsoft EMET  Purpose of EMET:  Break current exploitation techniques, exploits and shellcodes  Bring to older OS current mitigations  Per process opt-in  Test potential future OS mitiations  Some of the mitigations can by bypassed.  Yes ,we know… but they will break exploits as they are publicly developed currently.
  • 21. Fermín J. Serna – MSRC @ Microsoft EMET  v1.02  Free (with limited support)  Published on November  Mitigations:  Enable DEP per process  SEHOP (similar but no the same)  Common memory pages pre-allocation
  • 22. Fermín J. Serna – MSRC @ Microsoft EMET  DEP per process  Easy one… enable DEP if SetProcessDepPolicy() exists in the system  API available at XPSP3 +, Vista SP1+ and 2k8/Win7
  • 23. Fermín J. Serna – MSRC @ Microsoft EMET  SEHOP  Similar to the OS SEHOP version  OS version final «handler» is ntdll!FinalExceptionHandler  EMET’s version final «record» is at a random offset of a random page.  A Vector Exception Handler (VEH) validates the exception chain before any SEH is executed  Works downlevel!
  • 24. Fermín J. Serna – MSRC @ Microsoft EMET  Common memory pages pre-allocation  Common browser exloits rely on fixed addresses to be allocated… 0x0c0c0c0c, 0x0d0d0d0d, …  Pages address can be added at the registry  Pre-allocate them as PAGE_NOACCESS so a heap spray cannot get them  NULL allocation in case a new technique for allocating it comes into play
  • 25. Fermín J. Serna – MSRC @ Microsoft EMET  Next version…  Available soon  Potential new mitigations in next version:  EAT Hardware breakpoint mitigation  Stack pivot mitigation  Mandatory ASLR  Some can be circunvented… we know how to do it… but breaks a lot of currnet shellcodes/exploits 
  • 26. Fermín J. Serna – MSRC @ Microsoft EMET  EAT hardware breakpoint mitigation  Metasploit’s and most shellcodes do:  Go to the TEB fs:[0]  Grab a pointer to the PEB TEB[30] – fs:[30]  Go the Ldr structures at the PEB  Linked list of loaded modules  Contains name and image base  Loop through all modules looking for specific exported functions at the Export Addess Table (EAT)  Once found go to EAT.AddressOffunctions[offset] for the address of the required function
  • 27. Fermín J. Serna – MSRC @ Microsoft EMET  EAT hardware breakpoint mitigation  X86 has 4 debug registers… acting as data breakpoints  On windows 4 per thread since they are saved when OS switch to other tasks  Place a 4 byte read data breakpoint at:  Kernel32!EAT.AddressOffunctions  Ntdll!EAT.AddressOfFunctions  A VEH will monitor accesses to these: single step exception  Is eip inside a module? 
  • 28. Fermín J. Serna – MSRC @ Microsoft EMET  Stack pivot mitigation  Hook some interesting functions: NtAllocateVirtualMemory, NtProtectVirtualMemory, LdrLoadDll, NtSetInformationProcess, …  At the hook check:  Is esp inside the bounds defined at the TEB: StackBase, StackLimit?  Mitigates all aurora exploits I have seen 
  • 29. Fermín J. Serna – MSRC @ Microsoft EMET  Mandatory ASLR  ASLR aware modules contains DYNAMIC BASE on its Dll Characteristics at the PE Header.  Hook ntdll!LdrLoadDll, check if the module is ASLR aware.  Yes? Allow the dll load  No? Allocate a page at its imagebase and let the OS figure out if it can relocate it   Only works for dll loads after EMET has been loaded and not for imports…
  • 30. Fermín J. Serna – MSRC @ Microsoft Greetings  Thank you guys!  MSRC/MSEC (former SWI): Andrew Roths, Matt Miller, Damian Hasse and Ken Johnson.
  • 31. Fermín J. Serna – MSRC @ Microsoft Questions Now or... Twitter: fjserna http://zhodiac.hispahack.com