SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
Detecting
  Web Browser
Heap Corruption
        Attacks
     Stephan Chenette
          Moti Joseph
Websense Security Labs
Who we are…
 Stephan Chenette
 Manager of Websense Security Research/Senior Researcher,
 Websense Security Labs

 Focus on reverse engineering of malicious web content: obfuscated JavaScript,
 malicious code, malware, packers/protectors.
 Detection techniques: heuristic malware/exploit detection, user-land/kernel-land
 behavior analysis tools, dynamic/static data analysis.

 Previously worked at eEye Digital Security as a Security Software engineer.

 Moti Joseph
 Senior Researcher,
 Websense Security Labs

 Focus on exploitation techniques, reverse engineering, bug hunting, code
 analysis, user-land hooking mechanisms

 Previously worked at Checkpoint
What are we presenting?
 This presentation will focus on our research in the detection of
 browser heap corruption attacks.

 This research inspired an internal tool we call “xmon” (exploitation
 monitor), which is part of a larger malicious web content detection
 network.

 It is important to note, we are presenting detection techniques. We
 will NOT cover in any detail any existing exploitation protection
 measures i.e. DEP, SAFESEH, ASLR, etc.

 We are going to give some background in web browser based heap
 attacks, so if you’ve seen Alexander Sotirov’s presentation (we
 hope you have), then there will be some repetition of background
 information. Hopefully it will reaffirm your understanding of the
 subject.
What do web browser exploits look like?
 At first glance, most malicious web pages simply look like a
 regular webpage
What do web browser exploits look like?
 If we actually look at the source code we can see what is
 really going on… the attacker is using the MS06-071 (XML
 Core Services) vulnerability.
What do heap corruption vulns look like?
 Vulnerability in Vector Markup Language Could Allow
 Remote Code Execution (MS07-004)

 The VML bug was a pure integer overflow vulnerability
What do heap corruption vulns look like?
 Vulnerability in Microsoft XML Core Services Could Allow
 Remote Code Execution (MS06-071)

 The XMLHTTP bug was a double free vulnerability
Heap corruption exploits
 Exploitable heap corruptions are caused when user-
 controllable data can corrupt the heap in a predictable way.

 In order to allow remote code execution, the attacker must
 be able to use this memory corruption to influence the
 instruction pointer.

 Corruption of heap headers and function pointers are two
 common ways this is achieved.
History lesson...
  Older heap exploits were extremely unreliable.

  For a few reasons:
   – Many exploit-writers found heap exploits too hard to
     write or were only accustomed to writing stack based
     overflows, so their proof of concept (POC) were often
     created to simply crash the browser instead of executing
     a payload.

  – Some exploits that were created, used random areas of
    heap memory to store their shellcode (e.g., images,
    movie files, html tags, etc). The location of this data was
    extremely unreliable as memory arrangement and
    location of that data often varied.
More reliability needed… heap spraying.
 Developed by Blazde and SkyLined and first used in a POC
 exploit for the IFRAME SRC NAME heap overflow
 vulnerability.

 This method allowed us to place shellcode onto the heap by
 allocating space on the heap using JavaScript code and
 copying our shellcode to our newly allocated buffer.

 The idea behind this method is to spray enough of the heap
 with NOPs followed by shellcode and then trigger the
 vulnerability which has been set up to jump to the heap.
How reliable is heap spraying?
 Not as reliable as you might think…

 Demo…
The next step in reliable heap exploitation…
  Alexander Sotirov’s “Heap Feng Shui” (HeapLib)
   – Released this year at Blackhat Europe
   – Integrated with Metasploit 3
Commonality
 What do all these methods have in common?

 How can we detect these generically?
Malicious Activity Detection Methods
Large scale exploit detection …. enter xmon

 Generic detection of exploit techniques

 Minimal configuration

 Part of larger framework

 Multiple methods used for detection

 Signatures for optional vulnerability identification only

 Main concerns: speed and accuracy.
