PHP-Nuke是一个广为流行的网站创建和管理工具,它可以使用很多数据库软件作为后端,比如MySQL、PostgreSQL、mSQL、Interbase、Sybase等。 PHP-Nuke实现上存在多个SQL注入漏洞,远程攻击者可能利用这些漏洞非授权操作数据库。 在mainfile.php文件中435行: __ //Union Tap //Copyright Zhen-Xjell 2004 http://nukecops.com //Beta 3 Code to prevent UNION SQL Injections unset($matches); unset($loc); if(isset($_SERVER['QUERY_STRING'])) { if (preg_match("/([OdWo5NIbpuU4V2iJT0n]{5}) /", \ rawurldecode($loc=$_SERVER['QUERY_STRING']), $matches)) { die('Illegal Operation \ 1'); } } if(!isset($admin) OR (isset($admin) AND !is_admin($admin))) { $queryString = $_SERVER['QUERY_STRING']; if (($_SERVER['PHP_SELF'] != "/index.php") OR !isset($url)) { if (stristr($queryString,'http://')) die('Illegal Operation 2'); } if ((stristr($queryString,'%20union%20')) OR (stristr($queryString,'/*')) OR \ (stristr($queryString,'*/union/*')) OR (stristr($queryString,'c2nyaxb0')) OR \ (stristr($queryString,'+union+')) OR ((stristr($queryString,'cmd=')) AND \ (!stristr($queryString,'&cmd')))...
PHP-Nuke是一个广为流行的网站创建和管理工具,它可以使用很多数据库软件作为后端,比如MySQL、PostgreSQL、mSQL、Interbase、Sybase等。 PHP-Nuke实现上存在多个SQL注入漏洞,远程攻击者可能利用这些漏洞非授权操作数据库。 在mainfile.php文件中435行: __ //Union Tap //Copyright Zhen-Xjell 2004 http://nukecops.com //Beta 3 Code to prevent UNION SQL Injections unset($matches); unset($loc); if(isset($_SERVER['QUERY_STRING'])) { if (preg_match("/([OdWo5NIbpuU4V2iJT0n]{5}) /", \ rawurldecode($loc=$_SERVER['QUERY_STRING']), $matches)) { die('Illegal Operation \ 1'); } } if(!isset($admin) OR (isset($admin) AND !is_admin($admin))) { $queryString = $_SERVER['QUERY_STRING']; if (($_SERVER['PHP_SELF'] != "/index.php") OR !isset($url)) { if (stristr($queryString,'http://')) die('Illegal Operation 2'); } if ((stristr($queryString,'%20union%20')) OR (stristr($queryString,'/*')) OR \ (stristr($queryString,'*/union/*')) OR (stristr($queryString,'c2nyaxb0')) OR \ (stristr($queryString,'+union+')) OR ((stristr($queryString,'cmd=')) AND \ (!stristr($queryString,'&cmd'))) OR ((stristr($queryString,'exec')) AND \ (!stristr($queryString,'execu'))) OR (stristr($queryString,'concat'))) { \ die('Illegal Operation 3'); } }__ 攻击者可以通过不同的过滤器绕过对SQL注入的保护。 此外Web_Links、News和Download模块中还存在多个SQL注入漏洞: +++++++++++++++++++++++++++ PHP.ini Magic Quotes = OFF Register Global = ON +++++++++++++++++++++++++++ Web_Links/index.php文件中有漏洞的函数如下: function viewlinkcomments($lid) { global $prefix, $db, $admin, $bgcolor2, $module_name, $admin_file; include("header.php"); include("modules/$module_name/l_config.php"); menu(1); $row = $db->sql_fetchrow($db->sql_query("SELECT title FROM ".$prefix."_links_links \ WHERE lid='$lid'")); // BUG ---> $lid $ttitle = filter($row['title'], "nohtml"); $lid = intval(trim($lid)); //WTF?<===== lol ??????????????? :):):):):) echo "<br>"; ... __ function viewlinkcomments($lid) { function viewlinkeditorial($lid){ function viewlinkcomments($lid){ function ratelink($lid, $user) { $lid变量没有经过过滤,因此攻击者可以执行任意sql命令。 Downloads模块中有漏洞函数: function viewdownloadeditorial($lid) { function viewdownloadcomments($lid) { function ratedownload($lid, $user) { $lid变量没有经过过滤。 News模块中有漏洞函数: function rate_complete($sid, $rated=0, $score) { $sid变量没有经过过滤。 PHP-Nuke <= 8.0.0.3.3b 目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本: <a href="http://phpnuke.org/" target="_blank">http://phpnuke.org/</a>