发布时间 :2005-12-03 14:03:00
修订时间 :2011-03-07 21:27:28

[原文]Multiple SQL injection vulnerabilities in NetClassifieds Premium Edition 1.0.1, Professional Edition 1.5.1, Standard Edition, and Free Edition 1.0.1 allow remote attackers to execute arbitrary SQL commands via the (1) CatID parameter in (a) ViewCat.php and (b) gallery.php, and the (2) ItemNum parameter in (c) ViewItem.php.

[CNNVD]NetClassifieds Products多个SQL注入漏洞(CNNVD-200512-042)

        NetClassifieds Premium Edition 1.0.1, Professional Edition 1.5.1, Standard Edition和Free Edition 1.0.1存在多个SQL注入漏洞。远程攻击者可以借助(a) ViewCat.php 和 (b) gallery.php中的(1) CatID 参数,以及(c) ViewItem.php中的 (2) ItemNum 参数,执行任意SQL指令。

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)


- OVAL (用于检测的技术细节)


- 官方数据库链接
(官方数据源) MITRE
(官方数据源) NVD
(官方数据源) CNNVD

- 其它链接及资源
(UNKNOWN)  VUPEN  ADV-2005-2689
(UNKNOWN)  BID  15683

- 漏洞信息

NetClassifieds Products多个SQL注入漏洞
高危 SQL注入
2005-12-03 00:00:00 2006-05-01 00:00:00
        NetClassifieds Premium Edition 1.0.1, Professional Edition 1.5.1, Standard Edition和Free Edition 1.0.1存在多个SQL注入漏洞。远程攻击者可以借助(a) ViewCat.php 和 (b) gallery.php中的(1) CatID 参数,以及(c) ViewItem.php中的 (2) ItemNum 参数,执行任意SQL指令。

- 公告与补丁


- 漏洞信息 (4092)

NetClassifieds (SQL/XSS/Full Path) Multiple Remote Vulnerabilities (EDBID:4092)
php webapps
2007-06-22 Verified
0 laurent gaffié
N/A [点击下载]
Application: NetClassifieds:
-Free Edition
-Standard Edition
-Professional Edition
-Premium Edition
Web Site:
Versions: all
Platform: linux, windows
Bug: multiple injection sql , xss , full path
Fix Available: Yes


1) Introduction
2) Bug
3) The Code
4) Proof of concept
5) Fix

1) Introduction

"NetClassifieds Premium Edition has been built on the premise of making every
classifieds site feel like it was custom written for the purpose for which it's being used.
Automotive Sites, Horse Sites, Reality Sites, General Classifieds Sites or any other type
of classifieds site you can think of will find a perfect match in NetClassifieds"

2) Bug

injection sql , xss , full path

3) Vulnerable code:
in Common.php

line 310:

function CCStrip($value)
if(get_magic_quotes_gpc() == 0)
return $value;
return stripslashes($value); // ==> wtf... 0-o

ligne 350:

function CCGetFromPost($parameter_name, $default_value)

$parameter_value = "";
$parameter_value = CCStrip($HTTP_POST_VARS[$parameter_name]);
$parameter_value = $default_value;

return $parameter_value;

line 365:

function CCGetFromGet($parameter_name, $default_value)
global $HTTP_GET_VARS;

$parameter_value = "";
$parameter_value = CCStrip($HTTP_GET_VARS[$parameter_name]);
$parameter_value = $default_value;

return $parameter_value;

nothing is filtred ....

let's see how it goes in viewcat.php:

line 63:
include(RelativePath . "/Common.php");

line 519:
$this->ds->Parameters["urlCatID"] = CCGetFromGet("CatID", "");

line 909:
$catdb1 = new clsDBNetConnect;


$newSQL1 = "SELECT cat_id FROM categories WHERE sub_cat_id='" . CCGetFromGet("CatID", "") . "'";

$incat = "'" . CCGetFromGet("CatID", "") . "'";

I wont past every line of this code , because EVERY parameter is vulnerable to sql injection , XSS , full path ...

