Skip to content

Commit 7c33022

Browse files
committedApr 27, 2023
Apply XOR to dnspb and commonpb too
1 parent 7522a0b commit 7c33022

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎server/assets/assets.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ func SetupGoPath(goPathSrc string) error {
261261
setupLog.Info("Static asset not found: constants.go")
262262
return err
263263
}
264-
sliverpbGoSrc = xorSliverPBRawBytes(sliverpbGoSrc)
264+
sliverpbGoSrc = xorPBRawBytes(sliverpbGoSrc)
265265
sliverpbGoSrc = stripSliverpb(sliverpbGoSrc)
266266
sliverpbDir := filepath.Join(goPathSrc, "github.com", "bishopfox", "sliver", "protobuf", "sliverpb")
267267
os.MkdirAll(sliverpbDir, 0700)
@@ -274,6 +274,7 @@ func SetupGoPath(goPathSrc string) error {
274274
setupLog.Info("Static asset not found: common.pb.go")
275275
return err
276276
}
277+
commonpbSrc = xorPBRawBytes(commonpbSrc)
277278
commonpbDir := filepath.Join(goPathSrc, "github.com", "bishopfox", "sliver", "protobuf", "commonpb")
278279
os.MkdirAll(commonpbDir, 0700)
279280
os.WriteFile(filepath.Join(commonpbDir, "common.pb.go"), commonpbSrc, 0600)
@@ -284,6 +285,7 @@ func SetupGoPath(goPathSrc string) error {
284285
setupLog.Info("Static asset not found: dns.pb.go")
285286
return err
286287
}
288+
dnspbSrc = xorPBRawBytes(dnspbSrc)
287289
dnspbDir := filepath.Join(goPathSrc, "github.com", "bishopfox", "sliver", "protobuf", "dnspb")
288290
os.MkdirAll(dnspbDir, 0700)
289291
os.WriteFile(filepath.Join(dnspbDir, "dns.pb.go"), dnspbSrc, 0600)
@@ -312,7 +314,7 @@ func stripSliverpb(src []byte) []byte {
312314
return out
313315
}
314316

315-
func xorSliverPBRawBytes(src []byte) []byte {
317+
func xorPBRawBytes(src []byte) []byte {
316318
var (
317319
fileAst *ast.File
318320
err error

0 commit comments

Comments
 (0)
Please sign in to comment.