黑客防线,在攻与防的对立统一中寻求突破!2001年创刊的黑客技术专业刊物!

设为首页
收藏本站
联系我们
网站导航


黑客文章 - 脚本漏洞 - 浏览 - EditPlus查找PHP源码简单数字型注入的正则表达式
EditPlus查找PHP源码简单数字型注入的正则表达式
http://www.hacker.com.cn/ 2008-8-15 0:02:28
EditPlus查找PHP源码简单数字型注入的正则表达式
今天看一个项目代码,文件不多,不过每个文件中都N多注入,一个一个看实在太累,索性花了点时间,弄了个正则表达式,搜索出来,然后再将安全的筛选出去。省了不少时间的说。

1.查找select、update、delete语句
((select|SELECT|update|UPDATE|delete|DELETE)+.*(from|FROM|set|SET)+.*(where|WHERE)+.*)

查询语句,对于没有条件判断的基本不存在注入问题,因而仅搜索此语句即可
例子:
select * from user where

2.简单的数字型注入
((select|SELECT|update|UPDATE|delete|DELETE)+.*(from|FROM|set|SET)+.*(where|WHERE)+.*=[ ]?["]?["]?\$)

能找到select、update delete三种语句,5种格式的整形注入,如:
直接变量传入
select * from guess where id=$subject_id
update guess set is_valid=0 where id=$subject_id
delete from guess where id=$subject_id
=与变量之间存在空格
select * from guess where id= $subject_id
update guess set is_valid=0 where id= $subject_id
delete from guess where id= $subject_id
变量双引号
select * from guess where id="$subject_id"
update guess set is_valid=0 where id="$subject_id"
delete from guess where id="$subject_id"
=与双引号之间存在空格
select * from guess where id= "$subject_id"
update guess set is_valid=0 where id= "$subject_id"
delete from guess where id= "$subject_id"
=与引号、双引号之间存在空格
select * from guess where id= " $subject_id"
update guess set is_valid=0 where id= " $subject_id"
delete from guess where id= " $subject_id"

其实自己发现其他的一些漏洞也可以找到相应关键字寻找的,当然这些仅限于比较容易看出来的漏洞了
所属分类: 脚本漏洞   所属专题:
共有 249 人次浏览 收藏本页 返回上一页
评论作者:
电子邮件:
评论内容:
投票评价:
验 证 码:
图片包含4个随机字符,点击刷新
请输入上面图片中的随机字符