Skip to content

Commit 0d9ebe1

Browse files
committed
Modify check
1 parent 4f244c5 commit 0d9ebe1

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

modules/exploits/multi/http/mma_backdoor_upload.rb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
##
55

66
require 'msf/core'
7+
require 'nokogiri'
78

89
class Metasploit3 < Msf::Exploit::Remote
910
Rank = ExcellentRanking
@@ -49,17 +50,27 @@ def initialize(info={})
4950
],self.class) # sometimes it is under host/images/mma.php so you may want to set this one
5051
end
5152

53+
def has_input_name?(nodes, name)
54+
nodes.select { |e| e.attributes['name'].value == name }.empty? ? false : true
55+
end
56+
5257
def check
5358
uri = normalize_uri(target_uri.path)
5459
res = send_request_cgi({
5560
'method' => 'GET',
5661
'uri' => uri
5762
})
5863

59-
if res && res.body =~ /_upl/
60-
return Exploit::CheckCode::Appears
64+
if res
65+
n = ::Nokogiri::HTML(res.body)
66+
form = n.at('form[@id="uploader"]')
67+
inputs = form.search('input')
68+
if has_input_name?(inputs, 'file') && has_input_name?(inputs, '_upl')
69+
return Exploit::CheckCode::Appears
70+
end
6171
end
62-
return Exploit::CheckCode::Safe
72+
73+
Exploit::CheckCode::Safe
6374
end
6475

6576
def exploit

0 commit comments

Comments
 (0)