BishopFox / sliver

Adversary Emulation Framework
GNU General Public License v3.0
7.89k stars 1.05k forks source link

panic: runtime error: index out of range [1] with length 1 #1729

Open worklitao opened 1 week ago

worklitao commented 1 week ago

Source code from https://github.com/BishopFox/sliver.git, version 1.6.0 , kali OS: └─$ cat /etc/os-release PRETTY_NAME="Kali GNU/Linux Rolling" NAME="Kali GNU/Linux" VERSION_ID="2024.2" VERSION="2024.2" VERSION_CODENAME=kali-rolling ID=kali ID_LIKE=debian HOME_URL="https://www.kali.org/" SUPPORT_URL="https://forums.kali.org/" BUG_REPORT_URL="https://bugs.kali.org/" ANSI_COLOR="1;31" Compile: └─$ make linux-amd64

checking sliver server version, no feedback └─# . /sliver-server version , no hints Also check the sliver client version, again no feedback

Run └─# . /sliver-server ,does not work and prompts: Unpacking assets ... panic: runtime error: index out of range [1] with length 1

goroutine 52 [running]: github.com/bishopfox/sliver/server/rpc.(Server).GetVersion(0xd5e0270?, {0x2a2f2e0?, 0x2a86288?}, 0xf?) github.com/bishopfox/sliver/server/rpc/rpc.go:90 +0x13d github.com/bishopfox/sliver/protobuf/rpcpb._SliverRPC_GetVersion_Handler.func1({0xc01bb28?, 0xc0004eb680?}, {0x27b7ea0?, 0xc0004eb1d0?}) github.com/bishopfox/sliver/protobuf/rpcpb/services_grpc.pb.go:3006 +0xce github.com/bishopfox/sliver/server/transport.initMiddleware.PayloadUnaryServerInterceptor.func16({0xc01bb28, 0xc0004eb680}, {0x27b7ea0, 0xc0004eb1d0}, 0x0?, 0xc003326300) github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/logging/logrus/payload_interceptors.go:29 +0x179 google.golang.org/grpc.getChainUnaryHandler.func1({0xc01bb28, 0xc0004eb680}, {0x27b7ea0, 0xc0004eb1d0}) google.golang.org/grpc@v1.64.0/server.go:1196 +0xb2 github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus.UnaryServerInterceptor.func1({0xc01bb28, 0xc0004eb590}, {0x27b7ea0, 0xc0004eb1d0}, 0xc01ddd0220, 0xc00038fcc0) github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/logging/logrus/server_interceptors.go:31 +0xfe google.golang.org/grpc.getChainUnaryHandler.func1({0xc01bb28, 0xc0004eb590}, {0x27b7ea0, 0xc0004eb1d0}) google.golang.org/grpc@v1.64.0/server.go:1196 +0xb2 github.com/grpc-ecosystem/go-grpc-middleware/tags.UnaryServerInterceptor.func1({0xc01bb28?, 0xc0004eb230?}, {0x27b7ea0, 0xc0004eb1d0}, 0xc01ddd0220, 0xc00038fc80) github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/tags/interceptors.go:23 +0x9c google.golang.org/grpc.getChainUnaryHandler.func1({0xc01bb28, 0xc0004eb230}, {0x27b7ea0, 0xc0004eb1d0}) google.golang.org/grpc@v1.64.0/server.go:1196 +0xb2 github.com/bishopfox/sliver/server/transport.initMiddleware.auditLogUnaryServerInterceptor.func14({0xc01bb28, 0xc0004eb230}, {0x27b7ea0, 0xc0004eb1d0}, 0xc01ddd0220, 0xc00038fc00) github.com/bishopfox/sliver/server/transport/middleware.go:317 +0x3e8 google.golang.org/grpc.getChainUnaryHandler.func1({0xc01bb28, 0xc0004eb230}, {0x27b7ea0, 0xc0004eb1d0}) google.golang.org/grpc@v1.64.0/server.go:1196 +0xb2 github.com/bishopfox/sliver/server/transport.initMiddleware.UnaryServerInterceptor.func13({0xc01bb28?, 0xc0004eb1a0?}, {0x27b7ea0, 0xc0004eb1d0}, 0xc01ddd0220?, 0xc00038fbc0) github.com/grpc-ecosystem/go-grpc-middleware@v1.4.0/auth/auth.go:47 +0x91 google.golang.org/grpc.NewServer.chainUnaryServerInterceptors.chainUnaryInterceptors.func1({0xc01bb28, 0xc0004eb1a0}, {0x27b7ea0, 0xc0004eb1d0}, 0xc01ddd0220, 0x80?) google.golang.org/grpc@v1.64.0/server.go:1187 +0x85 github.com/bishopfox/sliver/protobuf/rpcpb._SliverRPC_GetVersion_Handler({0x2a2f2e0, 0xd6b7540}, {0xc01bb28, 0xc0004eb1a0}, 0xc00027c200, 0xc0003c6980) github.com/bishopfox/sliver/protobuf/rpcpb/services_grpc.pb.go:3008 +0x143 google.golang.org/grpc.(Server).processUnaryRPC(0xc00067fc00, {0xc01bb28, 0xc0004eb110}, {0xc02c660, 0xc000158300}, 0xc0033287e0, 0xc0004533e0, 0xd640d00, 0x0) google.golang.org/grpc@v1.64.0/server.go:1379 +0xdf8 google.golang.org/grpc.(Server).handleStream(0xc00067fc00, {0xc02c660, 0xc000158300}, 0xc0033287e0) google.golang.org/grpc@v1.64.0/server.go:1790 +0xe8b google.golang.org/grpc.(Server).serveStreams.func2.1() google.golang.org/grpc@v1.64.0/server.go:1029 +0x8b created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 9 google.golang.org/grpc@v1.64.0/server.go:1040 +0x125

worklitao commented 1 week ago

The runtime version of go is: kali-$ go version go version go1.22.3 linux/amd64

moloch-- commented 1 week ago

You're maybe missing the .git directory?

worklitao commented 1 week ago

I analyzed it, I downloaded the source zip from the web, version 1.60, and it compiled and run with errors, plus there was no .git directory after the compiled. I also tried a lower version, and it works fine after the same mutation. It should be a problem with the source code.

fusion4bass commented 1 week ago

I have the same problem on 6.3.0-kali1-cloud-amd64. I tried doing fresh install on pure Debian and on Arch and both work. Only Kali seems to have issue.