From 7c330224089f6ebe4767b1b1a3414d574756e13b Mon Sep 17 00:00:00 2001 From: rkervella Date: Thu, 27 Apr 2023 15:18:24 -0700 Subject: [PATCH] Apply XOR to dnspb and commonpb too --- server/assets/assets.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/assets/assets.go b/server/assets/assets.go index 5175a892b1..596c10a313 100644 --- a/server/assets/assets.go +++ b/server/assets/assets.go @@ -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) @@ -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) @@ -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) @@ -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