BasicAuth datastore cleanup
cleanup all the old BasicAuth datastore optionsbug/bundler_fix
parent
8b1febb4cf
commit
4c1e630bf3
|
@ -26,7 +26,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
'Name' => 'Cisco Device HTTP Device Manager Access',
|
'Name' => 'Cisco Device HTTP Device Manager Access',
|
||||||
'Description' => %q{
|
'Description' => %q{
|
||||||
This module gathers data from a Cisco device (router or switch) with the device manager
|
This module gathers data from a Cisco device (router or switch) with the device manager
|
||||||
web interface exposed. The BasicAuthUser and BasicAuthPass options can be used to specify
|
web interface exposed. The USERNAME and PASSWORD options can be used to specify
|
||||||
authentication.
|
authentication.
|
||||||
},
|
},
|
||||||
'Author' => [ 'hdm' ],
|
'Author' => [ 'hdm' ],
|
||||||
|
@ -61,7 +61,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
print_good("#{rhost}:#{rport} Successfully authenticated to this device")
|
print_good("#{rhost}:#{rport} Successfully authenticated to this device")
|
||||||
|
|
||||||
# Report a vulnerability only if no password was specified
|
# Report a vulnerability only if no password was specified
|
||||||
if datastore['BasicAuthPass'].to_s.length == 0
|
if datastore['PASSWORD'].to_s.length == 0
|
||||||
|
|
||||||
report_vuln(
|
report_vuln(
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,8 +72,8 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
|
|
||||||
register_options(
|
register_options(
|
||||||
[
|
[
|
||||||
OptString.new('BasicAuthUser', [true, 'The HTTP username to specify for basic authentication', 'piranha']),
|
OptString.new('USERNAME', [true, 'The HTTP username to specify for basic authentication', 'piranha']),
|
||||||
OptString.new('BasicAuthPass', [true, 'The HTTP password to specify for basic authentication', 'q']),
|
OptString.new('PASSWORD', [true, 'The HTTP password to specify for basic authentication', 'q']),
|
||||||
], self.class)
|
], self.class)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
end
|
end
|
||||||
|
|
||||||
if res.code == 401
|
if res.code == 401
|
||||||
print_error("401 Authorization Required! Our BasicAuthUser and BasicAuthPass credentials not accepted!")
|
print_error("401 Authorization Required! Our credentials were not accepted!")
|
||||||
elsif (res.code == 200 and res.body =~ /The passwords you supplied match/)
|
elsif (res.code == 200 and res.body =~ /The passwords you supplied match/)
|
||||||
print_status("Command successfully executed (according to the server).")
|
print_status("Command successfully executed (according to the server).")
|
||||||
end
|
end
|
||||||
|
|
|
@ -227,9 +227,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
authmsg = res.headers['WWW-Authenticate']
|
authmsg = res.headers['WWW-Authenticate']
|
||||||
end
|
end
|
||||||
print_error("The remote server responded expecting authentication")
|
print_error("The remote server responded expecting authentication")
|
||||||
if datastore['BasicAuthUser'] and datastore['BasicAuthPass']
|
if authmsg
|
||||||
print_error("BasicAuthUser \"%s\" failed to authenticate" % datastore['BasicAuthUser'])
|
|
||||||
elsif authmsg
|
|
||||||
print_error("WWW-Authenticate: %s" % authmsg)
|
print_error("WWW-Authenticate: %s" % authmsg)
|
||||||
end
|
end
|
||||||
cleanup_instructions(rpath, name) # display cleanup info
|
cleanup_instructions(rpath, name) # display cleanup info
|
||||||
|
|
|
@ -96,9 +96,6 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
|
|
||||||
|
|
||||||
def exploit
|
def exploit
|
||||||
datastore['BasicAuthUser'] = datastore['USERNAME']
|
|
||||||
datastore['BasicAuthPass'] = datastore['PASSWORD']
|
|
||||||
|
|
||||||
jsp_name = datastore['JSP'] || rand_text_alpha(8+rand(8))
|
jsp_name = datastore['JSP'] || rand_text_alpha(8+rand(8))
|
||||||
app_base = datastore['APPBASE'] || rand_text_alpha(8+rand(8))
|
app_base = datastore['APPBASE'] || rand_text_alpha(8+rand(8))
|
||||||
|
|
||||||
|
|
|
@ -123,9 +123,6 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
|
|
||||||
|
|
||||||
def exploit
|
def exploit
|
||||||
datastore['BasicAuthUser'] = datastore['USERNAME']
|
|
||||||
datastore['BasicAuthPass'] = datastore['PASSWORD']
|
|
||||||
|
|
||||||
jsp_name = datastore['JSP'] || rand_text_alpha(8+rand(8))
|
jsp_name = datastore['JSP'] || rand_text_alpha(8+rand(8))
|
||||||
app_base = datastore['APPBASE'] || rand_text_alpha(8+rand(8))
|
app_base = datastore['APPBASE'] || rand_text_alpha(8+rand(8))
|
||||||
|
|
||||||
|
|
|
@ -112,9 +112,6 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
end
|
end
|
||||||
|
|
||||||
def check
|
def check
|
||||||
datastore['BasicAuthUser'] = datastore['USERNAME']
|
|
||||||
datastore['BasicAuthPass'] = datastore['PASSWORD']
|
|
||||||
|
|
||||||
res = query_serverinfo
|
res = query_serverinfo
|
||||||
disconnect
|
disconnect
|
||||||
return CheckCode::Unknown if res.nil?
|
return CheckCode::Unknown if res.nil?
|
||||||
|
@ -127,8 +124,8 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
:host => rhost,
|
:host => rhost,
|
||||||
:port => rport,
|
:port => rport,
|
||||||
:sname => (ssl ? "https" : "http"),
|
:sname => (ssl ? "https" : "http"),
|
||||||
:user => datastore['BasicAuthUser'],
|
:user => datastore['USERNAME'],
|
||||||
:pass => datastore['BasicAuthPass'],
|
:pass => datastore['PASSWORD'],
|
||||||
:proof => "WEBAPP=\"Tomcat Manager App\", VHOST=#{vhost}, PATH=#{datastore['PATH']}",
|
:proof => "WEBAPP=\"Tomcat Manager App\", VHOST=#{vhost}, PATH=#{datastore['PATH']}",
|
||||||
:active => true
|
:active => true
|
||||||
)
|
)
|
||||||
|
@ -164,9 +161,6 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
|
|
||||||
|
|
||||||
def exploit
|
def exploit
|
||||||
datastore['BasicAuthUser'] = datastore['USERNAME']
|
|
||||||
datastore['BasicAuthPass'] = datastore['PASSWORD']
|
|
||||||
|
|
||||||
mytarget = target
|
mytarget = target
|
||||||
if (target.name =~ /Automatic/)
|
if (target.name =~ /Automatic/)
|
||||||
mytarget = auto_target
|
mytarget = auto_target
|
||||||
|
@ -221,8 +215,8 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
:host => rhost,
|
:host => rhost,
|
||||||
:port => rport,
|
:port => rport,
|
||||||
:sname => (ssl ? "https" : "http"),
|
:sname => (ssl ? "https" : "http"),
|
||||||
:user => datastore['BasicAuthUser'],
|
:user => datastore['USERNAME'],
|
||||||
:pass => datastore['BasicAuthPass'],
|
:pass => datastore['PASSWORD'],
|
||||||
:proof => "WEBAPP=\"Tomcat Manager App\", VHOST=#{vhost}, PATH=#{datastore['PATH']}",
|
:proof => "WEBAPP=\"Tomcat Manager App\", VHOST=#{vhost}, PATH=#{datastore['PATH']}",
|
||||||
:active => true
|
:active => true
|
||||||
)
|
)
|
||||||
|
|
|
@ -67,9 +67,6 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
end
|
end
|
||||||
|
|
||||||
def go(command)
|
def go(command)
|
||||||
datastore['BasicAuthUser'] = datastore['USERNAME']
|
|
||||||
datastore['BasicAuthPass'] = datastore['PASSWORD']
|
|
||||||
|
|
||||||
xml = <<-EOS
|
xml = <<-EOS
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<methodCall>
|
<methodCall>
|
||||||
|
|
|
@ -72,8 +72,8 @@ class Metasploit3 < Msf::Exploit::Remote
|
||||||
register_options(
|
register_options(
|
||||||
[
|
[
|
||||||
Opt::RPORT(8080),
|
Opt::RPORT(8080),
|
||||||
OptString.new('BasicAuthUser', [true, 'The HTTP username to specify for basic authentication', 'anonymous']),
|
OptString.new('USERNAME', [true, 'The HTTP username to specify for basic authentication', 'anonymous']),
|
||||||
OptString.new('BasicAuthPass', [true, 'The HTTP password to specify for basic authentication', 'mozilla@example.com']),
|
OptString.new('PASSWORD', [true, 'The HTTP password to specify for basic authentication', 'mozilla@example.com']),
|
||||||
], self.class)
|
], self.class)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue