SlideShare a Scribd company logo
Novell GroupWise 2012
      Multiple Untrusted Pointer Dereferences Exploitation




April 3th, 2013
Brian MARIANI & Frédéric BOURLA
                           ©2013 High-Tech Bridge SA – www.htbridge.com
TIMELINE


     On the 24th of November 2012, High-Tech Bridge Security Research Lab
      discovered multiple vulnerabilities in Novell GroupWise 2012.

     On the 26th November 2012, High-Tech Bridge Security Research Lab informed
      Novell about these vulnerabilities which existed in two core ActiveX modules.

     On the 30th January 2013, Novell published a security bulletin and released a
      security patch.

     Finally, on the 3rd April 2013 High-Tech Bridge Security Research Lab disclosed
      the vulnerability details.

     This paper is a technical explanation of the latter vulnerability and its
      exploitation.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
ABOUT NOVELL GROUPWISE


     According to Wikipedia:

        GroupWise is a messaging and collaborative software platform from Novell
         Inc. that supports email, calendaring, personal information management,
         instant messaging, and document management.

        The platform consists of the client software, which is available for Windows,
         Mac OS X, Linux, and the server software part which is supported on
         Windows Server, NetWare and Linux systems.

        The latest generation of the platform is GroupWise 2012 which only
         supports Windows and Linux servers.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
THE VULNERABILITIES


     The vulnerabilities exist in the gwmim1.ocx and gwabdlg.dll libraries.

     In order to trigger the flaw one should pass a non properly initialized value to
      the vulnerable methods.

     By default any long integer value is assumed to be a proper initialized pointer.
      This permit to provide a fake pointer to some of the methods and hijack the
      control flow of the application by redirecting it to a malicious code.

     The vulnerability can be abused by preparing the heap area with predictable
      memory addresses before the bug is triggered.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
COMMON WEAKNESS ENUMERATION


       In accordance to MITRE:

          The Common Weakness Enumeration is a formal list of software
           weakness types created to:

             • Serve as a common language for describing software security weaknesses in
               architecture, design or code.

             • Serve as a standard measuring stick for software security tools targeting these
               weaknesses.

             • Provide a common baseline standard for weakness identification, mitigation and
               prevention efforts.


       On the of 20th August 2012 High-Tech Bridge Security Research Lab obtained
        CWE-Compatible Status by MITRE.

       This vulnerability was categorized by the weakness ID Untrusted Pointer
        Dereference [CWE-822].


                               ©2013 High-Tech Bridge SA – www.htbridge.com
UNTRUSTED POINTER DEREFERENCE


     According to MITRE, an untrusted pointer dereference vulnerability is present
      when:

           An attacker can inject a pointer for memory locations that the
            program is not expecting.

           If the pointer is dereferenced for a write operation, the attack might
            allow modification of critical program state variables, cause a crash or
            execute code.

           If the dereferencing operation is for a read, then the attack might allow
            reading of sensitive data, cause a crash or set a program variable to an
            unexpected value since it will be read from an unexpected memory
            location.




                           ©2013 High-Tech Bridge SA – www.htbridge.com
MORE DETAILS ABOUT THE ISSUE


     Novell GroupWise crashes at three different methods within two modules.

     The involved modules are gwabdlg.dll and gwmim1.ocx.

     The faulty methods names are InvokeContact, GenerateSummaryPage and
      SecManageRecipientCertificates.

     We will only analyse the issues in the SecManageRecipientCertificates and
      InvokeContact methods.

     This is because the InvokeContact and GenerateSummary methods crash at
      the same area. Moreover, the exploitation technique used to leverage the
      vulnerability is the same.

     The configuration lab we used is an English Windows XP SP3 operating
      system (DEP disabled) with Internet Explorer 8.




                           ©2013 High-Tech Bridge SA – www.htbridge.com
PROOF OF CONCEPT CRASH (1)


     Here is a working proof of concept in order to crash Internet Explorer by passing
      a custom pointer to the InvokeContact method.




                             ©2013 High-Tech Bridge SA – www.htbridge.com
