sliver icon indicating copy to clipboard operation
sliver copied to clipboard

failed to generate implants (format: shared) for alpine linux (musl)

Open cristal-node opened this issue 2 years ago • 1 comments

version: v1.5.40 - c17c37857e54f0fa202c01cbd00a99a85f5f9f49

Describe the bug can not generate shared format implants for alpine linux (or maybe any musl type, without glibc).

To Reproduce Steps to reproduce the behavior:

  1. apk add gcompat build-base --no-cache (packaged go binary depends on glibc)
  2. download sliver-linux_server
  3. generate command: generate -o linux -f shared -R -d -m example.com, shows no errors and generates a shared library successfully.
  4. LD_PRELOAD=/RELEVANT_CONDUCTOR.so /bin/ls errors with Segmentation fault

also tested installing go from the alpine repo: apk add go. and linked the go root (ln -s /usr $SLIVER_ROOT_DIR/go) but didn't help.

Expected behavior the implant runs successfully.

Logs strace: strace.txt

Desktop (please complete the following information):

  • OS: docker using alpine:latest or alpine:3.18.2 tried both locally and in vps.
  • Version v1.5.40 - c17c37857e54f0fa202c01cbd00a99a85f5f9f49

Additional context implant generated on debian with glibc seems to work as expected. maybe a glibc related issue? couldn't find any similar issue, is it expected? do i must have glibc for shared format on the implant system?

cristal-node avatar Jul 11 '23 15:07 cristal-node

That's a limitation of the Go toolchain as far as I know, nothing much we can do at this point. I think it might get better in the future, but it's out of our control for now.

rkervella avatar Jul 11 '23 15:07 rkervella