Home arrow Computer Components arrow Software / Internet arrow Understanding SEH (Structured Exception Handler) Exploitation 07 February 2012  
Main Menu
Home
News
Forums
Downloads
Contact Us
Search i-hacked
Become a Member
- - - - - - -
Computer Components
Consumer Electronics
Electronic Projects
Game Systems
Cell / Phone
Car / Home
Misc
- - - - - - -
Info and Contests
Reviews
About
Login Form





Lost Password?
Latest Edge
 
Advertisement
Privacy Policy
Vote for us in Top 100 Security Sites
Click here to Vote!
Newsflash
Understanding SEH (Structured Exception Handler) Exploitation Print E-mail
Written by Donny Hubener   
Friday, 03 July 2009
This paper is written to introduce you to the design and theory of how a Structured Exception Handler (SEH) exploit can be written to target a Windows host. We use the buffer overflow vulnerability in the ESF EasyChat Server software as a detailed example of this exploit type.

While the paper attempts to cover the topics for those new to writing exploits, it still makes some assumptions about the reader's related experience. For instance, the paper does not go into detail about how to write assembly code and how it is used for shellcode as the exploit payload. It also does not talk about the difference between hexadecimal and decimal number systems which is required to understand many of the numeric values used throughout the document. Here is a list of topics you should be familiar with before continuing to read this paper:

➢ Hexadecimal number system
➢ Basic understanding of how Assembly language is used
➢ Basic understanding of Assembly Opcode Mnemomics
➢ Understanding of memory pointers
➢ General idea of memory registers and their use
➢ Some experience with writing program functions of any language

Likewise there are some requirements that you will need should you want to complete the exercise.  I highly suggest that you finish the exercise, as this will solidify a lot of the concepts that are discussed.  You will need:

➢ A WindowsXP SP1 machine (Virtual Machine is Ok) (Victim)
Ollydbg installed on XP SP1 box
OllySSEH Ollydbg Plugin installed on XP SP1 box
ESF EasyChat Server 2.2 (Free)
➢ Another machine with Python installed. (can be any os) (Attacker)

One of the most important concepts to understand when writing functional exploits is that they are the result of a software bug. If all programs were perfectly written such that there were no flaws, there would be no vulnerabilities to exploit. In many cases, an attacker may be able to cause a program to crash due to insufficient error checking within the program. Causing the program to crash would be considered a Denial of Service (DOS) attack. However, causing a DOS condition in a program does not mean it can be fully exploited, but it does indicate that it could be possible. While there are several different types of attack vectors available to create a fully functional exploit, there are many cases where the conditions of the program or environment do not provide a viable exploit using any of the known vectors. This article is written with the assumption that an SEH attack vector is possible in the target software, and it is important to understand that this vector may not always be present in other vulnerable software.

Before we get started, take note that we will be mostly discussing the operation of two different software routines that are running simultaneously. One routine will be the vulnerable software program and it's supporting function libraries that we are attempting to corrupt. For us, this first routine will be the EasyChat server software. The second routine is the Windows system exception dispatcher which constantly runs waiting for an error condition to occur. The dispatcher routine attempts to handle any exceptions (errors) that may occur in the first routine (EasyChat). As we go through this paper, try to keep these two routines separate in your mind.




Last Updated ( Tuesday, 07 July 2009 )
 
Related Items
I-Hacked's Most Popular
2006 I-Hacked T-Shirts
 I-Hacked T-Shirts
Have been released, Now with
3 versions!

Check them out here

Latest Articles
Top of Page

If you see information here that you know is inaccurate, out of date, misleading, confusing, or just blatantly wrong, please let us know. Updates and corrections are reviewed and updated as they are received.

 
Disclaimer
I-hacked.com does not take any responsibility with the information presented. Any information provided on this site is not guaranteed in any way. Some articles may discuss topics that are illegal, so this information is provided for educational purposes only, use at your own risk. If you blow up your car, home, computer, or anything else -- it's not our fault, use good judgement and play nice.


© I-Hacked.com LLC