Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/command/generate/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ func coreBeaconFlags(name string, cmd *cobra.Command) {
f.Int64P("minutes", "M", 0, "beacon interval minutes")
f.Int64P("seconds", "S", 60, "beacon interval seconds")
f.Int64P("jitter", "J", 30, "beacon interval jitter in seconds")
f.BoolP("sleep-obfuscation", "B", false, "apply in-memory sleep obfuscation (Windows only)")
})
}

Expand Down
2 changes: 2 additions & 0 deletions client/command/generate/generate-beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ func parseBeaconFlags(cmd *cobra.Command, config *clientpb.ImplantConfig) error
beaconJitter, _ := cmd.Flags().GetInt64("jitter")
config.BeaconInterval = int64(interval)
config.BeaconJitter = int64(time.Duration(beaconJitter) * time.Second)

config.SleepObfuscation, _ = cmd.Flags().GetBool("sleep-obfuscation")
return nil
}

Expand Down
33 changes: 16 additions & 17 deletions client/command/generate/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,16 @@ func populateProfileProperties(config *clientpb.ImplantConfig) map[string]string
properties["obsymbols"] = "disabled"
}

properties["shellcodeencoder"] = "n/a"
if config.Format == clientpb.OutputFormat_SHELLCODE {
encoder := config.ShellcodeEncoder
if encoder == clientpb.ShellcodeEncoder_NONE && config.SGNEnabled {
encoder = clientpb.ShellcodeEncoder_SHIKATA_GA_NAI
}
properties["shellcodeencoder"] = map[clientpb.ShellcodeEncoder]string{
clientpb.ShellcodeEncoder_NONE: "none",
clientpb.ShellcodeEncoder_SHIKATA_GA_NAI: "shikata_ga_nai",
clientpb.ShellcodeEncoder_XOR: "xor",
clientpb.ShellcodeEncoder_XOR_DYNAMIC: "xor_dynamic",
}[encoder]
if properties["shellcodeencoder"] == "" {
properties["shellcodeencoder"] = fmt.Sprintf("unknown (%d)", int32(encoder))
}
if config.SGNEnabled {
properties["sgn"] = "enabled"
} else {
properties["sgn"] = "disabled"
}

if config.SleepObfuscation {
properties["sleepobf"] = "enabled"
} else {
properties["sleepobf"] = "disabled"
}

reconnect := int(config.ReconnectInterval / int64(math.Pow10(9)))
Expand Down Expand Up @@ -322,8 +317,12 @@ func PrintProfileInfo(name string, con *console.SliverClient) {
properties["obsymbols"],
})
tw.AppendRow(table.Row{
"Shellcode encoder is",
properties["shellcodeencoder"],
"Shikata Ga Nai (SGN) is",
properties["sgn"],
})
tw.AppendRow(table.Row{
"Sleep obfuscation is",
properties["sleepobf"],
})

con.PrintInfof("Obfuscation\n")
Expand Down
Loading