SecurityFocus BUGTRAQ Mailing List: BugTraqLink Number One Link Number One Link Number Two Link Number Two Link Number One Link Number One Link Number Two Link Number Two Entire Site Advisories Calendar Columnists Elsewhere Guest Feature Infocus Library Links Mailing Lists (all) -- BUGTRAQ -- FOCUS-IDS -- FOCUS-IH -- FOCUS-LINUX -- FOCUS-MS -- FOCUS-SUN -- FOCUS-VIRUS -- FORENSICS -- INCIDENTS -- PEN-TEST -- SEC JOBS -- SF NEWS -- VULN-DEV News Products Services Tools Vulns BUGTRAQ ARCHIVE [ Message Index ] [ Thread Index ][ Reply ] [ prev Msg by Date ][ next Msg by Date ] To: BugTraq Subject: Vulnrability in myPHPnuke 1.8.8 Date: Sep 20 2003 4:39AM Author: Lifo Fifo Message-ID: <20030920043925.30916.qmail@sf-www2-symnsj.securityfocus.com> Language : PHP Script : http://www.myphpnuke.com 1.8.8 Problem : SQL Injection Description : myphpnuke is a widely used Content Managemnt System. Problem : In auth.inc.php file, ********************* if ((isset($aid)) && (isset($pwd)) && ($op == "login")) { if($aid!="" AND $pwd!="") { $q="select pwd from ".$mpnTables['authors']." where aid='$aid'"; $result=mysql_query("select pwd from ".$mpnTables['authors']." where aid='$aid'"); list($pass)=mysql_fetch_row($result); if ($pass == $pwd) { $pwd1 = md5($pwd); mysql_query("update ".$mpnTables['authors']." set pwd = '$pwd1' where aid='$aid'"); $pass = $pwd1; } else { $pwd1 = md5($pwd); } if($pass == $pwd1) { $admin = base64_encode("$aid:$pwd1"); setcookie("admin", "$admin", time()+2592000, "", "", ""); // 1 mo is 2592000 } } } ******************** Here the $aid is not checked. If you open the page like, Therefore you can run the query like, select pwd from mpn_authors where aid='mad' into outfile '/filepath/file.txt' when you enter aid=mad' into outfile '/filepath/file.txt This will not work if magic_quotes_gpc is on. Fix : Find the line ********** if ((isset($aid)) && (isset($pwd)) && ($op == "login")) { if($aid!="" AND $pwd!="") { ********** Add ********** $aid=addslashes($aid); ********** Credit : lifofifo & hackingzone.org Want to link to this message? Use this URL: Disclaimer, Terms & Conditions About this List Featured Lists: ARIS Users bugtraq bugtraq-es bugtraq-french NEW bugtraq-jp firewalls focus-ids focus-ih focus-linux focus-ms focus-sun focus-unix-other focus-virus forensics forensics-es honeypots incidents libnet pen-test secevents secpapers secprog sectools secureshell security-basics security-management NEW securityjobs vpn vuln-dev webappsec Newsletters: sf-news ms-secnews linux-secnews [ more . . . ] Privacy Statement Copyright © 1999-2003 SecurityFocus