PROOF OF CONCEPT CRASH (2)


     The following proof of concept crashes Internet Explorer by passing a fake
      pointer to the SecManageRecipientCertificates method.




                           ©2013 High-Tech Bridge SA – www.htbridge.com
SecManageRecipientCertificates case (1)

      Let’s first analyze the SecManageRecipientCertificates case as this is the
       simpler one.

      In the following screenshot we can observe the crash from WinDBG after
       executing the proof of concept on one of the previous slides:




      We can clearly spot that the crash took place at the address 0x10014805 when
       the code attempts to move the value of the uninitialized pointer into the EDX
       register.

      This one was provided as a long data type (202116108), therefore (0xc0c0c0c)
       in hexadecimal format.



                            ©2013 High-Tech Bridge SA – www.htbridge.com
SecManageRecipientCertificates case (2)


      So far we have a function that crashes when reading a memory address of our
       choice.

      All that we need in order to turn the odds in our favor and maximize the
       chances of exploitation is that the code instructions that follow permit us in
       someway to take control of code execution.

      In this particular instance, after dissasembling the faulty function, we can
       observe at the memory address 0x10014807 that the value hold by our pointer
       is moved into the EAX register.

      Eventually, a CALL EAX instruction at the address 0x10014809 will terminate
       the game.




                             ©2013 High-Tech Bridge SA – www.htbridge.com
HEAP SPRAYING


     In order to exploit this particular vulnerability we need to spray the heap area on
      Internet Explorer in a reliable and precise way.

     Before the bug is triggered the heap must be already prepared in order to
      contain the or al,0x0C sled which leads to arbitrary code execution.

     The or al,0x0C instruction does not affects any critical data which could stop
      code execution.

     The goal is to "slide" the flow of code to its final destination.

     Since the shellcode is sitting in multiple chunks in the heap right after the or
      al,0x0C sled the probability of arbitrary code execution is very high.

     Please check the Microsoft XML issue video for more information on this
      exploitation technique.




                               ©2013 High-Tech Bridge SA – www.htbridge.com
WINDBG AFTER THE HEAP SPRAYING EXPLOIT (1)


      Here is a screenshot of the most important part of the exploit:




                              ©2013 High-Tech Bridge SA – www.htbridge.com