Method 1


 Patch all calls to virtual functions and function pointers

  – Use IDA plug-in to scan for pointers

  – Patching is an ongoing process

     • Patch all calls at start

     • Patch calls as modules are loaded dynamically

 When call is made check to see where the execution is
 directed to
Method 2


 Hooking Structured Exception Handlers (SEH)

  – When an exception occurs, verify the location of the
    exception handler
Method X


 Hook all known universal pointers

  – Top-level SEH

  – Fast PEB lock

  – Other global function pointers

 Method X+n?

  – More …
xmon demo

Great. What do we do now?
Honeyclients


 Low-Interaction (LI): Custom Spiders
  – Ridiculously fast, bandwidth primary limitation
  – Special processes required for active content analysis
  – Requires custom signatures, limited detection for
    unknown exploits

 High-Interaction (HI): Controlled Browsers
  – Relatively slow, hardware resources primary limitation
  – Active content handled natively by the browser
  – Traditionally detects malicious activity via unauthorized
    modifications to system state
Traditional High-Interaction Honeyclients
Finding The Middle Ground



 Greatly increase performance levels

 Accurate detection of both known and unknown exploits

 Eliminate the need to monitor or restore system state

 Reduce uncertainty – no more notion of “suspicious”
Honeyclients – Now with xmon!
Problems?



 Not all malicious websites use actual exploits

 Vulnerable control or component not installed

 Uses jmp ptr/technique we haven’t seen before

 Others …

                    Detection in depth
Thank you for coming!


 Questions?



 Contact Info:
  – Stephan Chenette
     • schenette || websense.com


  – Moti Joseph
     • mjoseph || websense.com

Mais conteúdo relacionado

Mais procurados

Introduction to penetration testing
Introduction to penetration testingIntroduction to penetration testing
Introduction to penetration testingAmine SAIGHI
 
DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101dc612
 
Syed Ubaid Ali Jafri - Black Box Penetration testing for Associates
Syed Ubaid Ali Jafri - Black Box Penetration testing for AssociatesSyed Ubaid Ali Jafri - Black Box Penetration testing for Associates
Syed Ubaid Ali Jafri - Black Box Penetration testing for AssociatesSyed Ubaid Ali Jafri
 
Reversing malware analysis training part11 exploit development advanced
Reversing malware analysis training part11 exploit development advancedReversing malware analysis training part11 exploit development advanced
Reversing malware analysis training part11 exploit development advancedCysinfo Cyber Security Community
 
Metasploit (Module-1) - Getting Started With Metasploit
Metasploit (Module-1) - Getting Started With MetasploitMetasploit (Module-1) - Getting Started With Metasploit
Metasploit (Module-1) - Getting Started With MetasploitAnurag Srivastava
 
Reversing malware analysis trainingpart9 advanced malware analysis
Reversing malware analysis trainingpart9 advanced malware analysisReversing malware analysis trainingpart9 advanced malware analysis
Reversing malware analysis trainingpart9 advanced malware analysisCysinfo Cyber Security Community
 
Ceh v8 labs module 11 session hijacking
Ceh v8 labs module 11 session hijackingCeh v8 labs module 11 session hijacking
Ceh v8 labs module 11 session hijackingAsep Sopyan
 
Penetration testing using metasploit
Penetration testing using metasploitPenetration testing using metasploit
Penetration testing using metasploitAashish R
 
Hunting Rootkit From the Dark Corners Of Memory
Hunting Rootkit From the Dark Corners Of MemoryHunting Rootkit From the Dark Corners Of Memory
Hunting Rootkit From the Dark Corners Of Memorysecurityxploded
 
Ceh v8 labs module 02 footprinting and reconnaissance
Ceh v8 labs module 02 footprinting and reconnaissanceCeh v8 labs module 02 footprinting and reconnaissance
Ceh v8 labs module 02 footprinting and reconnaissanceAsep Sopyan
 
The Bash Bug explained !
The Bash Bug explained !The Bash Bug explained !
The Bash Bug explained !Ahmed Banafa
 
