# HTTP request smuggling Lab2 這題是 TE.CL 漏洞(Transfer-Encoding + Content-Length)版本,跟之前的 CL.TE 不同,重點在: - 前端伺服器有 chunked 解碼能力,後端伺服器不支援 chunked。 目標:利用 smuggling,讓下一次請求 / 會變成 /404,回 404 Not Found。 一樣先進入網站並攔截封包。   為了讓 Content-Length 跟 Transfer-Encoding 不一致而去觸發漏洞,所以將 Update Content-Length 關起來。 > 預設勾選會自動根據你修改的 request body,重新計算並改寫 Content-Length,但這裡想手動給一個「錯誤」的 Content-Length(4),讓伺服器前端和後端對請求長度的解讀不一致,如果開了會把漏洞堵住。   再來要寫 chunk 內容。 `5e` 是 16 進位的數字,換算成 10 進位就是: ``` 5e_hex = 5 * 16 + 14 = 80 + 14 = 94 bytes ``` 意思是這個 chunk 的正文長度是 94 個字元。  - `POST /404 HTTP/1.1`:表示請求路徑是 /404。 - Content-Type 跟 Content-Length 是標準的 HTTP header,表明後面有 15 bytes 的請求主體。 - `x=1` 是這個 POST 請求的內容(body),用於模擬正常的表單提交。 最後再用一個 0 chunk 表示結束。 這裡前端解析 chunked 串流,後端不支援 chunked,只認 Content-Length,導致前後解析不一致,成功 smuggle,所以我們一樣將 GET 改成 POST 送出請求。    ---
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up