Skip to content

Commit

Permalink
Apply XOR to dnspb and commonpb too
Browse files Browse the repository at this point in the history
  • Loading branch information
rkervella committed Apr 27, 2023
1 parent 7522a0b commit 7c33022
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func SetupGoPath(goPathSrc string) error {
setupLog.Info("Static asset not found: constants.go")
return err
}
sliverpbGoSrc = xorSliverPBRawBytes(sliverpbGoSrc)
sliverpbGoSrc = xorPBRawBytes(sliverpbGoSrc)
sliverpbGoSrc = stripSliverpb(sliverpbGoSrc)
sliverpbDir := filepath.Join(goPathSrc, "github.com", "bishopfox", "sliver", "protobuf", "sliverpb")
os.MkdirAll(sliverpbDir, 0700)
Expand All @@ -274,6 +274,7 @@ func SetupGoPath(goPathSrc string) error {
setupLog.Info("Static asset not found: common.pb.go")
return err
}
commonpbSrc = xorPBRawBytes(commonpbSrc)
commonpbDir := filepath.Join(goPathSrc, "github.com", "bishopfox", "sliver", "protobuf", "commonpb")
os.MkdirAll(commonpbDir, 0700)
os.WriteFile(filepath.Join(commonpbDir, "common.pb.go"), commonpbSrc, 0600)
Expand All @@ -284,6 +285,7 @@ func SetupGoPath(goPathSrc string) error {
setupLog.Info("Static asset not found: dns.pb.go")
return err
}
dnspbSrc = xorPBRawBytes(dnspbSrc)
dnspbDir := filepath.Join(goPathSrc, "github.com", "bishopfox", "sliver", "protobuf", "dnspb")
os.MkdirAll(dnspbDir, 0700)
os.WriteFile(filepath.Join(dnspbDir, "dns.pb.go"), dnspbSrc, 0600)
Expand Down Expand Up @@ -312,7 +314,7 @@ func stripSliverpb(src []byte) []byte {
return out
}

func xorSliverPBRawBytes(src []byte) []byte {
func xorPBRawBytes(src []byte) []byte {
var (
fileAst *ast.File
err error
Expand Down

0 comments on commit 7c33022

Please sign in to comment.