Password Stealing & Enhancing User Authentication Using Opass Protocol
Password Stealing & Enhancing User Authentication Using Opass ProtocolPassword Stealing & Enhancing User Authentication Using Opass Protocol
Password Stealing & Enhancing User Authentication Using Opass ProtocolPrasad Pawar
 
Advanced malware analysis training session3 botnet analysis part2
Advanced malware analysis training session3 botnet analysis part2Advanced malware analysis training session3 botnet analysis part2
Advanced malware analysis training session3 botnet analysis part2Cysinfo Cyber Security Community
 
Advanced malware analysis training session 7 malware memory forensics
Advanced malware analysis training session 7 malware memory forensicsAdvanced malware analysis training session 7 malware memory forensics
Advanced malware analysis training session 7 malware memory forensicsCysinfo Cyber Security Community
 
Ceh v8 labs module 04 enumeration
Ceh v8 labs module 04 enumerationCeh v8 labs module 04 enumeration
Ceh v8 labs module 04 enumerationAsep Sopyan
 
Ceh v8 labs module 10 denial of service
Ceh v8 labs module 10 denial of serviceCeh v8 labs module 10 denial of service
Ceh v8 labs module 10 denial of serviceAsep Sopyan
 

Mais procurados (20)

Introduction to penetration testing
Introduction to penetration testingIntroduction to penetration testing
Introduction to penetration testing
 
DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101
 
Syed Ubaid Ali Jafri - Black Box Penetration testing for Associates
Syed Ubaid Ali Jafri - Black Box Penetration testing for AssociatesSyed Ubaid Ali Jafri - Black Box Penetration testing for Associates
Syed Ubaid Ali Jafri - Black Box Penetration testing for Associates
 
Reversing malware analysis training part11 exploit development advanced
Reversing malware analysis training part11 exploit development advancedReversing malware analysis training part11 exploit development advanced
Reversing malware analysis training part11 exploit development advanced
 
Metasploit (Module-1) - Getting Started With Metasploit
Metasploit (Module-1) - Getting Started With MetasploitMetasploit (Module-1) - Getting Started With Metasploit
Metasploit (Module-1) - Getting Started With Metasploit
 
Reversing malware analysis trainingpart9 advanced malware analysis
Reversing malware analysis trainingpart9 advanced malware analysisReversing malware analysis trainingpart9 advanced malware analysis
Reversing malware analysis trainingpart9 advanced malware analysis
 
Ceh v8 labs module 11 session hijacking
Ceh v8 labs module 11 session hijackingCeh v8 labs module 11 session hijacking
Ceh v8 labs module 11 session hijacking
 
Anti-Virus Evasion Techniques and Countermeasures
Anti-Virus Evasion Techniques and CountermeasuresAnti-Virus Evasion Techniques and Countermeasures
Anti-Virus Evasion Techniques and Countermeasures
 
Web application Testing
Web application TestingWeb application Testing
Web application Testing
 
Penetration testing using metasploit
Penetration testing using metasploitPenetration testing using metasploit
Penetration testing using metasploit
 
Hunting Rootkit From the Dark Corners Of Memory
Hunting Rootkit From the Dark Corners Of MemoryHunting Rootkit From the Dark Corners Of Memory
Hunting Rootkit From the Dark Corners Of Memory
 
Ceh v8 labs module 02 footprinting and reconnaissance
Ceh v8 labs module 02 footprinting and reconnaissanceCeh v8 labs module 02 footprinting and reconnaissance
Ceh v8 labs module 02 footprinting and reconnaissance
 
The Bash Bug explained !
The Bash Bug explained !The Bash Bug explained !
The Bash Bug explained !
 
Password Stealing & Enhancing User Authentication Using Opass Protocol
Password Stealing & Enhancing User Authentication Using Opass ProtocolPassword Stealing & Enhancing User Authentication Using Opass Protocol
Password Stealing & Enhancing User Authentication Using Opass Protocol
 
Advanced malware analysis training session3 botnet analysis part2
Advanced malware analysis training session3 botnet analysis part2Advanced malware analysis training session3 botnet analysis part2
Advanced malware analysis training session3 botnet analysis part2
 
