Skip to content

Commit

Permalink
remove BeaconJitter sig
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmith257-cyber committed Jul 15, 2024
1 parent 0753ef1 commit c871436
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions client/command/generate/generate-beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func parseBeaconFlags(cmd *cobra.Command, config *clientpb.ImplantConfig) error
return ErrBeaconIntervalTooShort
}

BeaconJitter, _ := cmd.Flags().GetInt64("jitter")
BaconJitter, _ := cmd.Flags().GetInt64("jitter")
config.BaconInterval = int64(interval)
config.BeaconJitter = int64(time.Duration(BeaconJitter) * time.Second)
config.BaconJitter = int64(time.Duration(BaconJitter) * time.Second)
return nil
}
6 changes: 3 additions & 3 deletions client/command/generate/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ func populateProfileProperties(config *clientpb.ImplantConfig) map[string]string
properties["osarch"] = fmt.Sprintf("%s %s", strings.Title(config.GOOS), strings.ToUpper(config.GOARCH))
if config.IsBeacon {
properties["implanttype"] = "Beacon"
jitter := int(config.BeaconJitter / int64(math.Pow10(9)))
jitter := int(config.BaconJitter / int64(math.Pow10(9)))
plural = "s"
if jitter == 1 {
plural = ""
}
properties["BeaconJitter"] = fmt.Sprintf("%d second%s", jitter, plural)
properties["BaconJitter"] = fmt.Sprintf("%d second%s", jitter, plural)
interval := int(config.BaconInterval / int64(math.Pow10(9)))
plural = "s"
if interval == 1 {
Expand Down Expand Up @@ -327,7 +327,7 @@ func PrintProfileInfo(name string, con *console.SliverClient) {
})
tw.AppendRow(table.Row{
"Beacon Jitter",
properties["BeaconJitter"],
properties["BaconJitter"],
})
}
tw.AppendRow(table.Row{
Expand Down
8 changes: 4 additions & 4 deletions client/command/reconfig/reconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func ReconfigCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
}

var BaconInterval time.Duration
var BeaconJitter time.Duration
var BaconJitter time.Duration
binterval, _ := cmd.Flags().GetString("beacon-interval")
bjitter, _ := cmd.Flags().GetString("beacon-jitter")

Expand All @@ -62,12 +62,12 @@ func ReconfigCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
}
}
if bjitter != "" {
BeaconJitter, err = time.ParseDuration(bjitter)
BaconJitter, err = time.ParseDuration(bjitter)
if err != nil {
con.PrintErrorf("Invalid beacon jitter: %s\n", err)
return
}
if BaconInterval == 0 && BeaconJitter != 0 {
if BaconInterval == 0 && BaconJitter != 0 {
con.PrintInfof("Modified beacon jitter will take effect after next check-in\n")
}
}
Expand All @@ -76,7 +76,7 @@ func ReconfigCmd(cmd *cobra.Command, con *console.SliverClient, args []string) {
reconfig, err := con.Rpc.Reconfigure(context.Background(), &sliverpb.ReconfigureReq{
ReconnectInterval: int64(reconnectInterval),
BaconInterval: int64(BaconInterval),
BeaconJitter: int64(BeaconJitter),
BaconJitter: int64(BaconJitter),
Request: con.ActiveTarget.Request(cmd),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion client/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func (con *SliverClient) GetActiveBeaconConfig() *clientpb.ImplantConfig {
Debug: false,
IsBeacon: true,
BaconInterval: beacon.Interval,
BeaconJitter: beacon.Jitter,
BaconJitter: beacon.Jitter,
Evasion: beacon.Evasion,
MaxConnectionErrors: uint32(1000),
ReconnectInterval: int64(60),
Expand Down
4 changes: 2 additions & 2 deletions implant/sliver/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1257,8 +1257,8 @@ func reconfigureHandler(data []byte, resp RPCResponse) {
if reconfigReq.BaconInterval != 0 {
transports.SetInterval(reconfigReq.BaconInterval)
}
if reconfigReq.BeaconJitter != 0 {
transports.SetJitter(reconfigReq.BeaconJitter)
if reconfigReq.BaconJitter != 0 {
transports.SetJitter(reconfigReq.BaconJitter)
}
// {{end}}

Expand Down
2 changes: 1 addition & 1 deletion implant/sliver/transports/transports.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func SetReconnectInterval(interval int64) {
// GetJitter - Get the beacon jitter {{if .Config.IsBeacon}}
func GetJitter() int64 {
if jitter == time.Duration(0) {
configJitter, err := strconv.ParseInt(`{{.Config.BeaconJitter}}`, 10, 64)
configJitter, err := strconv.ParseInt(`{{.Config.BaconJitter}}`, 10, 64)
jitter = time.Duration(configJitter)
if err != nil {
jitter = time.Duration(30 * time.Second)
Expand Down
4 changes: 2 additions & 2 deletions protobuf/clientpb/client.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protobuf/clientpb/client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ message ImplantConfig {
string ImplantProfileID = 3;
bool IsBeacon = 4;
int64 BaconInterval = 5;
int64 BeaconJitter = 6;
int64 BaconJitter = 6;

string GOOS = 7;
string GOARCH = 8;
Expand Down
4 changes: 2 additions & 2 deletions protobuf/sliverpb/sliver.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protobuf/sliverpb/sliver.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ message WGTCPForwarders {
message ReconfigureReq {
int64 ReconnectInterval = 1;
int64 BaconInterval = 2;
int64 BeaconJitter = 3;
int64 BaconJitter = 3;

commonpb.Request Request = 9;
}
Expand Down
6 changes: 3 additions & 3 deletions server/db/models/implant.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ type ImplantConfig struct {

IsBeacon bool
BaconInterval int64
BeaconJitter int64
BaconJitter int64

Debug bool
DebugFile string
Expand Down Expand Up @@ -242,7 +242,7 @@ func (ic *ImplantConfig) ToProtobuf() *clientpb.ImplantConfig {

IsBeacon: ic.IsBeacon,
BaconInterval: ic.BaconInterval,
BeaconJitter: ic.BeaconJitter,
BaconJitter: ic.BaconJitter,

GOOS: ic.GOOS,
GOARCH: ic.GOARCH,
Expand Down Expand Up @@ -444,7 +444,7 @@ func ImplantConfigFromProtobuf(pbConfig *clientpb.ImplantConfig) *ImplantConfig

cfg.IsBeacon = pbConfig.IsBeacon
cfg.BaconInterval = pbConfig.BaconInterval
cfg.BeaconJitter = pbConfig.BeaconJitter
cfg.BaconJitter = pbConfig.BaconJitter

cfg.GOOS = pbConfig.GOOS
cfg.GOARCH = pbConfig.GOARCH
Expand Down
4 changes: 2 additions & 2 deletions server/rpc/rpc-reconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func (rpc *Server) Reconfigure(ctx context.Context, req *sliverpb.ReconfigureReq
if req.BaconInterval != 0 {
beacon.Interval = req.BaconInterval
}
if req.BeaconJitter != 0 {
beacon.Jitter = req.BeaconJitter
if req.BaconJitter != 0 {
beacon.Jitter = req.BaconJitter
}
err = db.Session().Save(beacon).Error
if err != nil {
Expand Down

0 comments on commit c871436

Please sign in to comment.