0x01 工具介绍
下载地址在末尾
0x02 功能简介
- 支持以下类型的注入payload:
- 基于布尔。
- 基于错误
- 基于时间
- 堆叠查询
- 支持以下DBMS的SQL注入。
- MySQL
- 微软 SQL 服务器
- Postgres
- 甲骨文
- Microsoft Access(目前仅支持基于布尔值的盲指纹)
- 支持以下注入类型。
- 基于 GET/POST 的注入
- 基于标头的注入
- 基于 Cookie 的注入
- 多部分表单数据注入
- 基于 JSON 的注入
- 基于 SOAP/XML 的注入
- 支持代理选项
--proxy
。 - 支持解析来自 txt 文件的请求:切换至该选项
-r file.txt
- 支持限制 dbs/tables/columns/dump 的数据提取:switch
--start 1 --stop 2
- 增加了对所有阶段恢复的支持。
- 增加了对跳过 urlencoding 开关的支持:
--skip-urlencode
- 增加了对在布尔/基于时间的注入的情况下验证提取的字符的支持。
- 增加了根据用户需求处理重定向的支持。
- 增加了对 sql-shell 开关的支持:(
--sql-shell
实验性) - 增加了对新查询开关的支持:
--fresh-queries
- 添加了主机名提取开关:
--hostname
- 添加了从 github 更新 ghauri 的开关:
--update
- 注意:必须从 github 克隆/安装 ghauri,此开关才能用于未来的更新,对于旧版本的用户,他们必须运行 git pull(如果使用 git 安装)才能获取此更新,对于未来的更新,可以使用命令
ghauri --update
获取最新版本的 ghauri 进行更新。
- 注意:必须从 github 克隆/安装 ghauri,此开关才能用于未来的更新,对于旧版本的用户,他们必须运行 git pull(如果使用 git 安装)才能获取此更新,对于未来的更新,可以使用命令
- 添加了忽略有问题的 HTTP 代码的开关。(例如 401):
--ignore-code
- 添加了用于检索表的条目数的开关:
--count
为何选择 Ghauri
例如,您可以将易受攻击的 HTTP 请求保存到文件(身份验证后的 SQLi),并使用 -r 开关将其提供给 Ghauri 和 SQLMap。结果不言而喻,无需自定义配置。Ghauri 既以类似浏览器的方式运行,又有自己独特的方法,可以自动切换到不同的渗透技术和绕过方法。同样,这不是直接比较,因为 Ghauri 仍有许多功能需要实现,而 SQLMap 已经功能丰富。但是,Ghauri 始终如一地执行所需的任务。自从开发这个工具以来,我很少使用 SQLMap,除了在少数情况下 Ghauri 仍在改进。
0x03更新说明
特性
增加了表项计数功能。开关:数
修复
修复了忽略cookie的——skip-urlencode开关的问题。
改进的基于布尔的检测
改进的重试机制
0x04 使用介绍
高级用法
Author: Nasir khan (r0ot h3x49)
usage: ghauri -u URL [OPTIONS]
A cross-platform python based advanced sql injections detection & exploitation tool.
General:
-h, --help Shows the help.
--version Shows the version.
--update update ghauri
-v VERBOSE Verbosity level: 1-5 (default 1).
--batch Never ask for user input, use the default behavior
--flush-session Flush session files for current target
--fresh-queries Ignore query results stored in session file
--test-filter Select test payloads by titles (experimental)
Target:
At least one of these options has to be provided to define the
target(s)
-u URL, --url URL Target URL (e.g. 'http://www.site.com/vuln.php?id=1).
-r REQUESTFILE Load HTTP request from a file
Request:
These options can be used to specify how to connect to the target URL
-A , --user-agent HTTP User-Agent header value
-H , --header Extra header (e.g. "X-Forwarded-For: 127.0.0.1")
--host HTTP Host header value
--data Data string to be sent through POST (e.g. "id=1")
--cookie HTTP Cookie header value (e.g. "PHPSESSID=a8d127e..")
--referer HTTP Referer header value
--headers Extra headers (e.g. "Accept-Language: frnETag: 123")
--proxy Use a proxy to connect to the target URL
--delay Delay in seconds between each HTTP request
--timeout Seconds to wait before timeout connection (default 30)
--retries Retries when the connection related error occurs (default 3)
--confirm Confirm the injected payloads.
--ignore-code Ignore (problematic) HTTP error code(s) (e.g. 401)
--skip-urlencode Skip URL encoding of payload data
--force-ssl Force usage of SSL/HTTPS
Optimization:
These options can be used to optimize the performance of ghauri
--threads THREADS Max number of concurrent HTTP(s) requests (default 1)
Injection:
These options can be used to specify which parameters to test for,
provide custom injection payloads and optional tampering scripts
-p TESTPARAMETER Testable parameter(s)
--dbms DBMS Force back-end DBMS to provided value
--prefix Injection payload prefix string
--suffix Injection payload suffix string
--safe-chars Skip URL encoding of specific character(s): (e.g:- --safe-chars="[]")
--fetch-using Fetch data using different operator(s): (e.g: --fetch-using=between/in)
Detection:
These options can be used to customize the detection phase
--level LEVEL Level of tests to perform (1-3, default 1)
--code CODE HTTP code to match when query is evaluated to True
--string String to match when query is evaluated to True
--not-string String to match when query is evaluated to False
--text-only Compare pages based only on the textual content
Techniques:
These options can be used to tweak testing of specific SQL injection
techniques
--technique TECH SQL injection techniques to use (default "BEST")
--time-sec TIMESEC Seconds to delay the DBMS response (default 5)
Enumeration:
These options can be used to enumerate the back-end database
management system information, structure and data contained in the
tables.
-b, --banner Retrieve DBMS banner
--current-user Retrieve DBMS current user
--current-db Retrieve DBMS current database
--hostname Retrieve DBMS server hostname
--dbs Enumerate DBMS databases
--tables Enumerate DBMS database tables
--columns Enumerate DBMS database table columns
--count Retrieve number of entries for table(s)
--dump Dump DBMS database table entries
-D DB DBMS database to enumerate
-T TBL DBMS database tables(s) to enumerate
-C COLS DBMS database table column(s) to enumerate
--start Retrieve entries from offset for dbs/tables/columns/dump
--stop Retrieve entries till offset for dbs/tables/columns/dump
--sql-shell Prompt for an interactive SQL shell (experimental)
Example:
ghauri -u http://www.site.com/vuln.php?id=1 --dbs
0x05下载
https://github.com/r0oth3x49/ghauri
原文始发于微信公众号(渗透安全HackTwo):Ghauri一个先进的跨平台工具,自动检测和利用SQL注入安全漏洞工具|渗透工具
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论