From d935a038b07831a64637ab59616255a66905ee66 Mon Sep 17 00:00:00 2001 From: moloch-- <875022+moloch--@users.noreply.github.com> Date: Wed, 11 Jan 2023 13:21:15 -0800 Subject: [PATCH] Move DisableSGN out of protobuf since its client-side only --- client/command/generate/generate-beacon.go | 2 +- client/command/generate/generate.go | 7 +++---- client/command/generate/profiles-generate.go | 2 +- protobuf/clientpb/client.pb.go | 5 ++--- protobuf/commonpb/common.pb.go | 4 ++-- protobuf/dnspb/dns.pb.go | 4 ++-- protobuf/rpcpb/services.pb.go | 4 ++-- protobuf/sliverpb/sliver.pb.go | 4 ++-- 8 files changed, 15 insertions(+), 17 deletions(-) diff --git a/client/command/generate/generate-beacon.go b/client/command/generate/generate-beacon.go index 3a14a99723..1d486b0c85 100644 --- a/client/command/generate/generate-beacon.go +++ b/client/command/generate/generate-beacon.go @@ -32,7 +32,7 @@ func GenerateBeaconCmd(ctx *grumble.Context, con *console.SliverConsoleClient) { save, _ = os.Getwd() } if !ctx.Flags.Bool("external-builder") { - compile(config, save, con) + compile(config, ctx.Flags.Bool("disable-sgn"), save, con) } else { externalBuild(config, save, con) } diff --git a/client/command/generate/generate.go b/client/command/generate/generate.go index 3a18b13bd6..21c1095699 100644 --- a/client/command/generate/generate.go +++ b/client/command/generate/generate.go @@ -99,7 +99,7 @@ func GenerateCmd(ctx *grumble.Context, con *console.SliverConsoleClient) { save, _ = os.Getwd() } if !ctx.Flags.Bool("external-builder") { - compile(config, save, con) + compile(config, ctx.Flags.Bool("disable-sgn"), save, con) } else { _, err := externalBuild(config, save, con) if err != nil { @@ -346,7 +346,6 @@ func parseCompileFlags(ctx *grumble.Context, con *console.SliverConsoleClient) * C2: c2s, CanaryDomains: canaryDomains, TemplateName: ctx.Flags.String("template"), - DisableSGN: ctx.Flags.Bool("disable-sgn"), WGPeerTunIP: tunIP.String(), WGKeyExchangePort: uint32(ctx.Flags.Int("key-exchange")), @@ -756,7 +755,7 @@ func externalBuild(config *clientpb.ImplantConfig, save string, con *console.Sli return nil, nil } -func compile(config *clientpb.ImplantConfig, save string, con *console.SliverConsoleClient) (*commonpb.File, error) { +func compile(config *clientpb.ImplantConfig, disableSGN bool, save string, con *console.SliverConsoleClient) (*commonpb.File, error) { if config.IsBeacon { interval := time.Duration(config.BeaconInterval) con.PrintInfof("Generating new %s/%s beacon implant binary (%v)\n", config.GOOS, config.GOARCH, interval) @@ -792,7 +791,7 @@ func compile(config *clientpb.ImplantConfig, save string, con *console.SliverCon fileData := generated.File.Data if config.IsShellcode { - if config.DisableSGN { + if disableSGN { con.PrintErrorf("Shikata ga nai encoder is %sdisabled%s\n", console.Bold, console.Normal) } else { con.PrintInfof("Encoding shellcode with shikata ga nai ... ") diff --git a/client/command/generate/profiles-generate.go b/client/command/generate/profiles-generate.go index 7ab16b8374..d15120d312 100644 --- a/client/command/generate/profiles-generate.go +++ b/client/command/generate/profiles-generate.go @@ -41,7 +41,7 @@ func ProfilesGenerateCmd(ctx *grumble.Context, con *console.SliverConsoleClient) } profile := GetImplantProfileByName(name, con) if profile != nil { - implantFile, err := compile(profile.Config, save, con) + implantFile, err := compile(profile.Config, ctx.Flags.Bool("disable-sgn"), save, con) if err != nil { return } diff --git a/protobuf/clientpb/client.pb.go b/protobuf/clientpb/client.pb.go index a7e42211b2..54038e9ff1 100644 --- a/protobuf/clientpb/client.pb.go +++ b/protobuf/clientpb/client.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.8 +// protoc-gen-go v1.27.1 +// protoc v3.21.12 // source: clientpb/client.proto package clientpb @@ -1220,7 +1220,6 @@ type ImplantConfig struct { Evasion bool `protobuf:"varint,9,opt,name=Evasion,proto3" json:"Evasion,omitempty"` ObfuscateSymbols bool `protobuf:"varint,10,opt,name=ObfuscateSymbols,proto3" json:"ObfuscateSymbols,omitempty"` TemplateName string `protobuf:"bytes,11,opt,name=TemplateName,proto3" json:"TemplateName,omitempty"` - DisableSGN bool `protobuf:"varint,12,opt,name=DisableSGN,proto3" json:"DisableSGN,omitempty"` MtlsCACert string `protobuf:"bytes,20,opt,name=MtlsCACert,proto3" json:"MtlsCACert,omitempty"` MtlsCert string `protobuf:"bytes,21,opt,name=MtlsCert,proto3" json:"MtlsCert,omitempty"` MtlsKey string `protobuf:"bytes,22,opt,name=MtlsKey,proto3" json:"MtlsKey,omitempty"` diff --git a/protobuf/commonpb/common.pb.go b/protobuf/commonpb/common.pb.go index 9301c53533..2425ec79a3 100644 --- a/protobuf/commonpb/common.pb.go +++ b/protobuf/commonpb/common.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.8 +// protoc-gen-go v1.27.1 +// protoc v3.21.12 // source: commonpb/common.proto package commonpb diff --git a/protobuf/dnspb/dns.pb.go b/protobuf/dnspb/dns.pb.go index 9208a73ac9..f9451c2b21 100644 --- a/protobuf/dnspb/dns.pb.go +++ b/protobuf/dnspb/dns.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.8 +// protoc-gen-go v1.27.1 +// protoc v3.21.12 // source: dnspb/dns.proto package dnspb diff --git a/protobuf/rpcpb/services.pb.go b/protobuf/rpcpb/services.pb.go index e1be3b3e3f..c923fc5c46 100644 --- a/protobuf/rpcpb/services.pb.go +++ b/protobuf/rpcpb/services.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.8 +// protoc-gen-go v1.27.1 +// protoc v3.21.12 // source: rpcpb/services.proto package rpcpb diff --git a/protobuf/sliverpb/sliver.pb.go b/protobuf/sliverpb/sliver.pb.go index ae02749cee..cefabe95a7 100644 --- a/protobuf/sliverpb/sliver.pb.go +++ b/protobuf/sliverpb/sliver.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.8 +// protoc-gen-go v1.27.1 +// protoc v3.21.12 // source: sliverpb/sliver.proto package sliverpb