redpwn / jail

An nsjail Docker image for CTF pwnables. Easily create secure, isolated xinetd/inetd-style services.
BSD 3-Clause "New" or "Revised" License
172 stars 13 forks source link

Exec format Error #27

Closed ladderlogix closed 2 months ago

ladderlogix commented 2 months ago
[E][2024-08-27T01:03:37+0000][1] newProc():225 execve('/app/run') failed: Exec format error

I get this error when running it on a Raspberry Pi 4 with Ubuntu 24.04.

uname -a result:

Linux challengeInstance 6.8.0-1004-raspi #4-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 02:29:55 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
ginkoid commented 2 months ago

Your Raspberry Pi is arm64 but your /app/run file is probably not arm64. You should compile it for arm64.

ladderlogix commented 2 months ago

How I tried,

RUN GOOS=linux GOARCH=arm64 go build -v -ldflags '-w -s' -o ./cmd/jailrun

in the docker and got errors with => ERROR [nsjail 5/5] RUN make -j

DarinMao commented 2 months ago

Jail itself does not need to be recompiled. The /app/run file that you created needs to be compiled for arm64.

ladderlogix commented 2 months ago

So then what will i need to change

DarinMao commented 2 months ago

We don't know anything about your /app/run file, so we can't help you here.

ladderlogix commented 2 months ago

It is a python script

ladderlogix commented 2 months ago
#!/usr/local/bin/python

Did not have the right shebang