一个php防注入code求讨论[部分解决]

本帖最后由 晴天小铸 于 2012-6-17 12:58 编辑

<?php
$sb=$_GET['sb'];
$a=inject_check($sb);

echo "$a";



function inject_check($sql_str) {
  if(strtoupper($sql_str)=="UPDATETIME" ){
  return eregi('select|insert|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file|outfile', $sql_str);   
  }else{	
  return eregi('select|insert|update|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file|outfile', $sql_str);   
  }     
}  
?>**大家能突破么,127.0.0.1:8080/1.php?sb=select ,返回1你就输了,返回空白你就赢了。 前提是注入代码能运行。。[b]
{:4_49:}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[b]3漏洞的一个朋友:**
**select * from admin where id=1 and ascii(left(pass,1))>=0,这里ID可以注入
and ascii(left(pass,1))>=0
用ascii猜解成功绕过那个防注入**
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
**where x=x and 1=ascii(substring(pass,1,1)) and sleep(100)
只有满足前面的and才会执行sleep**
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                  **继续讨论**

{:4_63:}我赢了 全部删除 返回空白。

**回复 2# network **

= =你赢了{:4_60:}

我觉得只有在前面已经查询到你想要知道的表的时候
比如,select * from admin where id=1 and ascii(left(pass,1))>=0,这里ID可以注入

本帖最后由 晴天小铸 于 2012-6-17 12:51 编辑

**回复 4# EchoEye **

感谢~! [http://127.0.0.1:8080/zhuru/click.php?sb=and%20ascii%28left%28pass](<http://127.0.0.1:8080/zhuru/click.php?sb=and%20ascii%28left%28pass>),1%29%29%3E=0
                                 [b]绕过了,是个不错的思路ascii表慢慢猜[b] 谢谢 不过需要'闭合 id都有'$id'或者'."$id".' 很鸡助

{:4_90:}

**回复 2# network **

突破有几个了哈哈