Advanced malware analysis training session 7 malware memory forensics
Advanced malware analysis training session 7 malware memory forensicsAdvanced malware analysis training session 7 malware memory forensics
Advanced malware analysis training session 7 malware memory forensics
 
Ceh v8 labs module 04 enumeration
Ceh v8 labs module 04 enumerationCeh v8 labs module 04 enumeration
Ceh v8 labs module 04 enumeration
 
Ceh v8 labs module 10 denial of service
Ceh v8 labs module 10 denial of serviceCeh v8 labs module 10 denial of service
Ceh v8 labs module 10 denial of service
 
Metasploit framwork
Metasploit framworkMetasploit framwork
Metasploit framwork
 
Sembang2 Keselamatan It 2004
Sembang2 Keselamatan It 2004Sembang2 Keselamatan It 2004
Sembang2 Keselamatan It 2004
 

Semelhante a Detecting Web Browser Heap Corruption Attacks - Stephan Chenette, Moti Joseph, Blackhat USA 2007

BSidesJXN 2017 - Improving Vulnerability Management
BSidesJXN 2017 - Improving Vulnerability ManagementBSidesJXN 2017 - Improving Vulnerability Management
BSidesJXN 2017 - Improving Vulnerability ManagementAndrew McNicol
 
Introduction To Ethical Hacking
Introduction To Ethical HackingIntroduction To Ethical Hacking
Introduction To Ethical HackingRaghav Bisht
 
Finalppt metasploit
Finalppt metasploitFinalppt metasploit
Finalppt metasploitdevilback
 
FBI & Secret Service- Business Email Compromise Workshop
FBI & Secret Service- Business Email Compromise WorkshopFBI & Secret Service- Business Email Compromise Workshop
FBI & Secret Service- Business Email Compromise WorkshopErnest Staats
 
Pitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysisPitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysisTamas K Lengyel
 
Stuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedStuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedYury Chemerkin
 
01_Metasploit - The Elixir of Network Security
01_Metasploit - The Elixir of Network Security01_Metasploit - The Elixir of Network Security
01_Metasploit - The Elixir of Network SecurityHarish Chaudhary
 
DEFCON 21: EDS: Exploitation Detection System WP
DEFCON 21: EDS: Exploitation Detection System WPDEFCON 21: EDS: Exploitation Detection System WP
DEFCON 21: EDS: Exploitation Detection System WPAmr Thabet
 
Detection of webshells in compromised perimeter assets using ML algorithms
Detection of webshells in compromised perimeter assets using ML algorithms Detection of webshells in compromised perimeter assets using ML algorithms
Detection of webshells in compromised perimeter assets using ML algorithms Rod Soto
 
B-Sides Seattle 2012 Offensive Defense
B-Sides Seattle 2012 Offensive DefenseB-Sides Seattle 2012 Offensive Defense
B-Sides Seattle 2012 Offensive DefenseStephan Chenette
 
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)Steve Poole
 
AI for Cybersecurity Innovation
AI for Cybersecurity InnovationAI for Cybersecurity Innovation
AI for Cybersecurity InnovationPete Burnap
 
Basic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareBasic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareNatraj G
 
Zane lackey. security at scale. web application security in a continuous depl...
Zane lackey. security at scale. web application security in a continuous depl...Zane lackey. security at scale. web application security in a continuous depl...
Zane lackey. security at scale. web application security in a continuous depl...Yury Chemerkin
 
Final project.ppt
Final project.pptFinal project.ppt
Final project.pptshreyng
 
Exploits Attack on Windows Vulnerabilities
Exploits Attack on Windows VulnerabilitiesExploits Attack on Windows Vulnerabilities
Exploits Attack on Windows VulnerabilitiesAmit Kumbhar
 
BSides Philly Finding a Company's BreakPoint
BSides Philly Finding a Company's BreakPointBSides Philly Finding a Company's BreakPoint
BSides Philly Finding a Company's BreakPointAndrew McNicol
 