WINDBG AFTER THE HEAP SPRAYING EXPLOIT (2)


      The following screenshot shows the state of registers under Windbg after the
       exploit is executed:




      We can clearly observe that instruction pointer register was successfully
       hijacked.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (1)


     As we said on slide 10, finding the way to exploit                          the
      SecManageRecipientCertificates method was les complex than                  the
      InvokeContact one.

     When we run the InvokeContact proof of concept, one would be tempted to
      conclude that this is just a local denial of service.




     However, since the attacker can control the EAX register he could influence
      the code logic and to enter what seems to be a switch structure.

     This means that it would be possible to coerce the code to enter into one of the
      six available cases, so as to potentially increase our chances of successful
      exploitation.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (2)

     Here is the switch structure containing the six different cases:




     In order to go beyond this crash, we need to provide a memory address as a pointer,
      and from this address plus 4 bytes we supply a dword value who will be the case
      number in which we would like to enter.

     In order to accomplish this task one would need to rely over a previously known
      address in memory.

     If we use a precise heap spraying technique, we can count on the 0xc0c0c0c
      address.



                              ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (3)


     After studying the exploitation opportunities that are available to us, we found
      that at least one of the six cases permits arbitrary code execution.

     The following screenshot shows the code instructions when the third case is
      executed:




     Let’s summarize the entire process starting from the injected pointer until code
      execution is reached.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (4)


     We place a breakpoint at the Oleaut32!DispCallFunc function and a second
      one at the first CALL ECX instruction situated some bytes farther. The second
      breakpoint is the instruction who calls the method in which we are interested.

     After the second break, the code points to the memory address 0x572146b7.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (5)


     The code pushes into the stack the improper pointer. At this moment we can
      observe the reference to the XisDOMAttributeList function.




     After the CALL instruction at the address 0x5722D83E, the code continues and
      pushes again the uninitialized value at the address 0x5722d861 who enters in
      one more nested function.




                           ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (6)


     When the code comes into this function the uninitialized pointer is compared to
      0. As the pointer’s value is equal to c0c0c0c the conditional jump at address
      0x5722D2E8 is not taken.

     Later, the untrusted pointer is moved into the EAX register at the address
      0x5722D2FE.

     At 0x5722D301 address we reach the instruction where the code reads the
      value of the EAX register plus four bytes. This corresponds to the case in
      which it will enter.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (7)


     In order to push the code to enter into the case three, we sprayed the heap
      so as to allocate perfect sized and consecutive chunks.

     If we take care of the chunks size and the blocks size, we can be pretty sure
      that the begin of each spray block will be positioned at a predictable address.

     Here is the sprayed data starting at the address 0xc0c0c0c:




     Consult the document Heap Spraying Demystified under the section Precision
      Heap Spraying from Corelan for more information.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (8)


     Because the heap spray was very precise, the code reads and stores our
      desired value into the stack at the address 0x5722D304.




     This permits us to go beyond the previous crash and enter into the function at
      the address 0x5722d4b4.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (9)


     The untrusted pointer is stored in the stack and will be reused later in order
      to call another private method from the vftable.




                            ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (10)


     Later the code dereferences twice the EAX register at the addresses
      0x5722D4CA and 0x5722D4D3.




     So as to successfully slide the code up to the shellcode, the exploit needs to
      spray accurately the heap with three pointers:




     The shellcode sits right after the 0xc0c0c48 pointer.



                             ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (11)


     This is therefore the final payload for the exploit:




                              ©2013 High-Tech Bridge SA – www.htbridge.com
THE INVOKECONTACT METHOD CASE (12)


     Code execution is reached:




                           ©2013 High-Tech Bridge SA – www.htbridge.com
References & Links


      http://www.youtube.com/watch?v=hNDjRLoN8ug (Exploitation Video)

      https://www.htbridge.com/publication/Novell-GroupWise-exploit.rar      (password:
       htbridge)

      https://www.corelan.be/index.php/2011/12/31/exploit-writing-tutorial-part-11-
       heap-spraying demystified/#Heap_Spraying_on_Internet_Explorer_9

      http://cwe.mitre.org/data/definitions/822.html

      https://www.htbridge.com/vulnerability/

      http://en.wikipedia.org/wiki/Novell_GroupWise




                              ©2013 High-Tech Bridge SA – www.htbridge.com
Thank you for reading




            Your questions are always welcome:

                    brian.mariani [at] htbridge.com
                   frederic.bourla [at] htbridge.com




                  ©2013 High-Tech Bridge SA – www.htbridge.com

More Related Content

PDF
Web app security - owasp top 10
PDF
Spring Roo Rev005
PPT
First Steps in Android
PDF
PDF
In-Memory Fuzzing with Java (Publication from High-Tech Bridge)
PDF
Automated Detection of Session Fixation Vulnerabilities
PPT
Animals in danger
PPTX
Final idea
Web app security - owasp top 10
Spring Roo Rev005
First Steps in Android
In-Memory Fuzzing with Java (Publication from High-Tech Bridge)
Automated Detection of Session Fixation Vulnerabilities
Animals in danger
Final idea

Viewers also liked (20)

