Modify check
parent
4f244c54f8
commit
0d9ebe13a1
|
@ -4,6 +4,7 @@
|
|||
##
|
||||
|
||||
require 'msf/core'
|
||||
require 'nokogiri'
|
||||
|
||||
class Metasploit3 < Msf::Exploit::Remote
|
||||
Rank = ExcellentRanking
|
||||
|
@ -49,6 +50,10 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
],self.class) # sometimes it is under host/images/mma.php so you may want to set this one
|
||||
end
|
||||
|
||||
def has_input_name?(nodes, name)
|
||||
nodes.select { |e| e.attributes['name'].value == name }.empty? ? false : true
|
||||
end
|
||||
|
||||
def check
|
||||
uri = normalize_uri(target_uri.path)
|
||||
res = send_request_cgi({
|
||||
|
@ -56,10 +61,16 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
'uri' => uri
|
||||
})
|
||||
|
||||
if res && res.body =~ /_upl/
|
||||
if res
|
||||
n = ::Nokogiri::HTML(res.body)
|
||||
form = n.at('form[@id="uploader"]')
|
||||
inputs = form.search('input')
|
||||
if has_input_name?(inputs, 'file') && has_input_name?(inputs, '_upl')
|
||||
return Exploit::CheckCode::Appears
|
||||
end
|
||||
return Exploit::CheckCode::Safe
|
||||
end
|
||||
|
||||
Exploit::CheckCode::Safe
|
||||
end
|
||||
|
||||
def exploit
|
||||
|
|
Loading…
Reference in New Issue