Skip to content

Commit d935a03

Browse files
committed
Move DisableSGN out of protobuf since its client-side only
1 parent be6cfc9 commit d935a03

File tree

8 files changed

+15
-17
lines changed

8 files changed

+15
-17
lines changed

client/command/generate/generate-beacon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func GenerateBeaconCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
3232
save, _ = os.Getwd()
3333
}
3434
if !ctx.Flags.Bool("external-builder") {
35-
compile(config, save, con)
35+
compile(config, ctx.Flags.Bool("disable-sgn"), save, con)
3636
} else {
3737
externalBuild(config, save, con)
3838
}

client/command/generate/generate.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func GenerateCmd(ctx *grumble.Context, con *console.SliverConsoleClient) {
9999
save, _ = os.Getwd()
100100
}
101101
if !ctx.Flags.Bool("external-builder") {
102-
compile(config, save, con)
102+
compile(config, ctx.Flags.Bool("disable-sgn"), save, con)
103103
} else {
104104
_, err := externalBuild(config, save, con)
105105
if err != nil {
@@ -346,7 +346,6 @@ func parseCompileFlags(ctx *grumble.Context, con *console.SliverConsoleClient) *
346346
C2: c2s,
347347
CanaryDomains: canaryDomains,
348348
TemplateName: ctx.Flags.String("template"),
349-
DisableSGN: ctx.Flags.Bool("disable-sgn"),
350349

351350
WGPeerTunIP: tunIP.String(),
352351
WGKeyExchangePort: uint32(ctx.Flags.Int("key-exchange")),
@@ -756,7 +755,7 @@ func externalBuild(config *clientpb.ImplantConfig, save string, con *console.Sli
756755
return nil, nil
757756
}
758757

759-
func compile(config *clientpb.ImplantConfig, save string, con *console.SliverConsoleClient) (*commonpb.File, error) {
758+
func compile(config *clientpb.ImplantConfig, disableSGN bool, save string, con *console.SliverConsoleClient) (*commonpb.File, error) {
760759
if config.IsBeacon {
761760
interval := time.Duration(config.BeaconInterval)
762761
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
792791

793792
fileData := generated.File.Data
794793
if config.IsShellcode {
795-
if config.DisableSGN {
794+
if disableSGN {
796795
con.PrintErrorf("Shikata ga nai encoder is %sdisabled%s\n", console.Bold, console.Normal)
797796
} else {
798797
con.PrintInfof("Encoding shellcode with shikata ga nai ... ")

client/command/generate/profiles-generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func ProfilesGenerateCmd(ctx *grumble.Context, con *console.SliverConsoleClient)
4141
}
4242
profile := GetImplantProfileByName(name, con)
4343
if profile != nil {
44-
implantFile, err := compile(profile.Config, save, con)
44+
implantFile, err := compile(profile.Config, ctx.Flags.Bool("disable-sgn"), save, con)
4545
if err != nil {
4646
return
4747
}

protobuf/clientpb/client.pb.go

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf/commonpb/common.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf/dnspb/dns.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf/rpcpb/services.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobuf/sliverpb/sliver.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)