Skip to content

Commit 8f47edb

Browse files
committed
JBoss_Maindeployer: improve feedback against CVE-2010-0738
The exploit against CVE-2010-0738 won't work when using GET or POST. In the existing code the request would fail and the function would return a nil. This would be passed to detect_platform without being checked and cause the module to crash ungracefully with the error: Exploit failed: NoMethodError undefined method `body' for nil:NilClass The first changes detect a 401 authentication message and provide useful feedback. Given that if, in any case, 'res' is not a valid or useful response the second change just terminates processing. I've stayed with the module's coding style for consistency.
1 parent ef815ca commit 8f47edb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/exploits/multi/http/jboss_maindeployer.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,12 @@ def query_serverinfo
315315
'uri' => path
316316
}, 20)
317317

318+
if (res) && (res.code == 401)
319+
fail_with(Failure::NoAccess,"Unable to bypass authentication. Try changing the verb to HEAD to exploit CVE-2010-0738.")
320+
end
321+
318322
if (not res) or (res.code != 200)
319-
print_error("Failed: Error requesting #{path}")
320-
return nil
323+
fail_with(Failure::Unknown,"Failed: Error requesting #{path}")
321324
end
322325

323326
res

0 commit comments

Comments
 (0)