這次CTF不難 早上11:00開始玩到晚上12:00時已經差三題全解, 後來 Orange 出手成績直接爆表
有趣的是主辦單位在規則上寫說:
The competition requires you to find flags to gain points. Some flags can be gained by completing tasks, others are hidden in different places.
這不是讓大家去打網站嗎OTZ….
當時整個網頁都翻過之後才看到IRC上說hidden flag總共四把 其實我很想寫第五把hidden flag的write up,但是好像要先問過人家願不願意被公開(flee
總之在一般的題目裡,值得寫writeup的只有web300
直接看題目
H4x0r is making a new website and has decided to give you beta access! Head over here to register.
網頁連進去後有register, status, login三個頁面
其中有問題的是 status.php
輸入存在的使用者會
不存在時
這個頁面存在 boolean-based sql injection 簡單用一對一錯的sql injection試一下就知道
1 2 |
|
知道是boolean-based的sql injection 直接拿sql map出來跑
這邊一定要提一下Atdog前面解w100時(也是bool sql injection)靠北了一句話
我還是第一次看到ctf的題目 sqlmap可以直接爆的
不過這題是三百分,有擋工具 如果使用工具的話會被偵測出來
在這邊就做了一些猜測, 是檢查 user-agent? IP bind cookie? frequency rate?
最後發現status頁面會 set cookie, post過去的頁面會delete cookie.
cookie只能用一次,且鎖php session
這時就會發現SQLmap真的很強大, 可以自訂每次request 前執行的動作 修改每次的cookie/parameter
而eval修改cookie的功能是去年加上去的
最後就是用sqlmap eval 去讀status.php取得cookie 就可以爆db了
1 2 |
|
值得注意的是sqlmap跟status要用同一組php session key 不然還是會錯.
Payload
1 2 3 4 5 6 7 8 9 10 |
|
相關參數
1 2 3 4 5 6 7 8 |
|
撈資料
1 2 3 4 5 6 7 |
|