Reverse Engineering for exploit writers - Presentation Transcript
Nibin Varghese iViZ Security, Kolkata Reverse Engineering for Exploit Writers
Agenda
Exploitation Overview
Reverse Engineering Tools
Case Study MS08-067
Exploitation Overview
Software vulnerabilities exist
Reliable exploitation techniques exist
Stack overflow
Heap overflow
Exploit mitigation
Prevent or impede a class of vulnerabilities
Patch the vulnerability
Disable the service
Generic mitigations
Reverse Engineering Tools
IDA Pro
Bindiff Plugin for IDA
Ollydbg or Immunity Debugger or Windbg
Debugging Symbols
Sysinternals tool suite
Any scripting language to write PoC (Python, Ruby etc)
MS08-067
Windows Server Service Vulnerability
Out of band release
Details:
Error in netapi32.dll when processing directory traversal character sequence in path names. This can be exploited to corrupt stack memory by example sending RPC requests containing specially crafted path names to the Server service component – secunia.com
Structure of X86 stack frame Stack grows towards lower addresses Local Variables Saved EBP Saved IP Arguments
Classical Overflow Return address overwritten with address of shellcode Local Variables Saved EBP Saved IP Arguments
Reverse engineering the patch
Demo
The Bug
Decompiled by Alexander Sotirov
Visual demo of the bug
The Bug(contd..) ptr_path \computername\..\..\AAAAAAAAAAAAAAAAAAAAAAAAA ptr_previous_slash ptr_current_slash
ptr_path points to the beginning of the buffer
Parses to find current slash and previous slash‘\’
Finds “..”, so the current slash pointer moves forward
Data from Current slash pointer is copied to ptr_path
If the pointer is at the beginning of the buffer, a pointer moves backward to find previous slash“\”.
5a. Results in access violation if no “\” are found
0 comments
Post a comment