File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
modules/exploits/multi/http Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 4
4
##
5
5
6
6
require 'msf/core'
7
+ require 'nokogiri'
7
8
8
9
class Metasploit3 < Msf ::Exploit ::Remote
9
10
Rank = ExcellentRanking
@@ -49,17 +50,27 @@ def initialize(info={})
49
50
] , self . class ) # sometimes it is under host/images/mma.php so you may want to set this one
50
51
end
51
52
53
+ def has_input_name? ( nodes , name )
54
+ nodes . select { |e | e . attributes [ 'name' ] . value == name } . empty? ? false : true
55
+ end
56
+
52
57
def check
53
58
uri = normalize_uri ( target_uri . path )
54
59
res = send_request_cgi ( {
55
60
'method' => 'GET' ,
56
61
'uri' => uri
57
62
} )
58
63
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
61
71
end
62
- return Exploit ::CheckCode ::Safe
72
+
73
+ Exploit ::CheckCode ::Safe
63
74
end
64
75
65
76
def exploit
You can’t perform that action at this time.
0 commit comments