Hacking/Shellcode/Alphanumeric/ALPHA3/x86/ASCII/Mixedcase/SEH GetPC (XP sp3)

From Skypher

Jump to: navigation, search

Main Page
├─▷Programming
└─▼Hacking
  ├─▼Shellcode
  │ ├─▷Bind
  │ ├─○Restricted instruction set
  │ ├─▼Alphanumeric
  │ │ ├─○ALPHA2
  │ │ ├─▼ALPHA3
  │ │ │ ├─▼x86
  │ │ │ │ ├─▼ASCII
  │ │ │ │ │ ├─▷Lowercase
  │ │ │ │ │ ├─▼Mixedcase
  │ │ │ │ │ │ ├─▷Decoder
  │ │ │ │ │ │ └─▼SEH GetPC (XP sp3)
  │ │ │ │ │ │   ├─○[ESI]
  │ │ │ │ │ │   └─○ESI+4
  │ │ │ │ │ └─▷Uppercase
  │ │ │ │ └─▷Unicode
  │ │ │ └─▷x64
  │ │ ├─○IMUL 0x30 encoding
  │ │ ├─○x86 printable opcodes
  │ │ ├─○x86 printable operands
  │ │ ├─○x64 printable opcodes
  │ │ └─○x64 printable operands
  │ ├─▷ASCII Art
  │ ├─○kernel32
  │ ├─○GetPC
  │ └─▷Egg hunt
  ├─▷Windows internals
  ├─○Vulnerabilities
  ├─○Heap spraying
  └─○List of security teams contact information

Contents


SEH GetPC code can determine where it is being executed in memory. This is required by self-modifying or self-decoding shellcodes, such as alphanumeric shellcodes created using ALPHA2 and ALPHA3. These need to know where they are located, in order to modify or decode themselves. The below examples show how to create SEH GetPC code that is 100% alphanumeric ASCII, for use with these alphanumeric shellcode encoders. This code successfully bypasses all mitigation implemented in SEH code on Windows XP up to sp3 by generating the structured exception handler code on the heap. The realization that this would bypass existing mitigations came after analyzing this VML fill method BoF exploit by jamikazu. It overwrites the entire stack with pointers to shellcode on the heap before causing an exception. The exception will cause the SEH to execute the shellcode because the mitigations in Windows XP sp3 allow the SEH code to be on the heap.

CODE

There are currently two implementation, each referring to EIP in a different way:

See also


SkyLined would like to thank the following people:

Personal tools