编译安装c2工具sliver以及python 客户端sdk
背景:
项目需要安装sliver服务端和客户端还有sliver的python sdk;
git clone https://github.com/BishopFox/sliver.git
cd sliver
make # 执行make后会拉取当前服务器版的go安装包,包括windows,linux(arm/amd),darwin(arm) 其实时调用go-assets.sh文件
执行完毕后会生成sliver-server, sliver-client两个二进制文件
作为开发需要依赖protoc包,下面命令会将protoc-gen-to/protoc-gen-go-grpc 二进制文件安装到 $GOAPTH/bin下
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0
还需要一个protoc二进制文件,(https://github.com/protocolbuffers/protobuf/releases/latest)下载就好;同样拷贝到$PATH下
如果要编译windows木马文件,只要mingw-64支持;我的kali机器直接执行一下命令就好,centos比较费劲直接放弃我这边没成功
apt install mingw-w64
安装完后执行一次make pb会生成一次项目的pb文件,这是grpc通信的协议文件;
make pb #执行成功后会打印如下信息,显示pb文件生成过程
protoc -I protobuf/ protobuf/commonpb/common.proto --go_out=paths=source_relative:protobuf/
protoc -I protobuf/ protobuf/sliverpb/sliver.proto --go_out=paths=source_relative:protobuf/
protoc -I protobuf/ protobuf/clientpb/client.proto --go_out=paths=source_relative:protobuf/
protoc -I protobuf/ protobuf/dnspb/dns.proto --go_out=paths=source_relative:protobuf/
protoc -I protobuf/ protobuf/rpcpb/services.proto --go_out=paths=source_relative:protobuf/ --go-grpc_out=protobuf/ --go-grpc_opt=paths=source_relative
接下来执行sliver-server,并启用多人模式
# ./sliver-server
Sliver Copyright (C) 2022 Bishop Fox
This program comes with ABSOLUTELY NO WARRANTY; for details type 'licenses'.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'licenses' for details.
Unpacking assets ...
███████╗██╗ ██╗██╗ ██╗███████╗██████╗
██╔════╝██║ ██║██║ ██║██╔════╝██╔══██╗
███████╗██║ ██║██║ ██║█████╗ ██████╔╝
╚════██║██║ ██║╚██╗ ██╔╝██╔══╝ ██╔══██╗
███████║███████╗██║ ╚████╔╝ ███████╗██║ ██║
╚══════╝╚══════╝╚═╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝
All hackers gain cipher
[*] Server v1.5.36 - 497a4cc6984cc7447f010e73ee5554d921ee2591 - Dirty
[*] Welcome to the sliver shell, please type 'help' for options
[server] sliver > multiplayer
[*] Multiplayer mode enabled!
[server] sliver > mtls
[*] Starting mTLS listener ...
[*] Successfully started job #2
[server] sliver > jobs
ID Name Protocol Port
==== ====== ========== =======
1 grpc tcp 31337
2 mtls tcp 8888
接下来服务端生成一个配置文件,此配置文件供python sdk或者sliver-client使用;
[server] sliver > new-operator -h
Create a new operator config file
Usage:
======
new-operator [flags]
Flags:
======
-h, --help display help
-l, --lhost string listen host
-p, --lport int listen port (default: 31337)
-n, --name string operator name
-s, --save string directory/file to the binary to
[server] sliver > new-operator -l 192.168.2.131 -p 31337 -n kali
[*] Generating new client certificate, please wait ...
[*] Saved new client config to: /root/yp/kali_192.168.2.131.cfg
开始安装sliver-python扩展
pip3 install sliver-py
使用python连接sliver-server
#!/usr/bin/env python3
import os
import asyncio
from sliver import SliverClientConfig, SliverClient
DEFAULT_CONFIG = "/root/yp/kali_192.168.2.131.cfg"
async def main():
config = SliverClientConfig.parse_config_file(DEFAULT_CONFIG)
client = SliverClient(config)
print('[*] Connected to server ...')
await client.connect()
sessions = await client.sessions()
print('[*] Sessions: %r' % sessions)
if len(sessions):
print('[*] Interacting with session %s', sessions[0].ID)
interact = await client.interact_session(sessions[0].ID)
ls = await interact.ls()
print('[*] ls: %r' % ls)
if __name__ == '__main__':
asyncio.run(main())
编译安装c2工具sliver以及python 客户端sdk的更多相关文章
- 源码编译安装libtool工具
1. 获取源码 wget http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz tar xvf libtool-2.4.6.tar.gz -C ~ ...
- CentOS 6.7 final编译安装Python 2.7.11
CentOS 6.7默认的Python版本为2.6.6,现升级为Python 2.7.11 1.安装编译环境 yum groupinstall "Development tools" ...
- 16、编译安装ansible
16.1.python版本说明: Ansible是一种批量部署工具,现在运维人员用的最多的三种开源集中化管理工具有:puppet,saltstack,ansible,各有各的优缺点, 其中saltst ...
- CentOS6.3编译安装Nginx1.4.7 + MySQL5.5.25a + PHP5.3.28
[准备工作] #在编译安装lnmp之前,首先先卸载已存在的rpm包. rpm -e httpd rpm -e mysql rpm -e php yum -y remove httpd yum -y r ...
- python_way ,day1 编译安装python3、基础及流程控制
本节内容: 1,Python介绍发展史 2,安装 3,Hello World 4,程序 5,变量,字符编码 6,用户输入 7,模块初识 一.python介绍 python的创始人为吉多·范罗苏姆(Gu ...
- linux下Python2.7编译安装PyQt5
---作者吴疆,未经允许,严禁转载,违权必究--- ---欢迎指正,需要源码和文件可站内私信联系--- -----------点击此处链接至博客园原文----------- 功能说明:在ubuntu系 ...
- 编译安装mysql
参考:http://www.centoscn.com/CentosServer/www/2015/0422/5245.html 安装mysql5.6.17 1.按照标准需要给mysql创建所属用户和用 ...
- CentOS6.3 编译安装LAMP(3):编译安装 MySQL5.5.25
所需源码包: /usr/local/src/MySQL-5.5.25/cmake-2.8.8.tar.gz /usr/local/src/MySQL-5.5.25/mysql-5.5.25.tar.g ...
- 源码编译安装 MySQL 5.5.x 实践
1.安装cmakeMySQL从5.5版本开始,通过./configure进行编译配置方式已经被取消,取而代之的是cmake工具.因此,我们首先要在系统中源码编译安装cmake工具. # wget ht ...
- mysql5.7.11编译安装以及修改root密码小结
系统是cenos6.7 64位的,默认mysql5.7.11下载到/usr/local/src,安装目录在/app/local/mysql目录下,mysql数据放置目录/app/local/data. ...
随机推荐
- cri-docker的学习和了解-番外
cri-docker的学习和了解-番外 前言 因为已经有足足两年多没再详细接触K8S了. 然后利用两个晚上搭建了IPV6 SingleStack的K8S单机版 中间一直使用的docker的方式学习和工 ...
- [转帖]002、体系结构之TiDB Server
TiDB Server 1.TiDB总览 1.1.TiDB Server架构 1.2.TiDB Server 主要功能: 2.SQL语句处理 语句的解析和编译 SQL层 协议层 上下文 解析层 逻辑优 ...
- 【转帖】让互联网更快:新一代QUIC协议在腾讯的技术实践分享
https://www.cnblogs.com/jb2011/p/8458549.html 本文来自腾讯资深研发工程师罗成在InfoQ的技术分享. 1.前言 如果:你的 App,在不需要任何修改的情况 ...
- [转帖]linux学习:sed与awk与tr用法整理
https://www.cnblogs.com/LO-gin/p/6882490.html 流编辑器:sed 语法:sed [-hnV][-e<script>][-f<script文 ...
- [转帖]【JVM】G1垃圾收集器的关键技术
前言 G1 GC,全称Garbage-First Garbage Collector,通过-XX:+UseG1GC参数来启用,作为体验版随着JDK 6u14版本面世,在JDK 7u4版本发行时被正式推 ...
- [转帖][问题已处理]-kubernetes中2次不同的oom处理
https://dandelioncloud.cn/article/details/1598699030236577793 起因: 同事反馈 服务挂了,kuboard上查看是服务挂掉了,livenes ...
- kubernetes中不可见的OOM
最近看了一篇文章:Tracking Down "Invisible" OOM Kills in Kubernetes,其讲述的是由于内存不足导致Pod中的进程被killed,但Po ...
- FinClip 小程序的自有账户体系是怎么做的?
随着公司规模越来越大,员工需要使用的产品矩阵也会越来越丰富,不仅包括内部的 IT 系统,OA 系统,业务系统,还会有很多和外部产品集成的登录流程,更别提各种业务系统或者子系统中的账户体系了.如果使用简 ...
- 京东云开发者|提高IT运维效率,深度解读京东云AIOps落地实践
基于深度学习对运维时序指标进行异常检测,快速发现线上业务问题 时间序列的异常检测是实际应用中的一个关键问题,尤其是在 IT 行业.我们没有采用传统的基于阈值的方法来实现异常检测,而是通过深度学习提出了 ...
- echarts设置标题样式
<!DOCTYPE html> <html> <!-- https://blog.csdn.net/weixin_42698255/article/details/892 ...