Skip to content

Commit

Permalink
Merge pull request #1699 from BishopFox/fix_externalbuild_encoderids
Browse files Browse the repository at this point in the history
send encoder id's to external server during external implant generation
  • Loading branch information
moloch-- committed May 22, 2024
2 parents 292f41c + 550700d commit a0706ff
Show file tree
Hide file tree
Showing 9 changed files with 2,186 additions and 1,962 deletions.
3,201 changes: 1,610 additions & 1,591 deletions protobuf/clientpb/client.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions protobuf/clientpb/client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ message ExternalImplantConfig {
ImplantConfig Config = 1;
ImplantBuild Build = 2;
HTTPC2Config HTTPC2 = 3;
map<string, uint64> encoders = 4;
}

message ExternalImplantBinary {
Expand Down
4 changes: 2 additions & 2 deletions protobuf/commonpb/common.pb.go

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

4 changes: 2 additions & 2 deletions protobuf/dnspb/dns.pb.go

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

4 changes: 2 additions & 2 deletions protobuf/rpcpb/services.pb.go

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

905 changes: 545 additions & 360 deletions protobuf/rpcpb/services_grpc.pb.go

Large diffs are not rendered by default.

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.

8 changes: 8 additions & 0 deletions server/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/bishopfox/sliver/protobuf/rpcpb"
"github.com/bishopfox/sliver/server/db"
"github.com/bishopfox/sliver/server/db/models"
"github.com/bishopfox/sliver/server/encoders"
"github.com/bishopfox/sliver/server/generate"
"github.com/bishopfox/sliver/server/log"
"google.golang.org/grpc"
Expand Down Expand Up @@ -188,6 +189,13 @@ func (b *Builder) handleBuildEvent(event *clientpb.Event) {
})
return
}
encoders.Base32EncoderID = extConfig.Encoders["base32"]
encoders.Base58EncoderID = extConfig.Encoders["base58"]
encoders.Base64EncoderID = extConfig.Encoders["base64"]
encoders.EnglishEncoderID = extConfig.Encoders["english"]
encoders.GzipEncoderID = extConfig.Encoders["gzip"]
encoders.HexEncoderID = extConfig.Encoders["hex"]
encoders.PNGEncoderID = extConfig.Encoders["png"]

var fPath string
switch extConfig.Config.Format {
Expand Down
17 changes: 14 additions & 3 deletions server/rpc/rpc-generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,21 @@ func (rpc *Server) GenerateExternalGetBuildConfig(ctx context.Context, req *clie
return nil, status.Error(codes.Internal, fmt.Sprintf("Unable to load HTTP C2 Configuration: %s", err))
}

encoders := map[string]uint64{
"base64": encoders.Base64EncoderID,
"base58": encoders.Base58EncoderID,
"base32": encoders.Base32EncoderID,
"hex": encoders.HexEncoderID,
"english": encoders.EnglishEncoderID,
"gzip": encoders.GzipEncoderID,
"png": encoders.PNGEncoderID,
}

return &clientpb.ExternalImplantConfig{
Config: implantConfig,
Build: build,
HTTPC2: httpC2Config,
Config: implantConfig,
Build: build,
HTTPC2: httpC2Config,
Encoders: encoders,
}, nil
}

Expand Down

0 comments on commit a0706ff

Please sign in to comment.