Day 19
Day 19|Command Injection 指令注入
昨日複習
Day 18|File Upload 修補建議:驗證檔案類型與內容
Store uploaded files outside the web root and prevent direct execution.
正確答案 A. 將上傳檔案存放在網站根目錄外,並防止直接執行
這句在描述:File Upload Vulnerability — Remediation(檔案上傳弱點修補建議)
看完整 Day 18 →今日句子
The application passes user input directly to an operating system command without proper validation.
中文意思
應用程式將使用者輸入直接傳給作業系統指令,但沒有進行適當驗證。
這句在說什麼資安問題
Command Injection(指令注入)
這句描述的是 Command Injection(指令注入)。系統把使用者輸入直接拼接進作業系統指令,攻擊者可以插入 ; rm -rf / 或 && cat /etc/passwd 之類的額外指令,讓伺服器執行任意操作,是嚴重性極高的弱點。
- ping 功能直接把使用者輸入的 IP 拼進系統指令:ping <input>,攻擊者輸入 127.0.0.1; cat /etc/passwd
- 檔案轉換工具把使用者提供的檔名直接帶進 shell 指令,插入 && rm -rf / 造成嚴重破壞
- DNS 查詢功能未驗證輸入,導致攻擊者在伺服器上執行任意 shell 指令
重點單字
| 英文 | 中文 |
|---|---|
| passes user input directly to | 將使用者輸入直接傳給 |
| operating system command | 作業系統指令 |
| without proper validation | 沒有適當驗證 |
練習題
Attackers may be able to execute arbitrary commands on the server.
💡 execute arbitrary commands on the server(在伺服器上執行任意指令)是 Command Injection 的核心影響。arbitrary 代表「任意的」,意味攻擊者可以執行任何他們想執行的系統指令,危害程度極高。