PPTX
PDF
Галимуллина Н.М., Коршунова О.Н. Коммуникационные инструменты исполнительной ...
PDF
Masgnb seminar itr_2013-program
PPTX
Pengenalan Kepada Teknologi Multimedia Part 3
PPTX
Fuego domingo
PPTX
Production log continuted
PPT
Pembelajaran bi
ODP
I dati più curiosi di facebook
PDF
Market Snapshot-23/11/2012
PPT
presentation slides
PPTX
Proiectele eTwinning cale spre cunoasterea culturii europene
PPTX
Forgiveness
PPTX
Food of the future
PPTX
Chapter 1 elements of nuclear physics
PPTX
PDF
Social media & organisations - A presentation for AmCham Belgium
PDF
Business snapshots
PPTX
Grammar book#2
DOC
Mrs craig final exam 3
PDF
Els presocrátics (físics)
Галимуллина Н.М., Коршунова О.Н. Коммуникационные инструменты исполнительной ...
Masgnb seminar itr_2013-program
Pengenalan Kepada Teknologi Multimedia Part 3
Fuego domingo
Production log continuted
Pembelajaran bi
I dati più curiosi di facebook
Market Snapshot-23/11/2012
presentation slides
Proiectele eTwinning cale spre cunoasterea culturii europene
Forgiveness
Food of the future
Chapter 1 elements of nuclear physics
Social media & organisations - A presentation for AmCham Belgium
Business snapshots
Grammar book#2
Mrs craig final exam 3
Els presocrátics (físics)
Ad

Similar to Novell GroupWise Multiple Untrusted Pointer Dereferences Exploitation (20)

PDF
CVE 2012-1889 Microsoft XML core services uninitialized memory vulnerability
PDF
Exploit Next Generation®: Missão dada é missão cumprida!
PDF
[PH-Neutral 0x7db] Exploit Next Generation®
PPTX
Exploitation techniques and fuzzing
PPT
B-Sides Seattle 2012 Offensive Defense
ODP
Debugging With Id
PPTX
Vulnerability, exploit to metasploit
PDF
[USENIX-WOOT] Introduction to Procedural Debugging through Binary Libification
PDF
Real_World_0days.pdf
PDF
Advanced Windows Exploitation
PDF
Exploitation and State Machines
PDF
Malicious File for Exploiting Forensic Software
PPT
Douglas Crockford - Ajax Security
PPT
Software Security Testing
PPTX
Reversing malware analysis training part10 exploit development basics
PDF
Manipulating Memory for Fun and Profit
PDF
Manipulating memory for fun and profit
PDF
Manipulating memory for fun and profit
PDF
Manipulating Memory for Fun & Profit
PPT
Whittaker How To Break Software Security - SoftTest Ireland
CVE 2012-1889 Microsoft XML core services uninitialized memory vulnerability
Exploit Next Generation®: Missão dada é missão cumprida!
[PH-Neutral 0x7db] Exploit Next Generation®
Exploitation techniques and fuzzing
B-Sides Seattle 2012 Offensive Defense
Debugging With Id
Vulnerability, exploit to metasploit
[USENIX-WOOT] Introduction to Procedural Debugging through Binary Libification
Real_World_0days.pdf
Advanced Windows Exploitation
Exploitation and State Machines
Malicious File for Exploiting Forensic Software
Douglas Crockford - Ajax Security
Software Security Testing
Reversing malware analysis training part10 exploit development basics
Manipulating Memory for Fun and Profit
Manipulating memory for fun and profit
Manipulating memory for fun and profit
Manipulating Memory for Fun & Profit
Whittaker How To Break Software Security - SoftTest Ireland
Ad

More from High-Tech Bridge SA (HTBridge) (12)

