copy Copy chevron-down
Pentest chevron-right Web attacks Web Cache Web cache deception and web cache poisoning
arrow-up-right
Generic caches (Varnish, Squid)
Response served from the server or proxy cache.
Response served from Cloudflare's cache.
Web Cache Deception
X-Cache: HIT or CF-Cache-Status: HIT (depending on the cache used)
Cache-Control: public -> That means anyone could potentially retrieve this response.
Response :
This page should not be put in cache
Try adding .jpg / .js / .css
The response is
Try to add cacheable extension (For example .js / .css / .jpg, etc.)
The response is
If the Cf-Cache-Status / X-Cache response the request with HIT not MISS or Error. And then try to open the url in incognito mode
Add ; before the extension (For example ;.js / ;.css / ;.jpg, etc.)
The response is
If the Cf-Cache-Status / X-Cache response the request with HIT not MISS or Error. And then try to open the url in incognito mode
Other things to test:
www.example.com/profile.php/.js
www.example.com/profile.php/.css
www.example.com/profile.php/test.js
www.example.com/profile.php/../test.js
www.example.com/profile.php/%2e%2e/test.js
Use lesser known extensions such as .avif
/profile isn’t getting cached... but /assets/* is
Credits: https://x.com/medusa_0xf/status/1926245574065405991arrow-up-right
See below for more information - Sourcce: https://www.youtube.com/watch?v=9gvxEhugnVMarrow-up-right
Matrix variales use of semicolon to add parameters
/user;params/home -> /user/home
/Myaccount;a.js -> MyAccount
Response format specifiers use dot to render views
/MyAccount -> Default view: myaccount.html.erb
/MyAccount.css -> view: myaccount.css.erb
/MyAccount.aaa -> Default view: myaccount.html .erb
/MyAccount.ico -> Default view: myaccount.html .erb
Encoded null as delimiter
/MyAccount%00a.js -> /MyAccount
Encoded new line as delimiter if rewrite is enabled
/user/MyAccount%0a.js -> /account/MyAccount
/%68%65%6C%6C%6F -> /hello
/hello%2Fworld%2Ehtml -> /hello/world.html
Segment Normalization
/hello/../world -> /world
/hello\world -> /hello/world
/MyAccount$%2F%2E%2E%2Fstatic%2Fwcd -> /MyAccount/../static/wcd
Front End - Path Normalization : /static/wcd
Back End - $ is delimiter : /Myaccount
For example, this is the case whe CloudFront/Azure/Imperva is combined with Tomcat
Web Cache Poisoning
Query parameters
Look for evil and X-Cache: HIT / CF-Cache-Status: HIT in the response
Look for evil.com in the response
If the response contains X-Cache: HIT / CF-Cache-Status: HIT and the returned page is malicious or incorrect, it means the cache has been poisoned.
If the server sends a response with X-Cache: HIT / CF-Cache-Status: HIT and the page corresponds to a malicious page (e.g., an error page or an admin page), it is possible that the cache has been poisoned with an incorrect response.
Example 2:
Param Miner - Burp Extension
Right-click on a request that you want to investigate and click "Guess headers"
Interesting Books
Interesting Books chevron-right Support this Gitbook
I hope it helps you as much as it has helped me. If you can support me in any way, I would deeply appreciate it.
arrow-up-right
arrow-up-right
Last updated 8 months ago