背景:

项目需要安装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的更多相关文章

  1. 源码编译安装libtool工具

    1. 获取源码 wget http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.gz tar xvf libtool-2.4.6.tar.gz -C ~ ...

  2. CentOS 6.7 final编译安装Python 2.7.11

    CentOS 6.7默认的Python版本为2.6.6,现升级为Python 2.7.11 1.安装编译环境 yum groupinstall "Development tools" ...

  3. 16、编译安装ansible

    16.1.python版本说明: Ansible是一种批量部署工具,现在运维人员用的最多的三种开源集中化管理工具有:puppet,saltstack,ansible,各有各的优缺点, 其中saltst ...

  4. 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 ...

  5. python_way ,day1 编译安装python3、基础及流程控制

    本节内容: 1,Python介绍发展史 2,安装 3,Hello World 4,程序 5,变量,字符编码 6,用户输入 7,模块初识 一.python介绍 python的创始人为吉多·范罗苏姆(Gu ...

  6. linux下Python2.7编译安装PyQt5

    ---作者吴疆,未经允许,严禁转载,违权必究--- ---欢迎指正,需要源码和文件可站内私信联系--- -----------点击此处链接至博客园原文----------- 功能说明:在ubuntu系 ...

  7. 编译安装mysql

    参考:http://www.centoscn.com/CentosServer/www/2015/0422/5245.html 安装mysql5.6.17 1.按照标准需要给mysql创建所属用户和用 ...

  8. 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 ...

  9. 源码编译安装 MySQL 5.5.x 实践

    1.安装cmakeMySQL从5.5版本开始,通过./configure进行编译配置方式已经被取消,取而代之的是cmake工具.因此,我们首先要在系统中源码编译安装cmake工具. # wget ht ...

  10. mysql5.7.11编译安装以及修改root密码小结

    系统是cenos6.7 64位的,默认mysql5.7.11下载到/usr/local/src,安装目录在/app/local/mysql目录下,mysql数据放置目录/app/local/data. ...

随机推荐

  1. [转帖]十步解析awr报告

    http://www.zhaibibei.cn/awr/1.1/ 从这期开始讲解awr报告的部分,首先讲解awr整体的部分 后续会针对不同的点进行讲解 1. 数据库细节 这部分可以看到 数据库的版本 ...

  2. iftop的学习与使用

    iftop的学习与使用 背景 前段时间一直进行netperf 等网络性能验证工具的学习与使用. 监控很多时候采用了 node-exporter + prometheus + grafana来进行观察 ...

  3. [转帖]Region Merge Config

    TiKV replicates a segment of data in Regions via the Raft state machine. As data writes increase, a ...

  4. Edge浏览器安装 wetab ChatGPT插件的简单步骤

    Edge浏览器安装 wetab ChatGPT插件的简单步骤 背景 首先感谢 神通的 李诺帆老师, 之前一直使用. https://chat.jubianxingqiu.com/#/chat/1002 ...

  5. 【转帖】eBay 云计算“网”事:网络超时篇

    https://www.infoq.cn/article/JmCbkA0XX9NqrcX6loIo eBay技术荟 2020-06-19 本文字数:5508 字 阅读完需:约 18 分钟 导读 eBa ...

  6. 通过Environment获取属性文件的值,竟然会调用到JNDI服务!!!

    一.背景介绍 某应用在压测过程机器cpu使用率超过80%,通过在线诊断工具进行CPU采样生成的火焰图,看到程序中频繁调用environment.getProperty()获取属性值,而其内部调用了Jn ...

  7. 【DS】【AtCoder】Pakencamp 2022 Day2 H

    2023.6.30 Problem Link 有 \(n\) 个帮派在打架,每个帮派有一个大小 \(a_i\),每相邻两个帮派有一个仇恨度 \(b_i\).现在有 \(Q\) 次单点修改 \(a_i\ ...

  8. Couldn't launch Python exit code 9009

    Couldn't launch Python exit code 9009 start stable-diffusion-webui,发现,python 环境没有,我本地其实是已经安装完毕的,后来发现 ...

  9. 语言模型的预训练[6]:思维链(Chain-of-thought,CoT)定义原理详解、Zero-shot CoT、Few-shot CoT 以及在LLM上应用

    大语言模型的预训练[6]:思维链(Chain-of-thought,CoT)定义原理详解.Zero-shot CoT.Few-shot CoT 以及在LLM上应用 1.思维链定义 背景 在 2017- ...

  10. 【3】jupyter notebook【修改主题、字体、字号、代码自动补全、变更工作目录、添加目录插件、解决工具栏隐藏问题、修改默认浏览器、默认打开位置】

    相关文章: [1]Anaconda安装超简洁教程,瞬间学会! [2]Anaconda下:ipython文件的打开方式,Jupyter Notebook中运行.py文件,快速打开ipython文件的方法 ...