PDF
Welcome in the World Wild Web
PDF
Fuzzing: An introduction to Sulley Framework
PDF
Cybercrime in nowadays businesses - A real case study of targeted attack
PDF
Spying Internet Explorer 8.0
PDF
Frontal Attacks - From basic compromise to Advanced Persistent Threat
PDF
Inline Hooking in Windows
PDF
Userland Hooking in Windows
PDF
Defeating Data Execution Prevention and ASLR in Windows
PDF
Structured Exception Handler Exploitation
PDF
Fake malware and virus scanners
PDF
Become fully aware of the potential dangers of ActiveX attacks
PDF
Client-side threats - Anatomy of Reverse Trojan attacks
Welcome in the World Wild Web
Fuzzing: An introduction to Sulley Framework
Cybercrime in nowadays businesses - A real case study of targeted attack
Spying Internet Explorer 8.0
Frontal Attacks - From basic compromise to Advanced Persistent Threat
Inline Hooking in Windows
Userland Hooking in Windows
Defeating Data Execution Prevention and ASLR in Windows
Structured Exception Handler Exploitation
Fake malware and virus scanners
Become fully aware of the potential dangers of ActiveX attacks
Client-side threats - Anatomy of Reverse Trojan attacks

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Mushroom cultivation and it's methods.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation theory and applications.pdf
PDF
August Patch Tuesday
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
Programs and apps: productivity, graphics, security and other tools
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Mushroom cultivation and it's methods.pdf
NewMind AI Weekly Chronicles - August'25-Week II
OMC Textile Division Presentation 2021.pptx
Chapter 5: Probability Theory and Statistics
Agricultural_Statistics_at_a_Glance_2022_0.pdf
1. Introduction to Computer Programming.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation theory and applications.pdf
August Patch Tuesday
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Hindi spoken digit analysis for native and non-native speakers
Unlocking AI with Model Context Protocol (MCP)
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Web App vs Mobile App What Should You Build First.pdf
WOOl fibre morphology and structure.pdf for textiles
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
A comparative study of natural language inference in Swahili using monolingua...

