背景:

项目需要安装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. [转帖]Nginx优化与防盗链

    目录 一.配置Nginx隐藏版本号 1.第一种方法修改配置文件 2.第二种方法修改源码文件,重新编译安装 二.修改Nginx用户与组 三.配置Nginx网页缓存时间 四.实现Nginx的日志分割 五. ...

  2. [转帖]解决vCenter6.x由于证书过期问题无法登录

    https://www.dinghui.org/vcenter-sts-certificate.html#:~:text=%E8%BF%99%E6%97%B6%E5%80%99%EF%BC%8C%E5 ...

  3. js中数组reduce的使用原来这么简单

    reduce 的学习方法 array.reduce(callback(prev, currentValue, index, arr), initialValue) //简写就是下面这样的 arr.re ...

  4. vuex中action中发送数据

    state: { actionData: "", }, mutations: { actioncomAPi: (state, data) => { state.actionD ...

  5. 栈:数据结构中的后进先出(LIFO)容器

    栈是一种基本的数据结构,广泛应用于计算机科学和编程中,用于管理数据的存储和访问.栈遵循后进先出(Last In, First Out,LIFO)原则,即最后放入栈的元素首先被取出.这种数据结构模拟了物 ...

  6. NSSCTF Round#17 Basic CRYPTO

    Level_1 题目 Level_1.py(我把参数整理了一下,看着舒服) #真签到题 from Crypto.Util.number import bytes_to_long, getPrime f ...

  7. 【一】MADDPG-单智能体|多智能体总结(理论、算法)

    相关文章: [一]MADDPG-单智能体|多智能体总结(理论.算法) [二]MADDPG--单智能体|多智能体总结算法实现--[追逐游戏] [一]-环境配置+python入门教学 [二]-Parl基础 ...

  8. 使用 arxiv-sanity &paperwithcode 跟进最新研究领域的文章

    1.arxiv-sanity介绍 arxiv.org是一个非常大的预印本资源库,里面有大量的最新的论文,但缺点是浏览.搜索和排序不是很方便.这个资源库每天会更新大量的论文,如果通过手动搜索和浏览则效率 ...

  9. 7.4 Windows驱动开发:内核运用LoadImage屏蔽驱动

    在笔者上一篇文章<内核监视LoadImage映像回调>中LyShark简单介绍了如何通过PsSetLoadImageNotifyRoutine函数注册回调来监视驱动模块的加载,注意我这里用 ...

  10. 8.2 Windows驱动开发:内核解锁与强删文件

    在某些时候我们的系统中会出现一些无法被正常删除的文件,如果想要强制删除则需要在驱动层面对其进行解锁后才可删掉,而所谓的解锁其实就是释放掉文件描述符(句柄表)占用,文件解锁的核心原理是通过调用ObSet ...