owasp-amass / amass

In-depth attack surface mapping and asset discovery
https://owasp.org/www-project-amass/
Other
11.78k stars 1.86k forks source link

Binary does not launch inside alpine Docker container #911

Open cosad3s opened 1 year ago

cosad3s commented 1 year ago

Example of Dockerfile built on alpine:

FROM alpine:latest
RUN wget https://github.com/OWASP/Amass/releases/download/v3.21.2/amass_linux_amd64.zip && unzip amass_linux_amd64.zip && chmod a+x amass_linux_amd64/amass
CMD [ "sh" ]

Build & run:

# sudo docker build -t myimage .
# sudo docker run -it myimage sh

# cd /amass_linux_amd64/
# stat ./amass 
  File: amass
  Size: 30515200        Blocks: 59608      IO Block: 4096   regular file
Device: 47h/71d Inode: 8590193     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-03-07 17:47:03.000000000 +0000
Modify: 2023-03-07 17:47:03.000000000 +0000
Change: 2023-03-07 17:47:04.179571957 +0000
# ./amass 
sh: ./amass: not found

The executable is not found.

Works fine inside a container based on ubuntu:latest for example:

FROM ubuntu:latest
RUN apt update && apt install -y wget unzip
RUN wget https://github.com/OWASP/Amass/releases/download/v3.21.2/amass_linux_amd64.zip && unzip amass_linux_amd64.zip && chmod a+x amass_linux_amd64/amass
CMD [ "sh" ]

The error could come from the absent file /lib64/ld-linux-x86-64.so.2 on alpine ? Is there any way to get amass compatible with alpine without compilation ?