4)proof of concept

exemple of exploitation :
==> ( Database error: Invalid SQL: SELECT name, sub_cat_id, cat_id FROM categories WHERE )

==> The value in field urls_user_id is not valid. (passwd_PLAIN_TEXT)

// there's absolutly no encryption in this script for stored password , or sensitive data ...

every input are vulnerable to XSS attacks ( there's maybe 40 inputs ... ) via mysql errors , php error , and via
various unfiltred forms .
5) Fix
scriptdevelopers has been advised , i dont think they will release any patch at the moment .

here's my "quick patch" :

1) in Common.php:
line 30 :
( in a production mode , no one needs to know your errors .. and this avoid xss via php error )

ligne 350:
function CCGetFromPost // for every POST request
avant : return $parameter_value;
apres : return preg_replace('/[^a-z0-9]/i', '', $parameter_value); //only 0 to 9 and a to z caracters allowed

line 365:
function CCGetFromGet // for every GET request
replace :
return $parameter_value;
return preg_replace('/[^a-z0-9]/i', '', $parameter_value);

2) in Mysql_db.php
line 52 :
var $Halt_On_Error = "yes"; ## "yes" (halt with message), "no" (ignore errors quietly), "report" (ignore errror, but spit a warning)

set the value at "no" ( by default it's yes )
this will avoid juicy errors , such as table name and the complete query

3) imageresizer.php

line 2:
( same reason as Common.php )

line 100 :
replace : echo("<hr color='red'><font color='red'><b>$msg</b></font><br> file=<b>".__FILE__."</b><hr color='red'>")
echo("<hr color='red'><font color='red'><b>error while processing your request</b></font><br> <b></b><hr color='red'>");

".__FILE__." show the full path, no one need to know where is located your script on the server .
and usually a full path give the username for the ftp , or cpanel .
( /directory/your_user/www/file.php )

5) Conclusion

This script has not been develloped in a secure way, and it's dangerous
to use it UNPATCHED

regards laurent gaffie
contact :

# [2007-06-22]

- 漏洞信息

NetClassifieds ViewCat.php CatID Parameter SQL Injection
Remote / Network Access Information Disclosure, Input Manipulation
Loss of Confidentiality, Loss of Integrity
Exploit Public

- 漏洞描述

NetClassieds contains a flaw that may allow an attacker to carry out an SQL injection attack. The issue is due to the ViewCat.php script not properly sanitizing user-supplied input to the 'CatID' variable. This may allow an attacker to inject or manipulate SQL queries in the back-end database.

- 时间线

2005-12-01 Unknow
Unknow Unknow

- 解决方案

Currently, there are no known upgrades, patches, or workarounds available to correct this issue.

- 相关参考

- 漏洞作者

- 漏洞信息

NetClassifieds Products Multiple SQL Injection Vulnerabilities
Input Validation Error 15683
Yes No
2005-12-02 12:00:00 2008-04-23 06:07:00
r0t is credited with the discovery of this vulnerability.

- 受影响的程序版本

NetClassifieds Standard Edition 1.9.7
NetClassifieds Standard Edition 1.9.6 .3
NetClassifieds Professional Edition 1.5.2
NetClassifieds Professional Edition 1.5.1
NetClassifieds Premium Edition 1.0.5
NetClassifieds Premium Edition 1.0.1
NetClassifieds Free Edition 1.0.2
NetClassifieds Free Edition 1.0.1

- 漏洞讨论

NetClassifieds is prone to multiple SQL-injection vulnerabilities because the application fails to properly sanitize user-supplied input before using it in an SQL query.

A successful exploit could allow an attacker to compromise the application, access or modify data, or exploit vulnerabilities in the underlying database.

- 漏洞利用

No exploit is required.

Example URIs have been provided:[SQL][SQL][SQL]

- 解决方案

Currently we are not aware of any vendor-supplied patches. If you feel we are in error or if you are aware of more recent information, please mail us at:

- 相关参考