Malware 101 by saurabh chaudhary
Malware 101 by saurabh chaudharyMalware 101 by saurabh chaudhary
Malware 101 by saurabh chaudharySaurav Chaudhary
 
BSidesJXN 2016: Finding a Company's BreakPoint
BSidesJXN 2016: Finding a Company's BreakPointBSidesJXN 2016: Finding a Company's BreakPoint
BSidesJXN 2016: Finding a Company's BreakPointAndrew McNicol
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022lior mazor
 

Semelhante a Detecting Web Browser Heap Corruption Attacks - Stephan Chenette, Moti Joseph, Blackhat USA 2007 (20)

BSidesJXN 2017 - Improving Vulnerability Management
BSidesJXN 2017 - Improving Vulnerability ManagementBSidesJXN 2017 - Improving Vulnerability Management
BSidesJXN 2017 - Improving Vulnerability Management
 
Introduction To Ethical Hacking
Introduction To Ethical HackingIntroduction To Ethical Hacking
Introduction To Ethical Hacking
 
Finalppt metasploit
Finalppt metasploitFinalppt metasploit
Finalppt metasploit
 
FBI & Secret Service- Business Email Compromise Workshop
FBI & Secret Service- Business Email Compromise WorkshopFBI & Secret Service- Business Email Compromise Workshop
FBI & Secret Service- Business Email Compromise Workshop
 
Pitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysisPitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysis
 
Stuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learnedStuxnet redux. malware attribution & lessons learned
Stuxnet redux. malware attribution & lessons learned
 
01_Metasploit - The Elixir of Network Security
01_Metasploit - The Elixir of Network Security01_Metasploit - The Elixir of Network Security
01_Metasploit - The Elixir of Network Security
 
DEFCON 21: EDS: Exploitation Detection System WP
DEFCON 21: EDS: Exploitation Detection System WPDEFCON 21: EDS: Exploitation Detection System WP
DEFCON 21: EDS: Exploitation Detection System WP
 
Detection of webshells in compromised perimeter assets using ML algorithms
Detection of webshells in compromised perimeter assets using ML algorithms Detection of webshells in compromised perimeter assets using ML algorithms
Detection of webshells in compromised perimeter assets using ML algorithms
 
B-Sides Seattle 2012 Offensive Defense
B-Sides Seattle 2012 Offensive DefenseB-Sides Seattle 2012 Offensive Defense
B-Sides Seattle 2012 Offensive Defense
 
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
The Anatomy of Java Vulnerabilities (Devoxx UK 2017)
 
AI for Cybersecurity Innovation
AI for Cybersecurity InnovationAI for Cybersecurity Innovation
AI for Cybersecurity Innovation
 
Basic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareBasic Dynamic Analysis of Malware
Basic Dynamic Analysis of Malware
 
Zane lackey. security at scale. web application security in a continuous depl...
Zane lackey. security at scale. web application security in a continuous depl...Zane lackey. security at scale. web application security in a continuous depl...
Zane lackey. security at scale. web application security in a continuous depl...
 
Final project.ppt
Final project.pptFinal project.ppt
Final project.ppt
 
Exploits Attack on Windows Vulnerabilities
Exploits Attack on Windows VulnerabilitiesExploits Attack on Windows Vulnerabilities
Exploits Attack on Windows Vulnerabilities
 
BSides Philly Finding a Company's BreakPoint
BSides Philly Finding a Company's BreakPointBSides Philly Finding a Company's BreakPoint
BSides Philly Finding a Company's BreakPoint
 
Malware 101 by saurabh chaudhary
Malware 101 by saurabh chaudharyMalware 101 by saurabh chaudhary
Malware 101 by saurabh chaudhary
 
BSidesJXN 2016: Finding a Company's BreakPoint
BSidesJXN 2016: Finding a Company's BreakPointBSidesJXN 2016: Finding a Company's BreakPoint
BSidesJXN 2016: Finding a Company's BreakPoint
 
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022The Hacking Games - Operation System Vulnerabilities Meetup 29112022
The Hacking Games - Operation System Vulnerabilities Meetup 29112022
 

