文件包含和目录遍历模糊测试、枚举和利用工具。
FDsploit
菜单:
$ python fdsploit.py -h
_____ ____ _ _ _
| __| \ ___ ___| |___|_| |_
| __| | |_ -| . | | . | | _|
|__| |____/|___| _|_|___|_|_|
|_|...ver. 1.2
Author: Christoforos Petrou (game0ver) !
usage: fdsploit.py [-u | -f ] [-h] [-p] [-d] [-e {0,1,2}] [-t] [-b] [-x] [-c]
[-v] [--params [...]] [-k] [-a] [--cmd]
[--lfishell {None,simple,expect,input}]
FDsploit.py: Automatic (L|R)FI & directory traversal enumeration & exploitation.
Required (one of the following):
-u , --url Specify a url or
-f , --file Specify a file containing urls
Optional:
-h, --help Show this help message and exit
-p , --payload Specify a payload-file to look for [default None]
-d , --depth Specify max depth for payload [default 5]
-e {0,1,2}, --urlencode {0,1,2}
Url-encode the payload [default: False]
-t , --tchar Use a termination character ('%00' or '?') [default None]
-b, --b64 Use base64 encoding [default False]
-x , --proxy Specify a proxy to use [form: host:port]
-c , --cookie Specify a session-cookie to use [default None]
-v , --verb Specify request type ('GET' or 'POST') [default GET]
--params [ ...] Specify POST parameters to use (applied only with POST requests)
Form: param1:value1,param2:value2,...
-k , --keyword Search for a certain keyword(s) on the response [default: None]
-a, --useragent Use a random user-agent [default user-agent: FDsploit_1.2_agent]
--cmd Test for command execution through PHP functions [default command: None]
--lfishell {None,simple,expect,input}
LFI pseudoshell [default None]
[!] For More Details please read the README.md file!
FDsploit
可用于自动发现和利用本地/远程文件包含和目录遍历漏洞。如果发现 LFI 漏洞,--lfishell
可以使用选项来利用它。目前,支持3 种不同类型的 LFI shell:
simple
:这种类型的 shell 允许用户轻松读取文件,而无需每次都输入 url。此外,它只提供文件的输出,而不是页面的整个 html 源代码,这使其非常有用。expect
:这种类型的shell是半交互式shell,允许用户通过PHP的expect://
包装器执行命令。input
:这种类型的shell是半交互式shell,它还允许用户通过PHP的php://input
流执行命令。
目前为止,lfi-shell 内置命令只有两个:
clear
和exit
。
特征
- LFI-shell 接口仅提供读取的文件或发出的命令的输出,而不是所有的 html 代码。
- 可以指定3 种不同类型的 LFI-shell。
- 支持 GET/POST 请求。
- 自动检测GET参数。
- 可以使用通配符 ( ) 指定某些参数进行测试
*
。 - 可以指定和使用可选的会话 cookie。
- 可以使用 PHP 函数自动检查 RCE。
- 另外使用 sha-256 哈希来识别潜在的漏洞。
- base64/urlencoding 支持。
一些例子
1.目录遍历漏洞发现:
从以下输出来看,该directory
参数可能容易受到目录遍历漏洞的影响,因为每个带有../
有效负载的请求都会产生不同的sha-256哈希值。此外,每个请求的内容长度都不同:
./fdsploit.py -u 'http://127.0.0.1:8888/test/bWAPP/bWAPP/directory_traversal_2.php?directory=documents' -c 'PHPSESSID=7acf1c5311fee614d0eb40d7f3473087; security_level=0' -d 8
![图片[5]-FDsploit——文件包含和目录遍历模糊、枚举和利用工具](https://github.com/chrispetrou/FDsploit/raw/master/images/directory_traversal.png)
2. LFI漏洞发现:
再次,语言参数似乎容易受到LFI攻击,因为使用../etc/passwd
等作为有效负载,每个用绿色标记的请求都会产生不同的哈希值,与初始值不同的内容长度,并且在响应中找到指定的关键字:
./fdsploit.py -u 'http://127.0.0.1:8888/test/bWAPP/bWAPP/rlfi.php?language=*&action=go' -c 'PHPSESSID=7acf1c5311fee614d0eb40d7f3473087; security_level=0' -d 7 -k root -p /etc/passwd
![图片[6]-FDsploit——文件包含和目录遍历模糊、枚举和利用工具](https://github.com/chrispetrou/FDsploit/raw/master/images/lfi.png)
3.使用简单shell进行LFI利用:
使用 shell 利用上述 LFI simple
:
![图片[7]-FDsploit——文件包含和目录遍历模糊、枚举和利用工具](https://github.com/chrispetrou/FDsploit/raw/master/images/simpleshell.png)
笔记
- 当
POST
使用动词时,--params
还必须指定选项。 - 要测试目录遍历漏洞,
--payload
必须将选项保留为默认值(无)。 - 当
--file
使用 options 进行多 URL 测试时,仅支持 GET 请求。 - 当同时
--file
设置了&--cookie
选项时,由于每次只能指定一个 cookie,因此 URL 必须引用同一个域,或者无需 cookie 即可访问(这将在未来的更新中修复)。 input
POST
shell 与verb不兼容。
要求:
注意:要安装要求:
pip install -r requirements.txt --upgrade --user
💡FDsploit
还预装了BlackArch Linux 发行版。
待办事项
- 修复上面的注释4
--file
,并使其也能使用POST参数和cookie,可能使用json
etc…文件作为输入。 - 添加更多内置命令,
--lfishell
例如历史记录等…
贡献与反馈
欢迎反馈和贡献。如果您发现任何错误或有功能请求,请随时打开问题,我会在审核后立即尝试修复它!
免责声明
此工具仅用于测试和学术目的,并且只能在获得严格同意的情况下使用。请勿将其用于非法目的!最终用户有责任遵守所有适用的当地、州和联邦法律。开发人员不承担任何责任,也不对本工具和软件造成的任何误用或损坏负责。
国内下载链接
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END