技術問答
技術文章
iT 徵才
聊天室
2026 鐵人賽
登入/註冊
問答
文章
Tag
邦友
鐵人賽
搜尋
2023 iThome 鐵人賽
DAY
22
0
Security
Natas 網頁安全:從入門到放棄
系列 第
22
篇
Day 0x16 Natas Level 20 → Level 21
15th鐵人賽
web security
natas
CHA
團隊
好想放假大學
2023-10-07 23:35:20
480 瀏覽
分享至
Natas Level 20 → Level 21
Info
Username:
natas21
Password: 從上關獲取
URL:
http://natas21.natas.labs.overthewire.org
Walkthrough
存取網頁後使用帳號和上關獲取的密碼登入,沒有任何輸入框且要求使用
admin
登入,只有描述寫說 "
colocated with
http://natas21-experimenter.natas.labs.overthewire.org
.
"
同樣使用帳號和上關獲取的密碼登入 natas21-experimenter,可以透過 CSS 調整字體、顏色等
點擊
View sourcecode
超連結查看兩個網頁的後端 PHP 程式碼
分析程式碼邏輯後畫成流程圖如下,natas21 只有當 SESSION 中存在
admin=1
才會顯示下題的登入密碼;而 natas21-experimenter 則將使用者輸入的 CSS 參數存進 SESSION 中
可參考
Day 0x02 Natas Level 0 → Level 1
的方法,透過 Burp Suite 的
Proxy
攔截封包並
Send to Repeater
,初始請求網頁 natas21-experimenter 時沒有
Cookie
,網站會產生新的 Session ID 並
Set-Cookie
(可使用
?debug
輔助)
在 Message Body 中新增
admin=1
(用
&
接起來),並使用剛得到的
PHPSESSID
提交表單
回到 natas21 使用同樣的
PHPSESSID
發出請求,成功獲得下題的登入密碼
Note
上述例子中提交表單是使用 POST 方法,如果要改用 GET 的話,記得寫在上方的 URL 中
同樣發現使用 Burp Suite 時有機率失敗,網路上其他人又都是使用腳本,猜測網站可能也是固定的短時間內會清除 SESSION 檔案
Summary
相關弱點:
CWE-807: Reliance on Untrusted Inputs in a Security Decision
弱點原因:
未經驗證的使用者輸入可控制共用的 SESSION 內容,進而獲得權限存取敏感資料
修補建議:
取消 debug 參數等開發者的功能,避免洩漏可用資訊給攻擊者,並建立白名單驗證使用者輸入,改採用 API 而非自定義函式,另建議立即更換密碼,以減少資訊洩漏的風險
Reference
code2flow - online interactive code to flowchart converter
Carbon | Create and share beautiful images of your source code
留言
追蹤
檢舉
上一篇
Day 0x15 Natas Level 19 → Level 20
下一篇
Day 0x17 Natas Level 21 → Level 22
系列文
Natas 網頁安全:從入門到放棄
共
35
篇
目錄
RSS系列文
訂閱系列文
9
人訂閱
31
Day 0x1F Natas Level 29 → Level 30
32
Day 0x20 Natas Level 30 → Level 31
33
Day 0x21 Natas Level 31 → Level 32
34
Day 0x22 Natas Level 32 → Level 33
35
Day 0x23 Natas Level 33 → Level 34
完整目錄
熱門推薦
{{ item.subject }}
{{ item.channelVendor }}
|
{{ item.webinarstarted }}
|
{{ formatDate(item.duration) }}
直播中
立即報名
尚未有邦友留言
立即登入留言
iThome鐵人賽
參賽組數
902
組
團體組數
37
組
累計文章數
19860
篇
完賽人數
528
人
看影片追技術
看更多
{{ item.subject }}
{{ item.channelVendor }}
|
{{ formatDate(item.duration) }}
直播中
熱門tag
15th鐵人賽
16th鐵人賽
13th鐵人賽
14th鐵人賽
17th鐵人賽
12th鐵人賽
11th鐵人賽
鐵人賽
2019鐵人賽
javascript
2018鐵人賽
python
2017鐵人賽
windows
php
c#
linux
windows server
css
react
熱門問題
在上海使用 Fortigate 的IPSEC VPN
請益如何關閉Windows的登入畫面?
Exchange 2016 遇到的問題 Outlook無法登入
o365 sharedmailbox 收件一問 - 轉寄去DISTRIBUTION GROUP 問題
熱門回答
在上海使用 Fortigate 的IPSEC VPN
o365 sharedmailbox 收件一問 - 轉寄去DISTRIBUTION GROUP 問題
請益如何關閉Windows的登入畫面?
Exchange 2016 遇到的問題 Outlook無法登入
熱門文章
[POG-08] 破除迷思:Prompt Orchestration Governance(POG) 常見問題 (FAQ) 大解析
AI 時代,我們為什麼比過去更需要軟體工程師?解析 Vibe Coding 的虛與實
當我的AI助手住進雲端:我的生活變了, 使用Clawdbot + Linode一周感受
【C++學習筆記】04《邏輯運算與運算子》
解決中文母語者的 Gemini 破版困擾,拯救數位強迫症
IT邦幫忙
×
標記使用者
輸入對方的帳號或暱稱
Loading
找不到結果。
標記
{{ result.label }}
{{ result.account }}