Mais de Stephan Chenette

2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing
2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing
2013 Toorcon San Diego Building Custom Android Malware for Penetration TestingStephan Chenette
 
Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Stephan Chenette
 
Automated JavaScript Deobfuscation - PacSec 2007
Automated JavaScript Deobfuscation - PacSec 2007Automated JavaScript Deobfuscation - PacSec 2007
Automated JavaScript Deobfuscation - PacSec 2007Stephan Chenette
 
Web Wreck-utation - CanSecWest 2008
Web Wreck-utation - CanSecWest 2008Web Wreck-utation - CanSecWest 2008
Web Wreck-utation - CanSecWest 2008Stephan Chenette
 
The Ultimate Deobfuscator - ToorCON San Diego 2008
The Ultimate Deobfuscator - ToorCON San Diego 2008The Ultimate Deobfuscator - ToorCON San Diego 2008
The Ultimate Deobfuscator - ToorCON San Diego 2008Stephan Chenette
 
Script Fragmentation - Stephan Chenette - OWASP/RSA 2008
Script Fragmentation - Stephan Chenette - OWASP/RSA 2008Script Fragmentation - Stephan Chenette - OWASP/RSA 2008
Script Fragmentation - Stephan Chenette - OWASP/RSA 2008Stephan Chenette
 

Mais de Stephan Chenette (8)

Landing on Jupyter
Landing on JupyterLanding on Jupyter
Landing on Jupyter
 
2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing
2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing
2013 Toorcon San Diego Building Custom Android Malware for Penetration Testing
 
Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013Building Custom Android Malware BruCON 2013
Building Custom Android Malware BruCON 2013
 
Automated JavaScript Deobfuscation - PacSec 2007
Automated JavaScript Deobfuscation - PacSec 2007Automated JavaScript Deobfuscation - PacSec 2007
Automated JavaScript Deobfuscation - PacSec 2007
 
Web Wreck-utation - CanSecWest 2008
Web Wreck-utation - CanSecWest 2008Web Wreck-utation - CanSecWest 2008
Web Wreck-utation - CanSecWest 2008
 
The Ultimate Deobfuscator - ToorCON San Diego 2008
The Ultimate Deobfuscator - ToorCON San Diego 2008The Ultimate Deobfuscator - ToorCON San Diego 2008
The Ultimate Deobfuscator - ToorCON San Diego 2008
 
Script Fragmentation - Stephan Chenette - OWASP/RSA 2008
Script Fragmentation - Stephan Chenette - OWASP/RSA 2008Script Fragmentation - Stephan Chenette - OWASP/RSA 2008
Script Fragmentation - Stephan Chenette - OWASP/RSA 2008
 
Fireshark - Brucon 2010
Fireshark - Brucon 2010Fireshark - Brucon 2010
Fireshark - Brucon 2010
 

