BishopFox / sliver

Adversary Emulation Framework
GNU General Public License v3.0
8.54k stars 1.13k forks source link

Failed generate command with -a arm -o linux --wg #517

Open kfken opened 3 years ago

kfken commented 3 years ago

Sliver generate fails when trying to build linux/arm with wireguard C2

[server] sliver > generate -a arm -o linux -g 127.0.0.1:53 -N wg -b

⚠️  Unsupported compiler target linux/arm, but we can try to compile a Default implant.
⚠️  Default implants do not support all commands/features.
? Compile a Default build? Yes
[*] Generated unique ip for wg peer tun interface: 100.64.0.2
[*] Generating new linux/arm implant binary
[!] Symbol obfuscation is disabled
[!] rpc error: code = Unknown desc = exit status 1

Built sliver-server from source:

[*] Server v1.4.21 - 8cc3f1984a3f9d67fb56d8d27c2b7eec2318b57a

In sliver.log:

INFO[2021-09-26T14:56:23-04:00] [sliver/server/gogo/go.go:202] --- stdout ---

INFO[2021-09-26T14:56:23-04:00] [sliver/server/gogo/go.go:203] --- stderr ---
go: downloading google.golang.org/protobuf v1.23.0
go: downloading golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
go: downloading golang.zx2c4.com/wireguard v0.0.0-20210311162910-5f0c8b942d93
go: downloading inet.af/netstack v0.0.0-20210317161235-a1bf4e56ef22
go: downloading github.com/google/go-cmp v0.4.0
go: downloading golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
go: downloading github.com/google/btree v1.0.1
go: downloading golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
go: downloading golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
go: finding module for package github.com/bishopfox/sliver/implant/sliver/forwarder
github.com/bishopfox/sliver/implant/sliver/handlers imports
        github.com/bishopfox/sliver/implant/sliver/forwarder: no matching versions for query "latest"

INFO[2021-09-26T14:56:23-04:00] [sliver/server/gogo/go.go:204] exit status 1 
ERRO[2021-09-26T14:56:23-04:00] [sliver/server/generate/binaries.go:652] Go mod tidy failed: 
ERRO[2021-09-26T14:56:23-04:00] [github.com/grpc-ecosystem/go-grpc-middleware@v1.2.2/logging/logrus/options.go:215] finished unary call with code Unknown 

Additional context generate for http works

kfken commented 3 years ago

I see wg isn't included in handlers_default.go, but if I'm building for linux, shouldn't it be a non-default build, and use handlers_linux.go?

moloch-- commented 3 years ago

Wireguard is only supported on Windows/MacOS/Linux on amd64 for now, however you can maybe get it work with some hacks to the build process.