#
#Arm1tage
@arm1tage1.6K подп.
2.5Kпросмотров
13 августа 2024 г.
Score: 2.8K
Web cache deception Слёту надо понять разницу между Cache Poisoning и Cache Deception: Cache Poisoning: Атакующий делает инъекцию в контент, который затем кэшируется для всех пользователей сервиса. Cache Deception: Атакующий делает инъекцию в контент, который при посещении жертвой кэшируется на сервисе и к нему может получить доступ только атакующий. Понятнее: У Серёги есть запрос, который возвращает ему его АПИ ключ. Серёга шаманит и изменяет ссылку на получение АПИ ключа так, чтобы сервер его закэшировал. Серёга даёт эту ссылку Алисе, та открывает и ГГ. Серёга снова открывает ссылку, над которой он шаманил и теперь он видит АПИ ключ Алисы, т.к. сервер закэшировал запрос Алисы. Для этой лабы рекомендуется использовать сканнер бурпа, ибо он имеет все нужные проверки на этот тип уязвимости. 🤨1. Exploiting path mapping for web cache deception - Log into your account. - In Burp Suite check /my-account request. - Modify the request to look like this: /my-account/cache.css - Send the request and observe X-Cache: miss - Go to exploit server. Create the next payload: <script> location="https://portswigger.com/my-account/cache1.css"; </script> - Send the exploit. Go to repeater and send the request with the same path (/my-account/cache1.css). Observe carlos' API is cached. 🤨2. Exploiting path delimiters for web cache deception There are two ways to do this lab: 2.1 Use Portswigger's delimiters list: - Send the /my-account request to Intruder. - Change the request to match .css file, like this: /my-account§§cache.css - Paste the delimiters list into intruder and start an attack. - Note, that the only request with 200 status code is /my-account;cache.css 2.2 Scan the /my-account request with Burp Suite. - Burp Suite scanner will discover, that the delimiter is ; - Go to exploit server. Create the next payload: <script> location="https://portswigger.com/my-account;cache1.css"; </script> - Send the exploit. Go to repeater and send the request with the same path (/my-account;cache1.css). Observe carlos' API is cached. 🤨3. Exploiting origin server normalization for web cache deception - Check the resources, that are cached by the server (for example everything after /resources/... is cached). You can check if the server caches by X-Cache: miss header. - Create the next path: /resources/..%2fmy-account?cache=1234 This will get you 200 OK and server will cache it (because of /resources/...) - Go to exploit server. Create the next payload: <script> location="https://portswigger.com/resources/..%2fmy-account?cache=1234"; </script> - Send the exploit. Go to repeater and send the request with the same path (/resources/..%2fmy-account?cache=1234). Observe carlos' API is cached. 🤨4. Exploiting cache server normalization for web cache deception - Check the resources, that are cached by the server (for example everything after /resources/... is cached). You can check if the server caches by X-Cache: miss header. - We are dealing with cache server instead of origin, so now we need to replace resources and my-account. - Create the next path: /my-account%2f%2e%2e%2fresources?cache=1234 - It will give you 404. Now you need to find a delimiter. You can brute it using intruder. The delimiter is #. - Create the next path: /my-account#%2f%2e%2e%2fresources?cache=1234 This will get you 200 OK and server will cache it. - Go to exploit server. Create the next payload (do not forget to url-encode #): <script> location="https://portswigger.com/my-account%23%2f%2e%2e%2fresources?cache=1234"; </script> - Send the exploit. Go to repeater and send the request with the same path (/my-account%23%2f%2e%2e%2fresources?cache=1234). Observe carlos' API is cached. #portswigger #cache
2.5K
просмотров
3734
символов
Да
эмодзи
Нет
медиа

Другие посты @arm1tage

Все посты канала →
Web cache deception Слёту надо понять разницу между Cache Po — @arm1tage | PostSniper