Detecting Web Browser Heap Corruption Attacks - Stephan Chenette, Moti Joseph, Blackhat USA 2007

  • 1. Detecting Web Browser Heap Corruption Attacks Stephan Chenette Moti Joseph Websense Security Labs
  • 2. Who we are… Stephan Chenette Manager of Websense Security Research/Senior Researcher, Websense Security Labs Focus on reverse engineering of malicious web content: obfuscated JavaScript, malicious code, malware, packers/protectors. Detection techniques: heuristic malware/exploit detection, user-land/kernel-land behavior analysis tools, dynamic/static data analysis. Previously worked at eEye Digital Security as a Security Software engineer. Moti Joseph Senior Researcher, Websense Security Labs Focus on exploitation techniques, reverse engineering, bug hunting, code analysis, user-land hooking mechanisms Previously worked at Checkpoint
  • 3. What are we presenting? This presentation will focus on our research in the detection of browser heap corruption attacks. This research inspired an internal tool we call “xmon” (exploitation monitor), which is part of a larger malicious web content detection network. It is important to note, we are presenting detection techniques. We will NOT cover in any detail any existing exploitation protection measures i.e. DEP, SAFESEH, ASLR, etc. We are going to give some background in web browser based heap attacks, so if you’ve seen Alexander Sotirov’s presentation (we hope you have), then there will be some repetition of background information. Hopefully it will reaffirm your understanding of the subject.
  • 4. What do web browser exploits look like? At first glance, most malicious web pages simply look like a regular webpage
  • 5. What do web browser exploits look like? If we actually look at the source code we can see what is really going on… the attacker is using the MS06-071 (XML Core Services) vulnerability.
  • 6. What do heap corruption vulns look like? Vulnerability in Vector Markup Language Could Allow Remote Code Execution (MS07-004) The VML bug was a pure integer overflow vulnerability
  • 7. What do heap corruption vulns look like? Vulnerability in Microsoft XML Core Services Could Allow Remote Code Execution (MS06-071) The XMLHTTP bug was a double free vulnerability
  • 8. Heap corruption exploits Exploitable heap corruptions are caused when user- controllable data can corrupt the heap in a predictable way. In order to allow remote code execution, the attacker must be able to use this memory corruption to influence the instruction pointer. Corruption of heap headers and function pointers are two common ways this is achieved.
  • 9. History lesson... Older heap exploits were extremely unreliable. For a few reasons: – Many exploit-writers found heap exploits too hard to write or were only accustomed to writing stack based overflows, so their proof of concept (POC) were often created to simply crash the browser instead of executing a payload. – Some exploits that were created, used random areas of heap memory to store their shellcode (e.g., images, movie files, html tags, etc). The location of this data was extremely unreliable as memory arrangement and location of that data often varied.
  • 10. More reliability needed… heap spraying. Developed by Blazde and SkyLined and first used in a POC exploit for the IFRAME SRC NAME heap overflow vulnerability. This method allowed us to place shellcode onto the heap by allocating space on the heap using JavaScript code and copying our shellcode to our newly allocated buffer. The idea behind this method is to spray enough of the heap with NOPs followed by shellcode and then trigger the vulnerability which has been set up to jump to the heap.
  • 11. How reliable is heap spraying? Not as reliable as you might think… Demo…
  • 12. The next step in reliable heap exploitation… Alexander Sotirov’s “Heap Feng Shui” (HeapLib) – Released this year at Blackhat Europe – Integrated with Metasploit 3
  • 13. Commonality What do all these methods have in common? How can we detect these generically?
  • 15. Large scale exploit detection …. enter xmon Generic detection of exploit techniques Minimal configuration Part of larger framework Multiple methods used for detection Signatures for optional vulnerability identification only Main concerns: speed and accuracy.
  • 16. Method 1 Patch all calls to virtual functions and function pointers – Use IDA plug-in to scan for pointers – Patching is an ongoing process • Patch all calls at start • Patch calls as modules are loaded dynamically When call is made check to see where the execution is directed to
  • 17. Method 2 Hooking Structured Exception Handlers (SEH) – When an exception occurs, verify the location of the exception handler
  • 18. Method X Hook all known universal pointers – Top-level SEH – Fast PEB lock – Other global function pointers Method X+n? – More …
  • 19. xmon demo Great. What do we do now?
  • 20. Honeyclients Low-Interaction (LI): Custom Spiders – Ridiculously fast, bandwidth primary limitation – Special processes required for active content analysis – Requires custom signatures, limited detection for unknown exploits High-Interaction (HI): Controlled Browsers – Relatively slow, hardware resources primary limitation – Active content handled natively by the browser – Traditionally detects malicious activity via unauthorized modifications to system state
  • 22. Finding The Middle Ground Greatly increase performance levels Accurate detection of both known and unknown exploits Eliminate the need to monitor or restore system state Reduce uncertainty – no more notion of “suspicious”
  • 23. Honeyclients – Now with xmon!
  • 24. Problems? Not all malicious websites use actual exploits Vulnerable control or component not installed Uses jmp ptr/technique we haven’t seen before Others … Detection in depth
  • 25. Thank you for coming! Questions? Contact Info: – Stephan Chenette • schenette || websense.com – Moti Joseph • mjoseph || websense.com