编译安装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. ...
 
随机推荐
- [转帖]Unix Domain Socket– IPC通信机制
			
什么是Unix Domain Socket 基于socket的框架上发展出一种IPC机制,就是UNIX Domain Socket.虽然网络socket也可用于同一台主机的进程间通讯(通过loopba ...
 - [转帖]LOAD DATA INFILE 导入数据
			
https://www.jianshu.com/p/bcafd8f3ad8e LOAD DATA INFILE语句用于高速地从一个文本文件中读取行,并写入一个表中.文件名称必须为一个文字字符串.LOA ...
 - [转帖]skywalking配置nacos集群模式
			
版本: name version nacos 1.1.0 skywalking 6.2.0 elasticsearch 6.3.2 es集群管理工具 cerebro-0.8.3 https://git ...
 - JDK发布版本的总结
			
https://www.oracle.com/java/technologies/javase/8all-relnotes.html 从官网总结一下每个版本的发布日期 Java SE 8u141 Ad ...
 - webpack配置scss
			
安装依赖: cnpm i sass-loader -D cnpm i node-sass -D node-sass尽量去使用cnpm去安装 创建index2.scss文件 div { h2 { bac ...
 - vue结合elementUI折叠展开效果动画
			
组件 <template> <div class="hide-page-com"> <ul class="tab-tilte"&g ...
 - linux root用户密码输入正确还是提示access denied
			
问题:之前用远程工具连接一直都是好的,第二天上班找开远程工具要输root的密码了,输入用户密码后还是无效,可以确定用户密码是对的,其中有一个远程工具一直是连着的就没有问题. 排查问题: 1.相接用pa ...
 - vue脚手架创建与环境安装
			
1.安装 Node.jsDownload | Node.js 在这里下载的是最新版,如果要安装以前的版本,页面往下拉找到 Previous Releases-Donloads-下载msi文件.  ...
 - 【主流技术】实战之 Spring Boot 中集成微信支付(小程序)
			
前言 微信支付是企业级项目中经常使用到的功能,作为后端开发人员,完整地掌握该技术是十分有必要的. 以下是经过真实商业项目实践的集成步骤,包括注册流程.调用过程.代码demo(经过脱敏)等,希望我的分享 ...
 - 4.6 Windows驱动开发:内核遍历进程VAD结构体
			
在上一篇文章<内核中实现Dump进程转储>中我们实现了ARK工具的转存功能,本篇文章继续以内存为出发点介绍VAD结构,该结构的全程是Virtual Address Descriptor即虚 ...