Novell GroupWise Multiple Untrusted Pointer Dereferences Exploitation

  • 1. Novell GroupWise 2012 Multiple Untrusted Pointer Dereferences Exploitation April 3th, 2013 Brian MARIANI & Frédéric BOURLA ©2013 High-Tech Bridge SA – www.htbridge.com
  • 2. TIMELINE  On the 24th of November 2012, High-Tech Bridge Security Research Lab discovered multiple vulnerabilities in Novell GroupWise 2012.  On the 26th November 2012, High-Tech Bridge Security Research Lab informed Novell about these vulnerabilities which existed in two core ActiveX modules.  On the 30th January 2013, Novell published a security bulletin and released a security patch.  Finally, on the 3rd April 2013 High-Tech Bridge Security Research Lab disclosed the vulnerability details.  This paper is a technical explanation of the latter vulnerability and its exploitation. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 3. ABOUT NOVELL GROUPWISE  According to Wikipedia:  GroupWise is a messaging and collaborative software platform from Novell Inc. that supports email, calendaring, personal information management, instant messaging, and document management.  The platform consists of the client software, which is available for Windows, Mac OS X, Linux, and the server software part which is supported on Windows Server, NetWare and Linux systems.  The latest generation of the platform is GroupWise 2012 which only supports Windows and Linux servers. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 4. THE VULNERABILITIES  The vulnerabilities exist in the gwmim1.ocx and gwabdlg.dll libraries.  In order to trigger the flaw one should pass a non properly initialized value to the vulnerable methods.  By default any long integer value is assumed to be a proper initialized pointer. This permit to provide a fake pointer to some of the methods and hijack the control flow of the application by redirecting it to a malicious code.  The vulnerability can be abused by preparing the heap area with predictable memory addresses before the bug is triggered. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 5. COMMON WEAKNESS ENUMERATION  In accordance to MITRE:  The Common Weakness Enumeration is a formal list of software weakness types created to: • Serve as a common language for describing software security weaknesses in architecture, design or code. • Serve as a standard measuring stick for software security tools targeting these weaknesses. • Provide a common baseline standard for weakness identification, mitigation and prevention efforts.  On the of 20th August 2012 High-Tech Bridge Security Research Lab obtained CWE-Compatible Status by MITRE.  This vulnerability was categorized by the weakness ID Untrusted Pointer Dereference [CWE-822]. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 6. UNTRUSTED POINTER DEREFERENCE  According to MITRE, an untrusted pointer dereference vulnerability is present when:  An attacker can inject a pointer for memory locations that the program is not expecting.  If the pointer is dereferenced for a write operation, the attack might allow modification of critical program state variables, cause a crash or execute code.  If the dereferencing operation is for a read, then the attack might allow reading of sensitive data, cause a crash or set a program variable to an unexpected value since it will be read from an unexpected memory location. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 7. MORE DETAILS ABOUT THE ISSUE  Novell GroupWise crashes at three different methods within two modules.  The involved modules are gwabdlg.dll and gwmim1.ocx.  The faulty methods names are InvokeContact, GenerateSummaryPage and SecManageRecipientCertificates.  We will only analyse the issues in the SecManageRecipientCertificates and InvokeContact methods.  This is because the InvokeContact and GenerateSummary methods crash at the same area. Moreover, the exploitation technique used to leverage the vulnerability is the same.  The configuration lab we used is an English Windows XP SP3 operating system (DEP disabled) with Internet Explorer 8. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 8. PROOF OF CONCEPT CRASH (1)  Here is a working proof of concept in order to crash Internet Explorer by passing a custom pointer to the InvokeContact method. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 9. PROOF OF CONCEPT CRASH (2)  The following proof of concept crashes Internet Explorer by passing a fake pointer to the SecManageRecipientCertificates method. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 10. SecManageRecipientCertificates case (1)  Let’s first analyze the SecManageRecipientCertificates case as this is the simpler one.  In the following screenshot we can observe the crash from WinDBG after executing the proof of concept on one of the previous slides:  We can clearly spot that the crash took place at the address 0x10014805 when the code attempts to move the value of the uninitialized pointer into the EDX register.  This one was provided as a long data type (202116108), therefore (0xc0c0c0c) in hexadecimal format. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 11. SecManageRecipientCertificates case (2)  So far we have a function that crashes when reading a memory address of our choice.  All that we need in order to turn the odds in our favor and maximize the chances of exploitation is that the code instructions that follow permit us in someway to take control of code execution.  In this particular instance, after dissasembling the faulty function, we can observe at the memory address 0x10014807 that the value hold by our pointer is moved into the EAX register.  Eventually, a CALL EAX instruction at the address 0x10014809 will terminate the game. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 12. HEAP SPRAYING  In order to exploit this particular vulnerability we need to spray the heap area on Internet Explorer in a reliable and precise way.  Before the bug is triggered the heap must be already prepared in order to contain the or al,0x0C sled which leads to arbitrary code execution.  The or al,0x0C instruction does not affects any critical data which could stop code execution.  The goal is to "slide" the flow of code to its final destination.  Since the shellcode is sitting in multiple chunks in the heap right after the or al,0x0C sled the probability of arbitrary code execution is very high.  Please check the Microsoft XML issue video for more information on this exploitation technique. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 13. WINDBG AFTER THE HEAP SPRAYING EXPLOIT (1)  Here is a screenshot of the most important part of the exploit: ©2013 High-Tech Bridge SA – www.htbridge.com
  • 14. WINDBG AFTER THE HEAP SPRAYING EXPLOIT (2)  The following screenshot shows the state of registers under Windbg after the exploit is executed:  We can clearly observe that instruction pointer register was successfully hijacked. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 15. THE INVOKECONTACT METHOD CASE (1)  As we said on slide 10, finding the way to exploit the SecManageRecipientCertificates method was les complex than the InvokeContact one.  When we run the InvokeContact proof of concept, one would be tempted to conclude that this is just a local denial of service.  However, since the attacker can control the EAX register he could influence the code logic and to enter what seems to be a switch structure.  This means that it would be possible to coerce the code to enter into one of the six available cases, so as to potentially increase our chances of successful exploitation. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 16. THE INVOKECONTACT METHOD CASE (2)  Here is the switch structure containing the six different cases:  In order to go beyond this crash, we need to provide a memory address as a pointer, and from this address plus 4 bytes we supply a dword value who will be the case number in which we would like to enter.  In order to accomplish this task one would need to rely over a previously known address in memory.  If we use a precise heap spraying technique, we can count on the 0xc0c0c0c address. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 17. THE INVOKECONTACT METHOD CASE (3)  After studying the exploitation opportunities that are available to us, we found that at least one of the six cases permits arbitrary code execution.  The following screenshot shows the code instructions when the third case is executed:  Let’s summarize the entire process starting from the injected pointer until code execution is reached. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 18. THE INVOKECONTACT METHOD CASE (4)  We place a breakpoint at the Oleaut32!DispCallFunc function and a second one at the first CALL ECX instruction situated some bytes farther. The second breakpoint is the instruction who calls the method in which we are interested.  After the second break, the code points to the memory address 0x572146b7. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 19. THE INVOKECONTACT METHOD CASE (5)  The code pushes into the stack the improper pointer. At this moment we can observe the reference to the XisDOMAttributeList function.  After the CALL instruction at the address 0x5722D83E, the code continues and pushes again the uninitialized value at the address 0x5722d861 who enters in one more nested function. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 20. THE INVOKECONTACT METHOD CASE (6)  When the code comes into this function the uninitialized pointer is compared to 0. As the pointer’s value is equal to c0c0c0c the conditional jump at address 0x5722D2E8 is not taken.  Later, the untrusted pointer is moved into the EAX register at the address 0x5722D2FE.  At 0x5722D301 address we reach the instruction where the code reads the value of the EAX register plus four bytes. This corresponds to the case in which it will enter. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 21. THE INVOKECONTACT METHOD CASE (7)  In order to push the code to enter into the case three, we sprayed the heap so as to allocate perfect sized and consecutive chunks.  If we take care of the chunks size and the blocks size, we can be pretty sure that the begin of each spray block will be positioned at a predictable address.  Here is the sprayed data starting at the address 0xc0c0c0c:  Consult the document Heap Spraying Demystified under the section Precision Heap Spraying from Corelan for more information. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 22. THE INVOKECONTACT METHOD CASE (8)  Because the heap spray was very precise, the code reads and stores our desired value into the stack at the address 0x5722D304.  This permits us to go beyond the previous crash and enter into the function at the address 0x5722d4b4. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 23. THE INVOKECONTACT METHOD CASE (9)  The untrusted pointer is stored in the stack and will be reused later in order to call another private method from the vftable. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 24. THE INVOKECONTACT METHOD CASE (10)  Later the code dereferences twice the EAX register at the addresses 0x5722D4CA and 0x5722D4D3.  So as to successfully slide the code up to the shellcode, the exploit needs to spray accurately the heap with three pointers:  The shellcode sits right after the 0xc0c0c48 pointer. ©2013 High-Tech Bridge SA – www.htbridge.com
  • 25. THE INVOKECONTACT METHOD CASE (11)  This is therefore the final payload for the exploit: ©2013 High-Tech Bridge SA – www.htbridge.com
  • 26. THE INVOKECONTACT METHOD CASE (12)  Code execution is reached: ©2013 High-Tech Bridge SA – www.htbridge.com
  • 27. References & Links  http://www.youtube.com/watch?v=hNDjRLoN8ug (Exploitation Video)  https://www.htbridge.com/publication/Novell-GroupWise-exploit.rar (password: htbridge)  https://www.corelan.be/index.php/2011/12/31/exploit-writing-tutorial-part-11- heap-spraying demystified/#Heap_Spraying_on_Internet_Explorer_9  http://cwe.mitre.org/data/definitions/822.html  https://www.htbridge.com/vulnerability/  http://en.wikipedia.org/wiki/Novell_GroupWise ©2013 High-Tech Bridge SA – www.htbridge.com
  • 28. Thank you for reading Your questions are always welcome: brian.mariani [at] htbridge.com frederic.bourla [at] htbridge.com ©2013 High-Tech Bridge SA – www.htbridge.com