Tufan Turhan
  • Introduction
  • Red Teaming
    • Initial Access
      • VoipHopper
      • SMB – SCF File Attacks
      • MITM6
      • LLMNR, NBT-NS, mDNS Zehirlemeleri ve Relay Ataklar
    • Responder - DNS Injection
    • Privilege Escalation
      • PrintNightmare
      • Juicy Potato ile Windows Yetki Yükseltme
      • Token Impersonation with Incognito
    • Active Directory & Kerberos
      • Kerberos
      • Kerberosting
      • AS-REP Roasting
      • Overpass The Hash/Pass The Key (PTK)
      • DCSync Attack
      • DCShadow Attack
      • GETTGT
      • Golden Tickets
      • Silver Tickets
      • PowerView
      • MS14-025 (GPP Abusing)
      • BloodHound
      • Procdump
    • Lateral Movement
      • RDP MiTM-Hijacking
      • Vlan Hopping
      • Pivoting
    • Network Pentest
      • IPv4 Subnet Cheat Sheet
      • DNS Spoofing
      • DHCP Rogue
    • Shell to Meterpreter
    • Turn Off or Bypass AV
    • Useful CMD or Powershell Command
    • Brute Force
    • Windows Dosya İndirme
    • Windows UAC Bypass
    • Insecure Dosya İzni
  • Pentesting
    • Pentesting FTP - 21
    • Pentesting SMTP - 25,465,587
    • Pentesting SMB - 139 & 445
    • Pentesting Telnet - 23
    • Pentesting DNS - 53
    • Pentesting MSRPC -135
    • Pentesting SNMP - 161,162
    • Pentesting LDAP - 389,636
    • Pentesting MSSQL - 1433
    • Pentesting MYSQL - 3306
    • Pentesting RDP - 3389
    • Pentesing WINRM 5985,5986
  • Web Application
    • 2FA/OTP Bypass
    • Captcha Bypass
    • Cache Poisoning
    • Command Injection (OS)
    • CRLF Injection
    • Cross-site WebSocket hijacking (CSWSH) -
    • Cross-site request forgery (CSRF) -
    • Dangling Markup -
    • Path traversal
    • File Upload
    • Formula Injection (CSV Injection)
    • Login Bypass List
    • OAuth -
    • Open Redirect
    • Race Condition -
    • Registration - Password Reset & Takeover Vulnerabilities
    • SQL Injection
    • SSRF
  • Linux Privilege Escalation
    • PHP Wrapper
    • Simple Http
    • Editing /etc/passwd
    • SUID Binaries
    • Sudo Rights
    • Otomatize Araçlar
    • OSCP Not
  • HTB
  • Reverse Shell w/Msfvenom
  • Upgrading Simple Shells to Fully Interactive TTYs
Powered by GitBook
On this page
  1. Web Application

Cache Poisoning

Nasıl Tespit ederiz?

Örneğin bir istek var ve bir parametresi var. https://tufanturhan.com/home?param=ref

1- Bu isteği ilk attığımız da 0.3 saniye de döndü tekrar bu isteği attığımız da eğer cache da kaldıysa 0.03 saniye de yani daha hızlı döner.

2- Cache HIT ve MISS diye değerler bulunur. İlk gönderdiğimiz de MISS alırız çünkü bu key yani param değerine gelen ref keyi daha önce gönderilmemiştir. İkinci sefer gönderdiğimiz de artık bu HIT edecek ve cachelenmiş olacaktır.

Eğer burada parametre yoksa biz kendimiz bir parametre de uydurabiliriz çünkü sistemler spesifik olarak bir sorguya bakmazlar.

/home?salla=parametre

Status kodu önemli değildir burada 200 OK da olur 404'de önemli olan response.

Exploit

1- Exploit etmek için response'u değiştirmemiz lazım dedik bu response'u değiştirmek için host headerını değiştirebiliriz çünkü yazılımcılar bir yerden js dosyası vs alacaklarında bu isteğin başına domaini ekler bunuda hardcoded yapmazlar yani host başlığından çekerler. Biz bu host headerı değiştirdiğimiz de eğer yazdığımız değeri response da görüyorsak BINGO!

2- Bazen host headerı değiştirdiğimiz de yanıt vermez bir şeyleri bozabiliriz. Bunun için de X-Forwarded-Host Başlığını ekleriz. Bu başlık host başlığını ezer yani host başlığından bir değer alacak varsa almaz X-Forwarded dan alır bunun sebebi yapılan mappingler ve konfigürasyonlardır. Nginx ve Virtualhosting host başlığına göre çalışır arka tarafda ki applerde X-Forwarded'a göre. Bu X-Forwarded başlığı unkey olmalı. Yani bu değeri cache de tutmalı sistem.

Eğer bu başlıkla beraber ana sayfa yani direkt / pathinde olmazsa kafamızdan bir parametre uydurarak deneyebiliriz. Mesela /?tufan=1 burayı poising yapabilirsek tufan.com/tufan=1 urline gittiğimde payloadım çalışmış olacak. Buraya bir XSS atak yapılabilir.

Cache Response'da Bulunan Headerlar

  • X-Cache hit ve miss değerlerini alır.

  • Cache-Control bir değerin cache alınıp alınmadığını ve ne kadar süre alındığını gösterir. Cache-Control: public, max-age=1800

  • Vary

  • Age

  • Server-Timing: cdn-cache; desc=HIT

Tool

PreviousCaptcha BypassNextCommand Injection (OS)

Last updated 2 years ago

https://github.com/Hackmanit/Web-Cache-Vulnerability-Scanner#option-1-pre-built-binary-recommended