You are not logged in.

#1 2020-09-26 17:29:33

wh0@m1r007
Member
Registered: 2020-09-26
Posts: 3

Cannot chroot to fully prepared jail

Hello everyone
I wonder what I do wrong, I simply cannot chroot to prepared jail.
This is how the jail directory structure looks like:

.
├── bin
│   ├── bash
│   ├── cat
│   ├── chmod
│   ├── ls
│   ├── ping
│   ├── scp
│   ├── sh
│   ├── ssh
│   ├── touch
│   └── whoami
├── etc
│   └── resolv.conf
└── usr
    ├── lib
    │   ├── libcap.so.2
    │   ├── libcom_err.so.2
    │   ├── libcrypto.so.1.1
    │   ├── libc.so.6
    │   ├── libdl.so.2
    │   ├── libgssapi_krb5.so.2
    │   ├── libidn2.so.0
    │   ├── libk5crypto.so.3
    │   ├── libkeyutils.so.1
    │   ├── libkrb5.so.3
    │   ├── libkrb5support.so.0
    │   ├── libldns.so.3
    │   ├── libncursesw.so.6
    │   ├── libpthread.so.0
    │   ├── libreadline.so.8
    │   ├── libresolv.so.2
    │   ├── libssl.so.1.1
    │   ├── libunistring.so.2
    │   └── libz.so.1
    └── lib64
        └── ld-linux-x86-64.so.2

Every single binary dependency has been checked automatically and manually several times.

When I try to chroot into this directory via

sudo chroot /absolute/path/to/jail/dir /bin/bash

It throws me:

chroot: failed to run command ‘/bin/bash’: No such file or directory

Thanks in advance.

Last edited by wh0@m1r007 (2020-09-26 17:40:08)

Offline

#2 2020-09-26 19:31:12

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,572

Re: Cannot chroot to fully prepared jail

Aren't you supposed to use arch-chroot instead of chroot?
https://wiki.archlinux.org/index.php/Chroot

Edit: I see what you're trying to do. Is the directory a separate mount point?

Last edited by d_fajardo (2020-09-26 19:34:51)

Offline

#3 2020-09-26 21:46:28

wh0@m1r007
Member
Registered: 2020-09-26
Posts: 3

Re: Cannot chroot to fully prepared jail

Edit: I see what you're trying to do. Is the directory a separate mount point?

yes
For example, my regular home directory

/home/user

My chroot jail path

/home/user/chrootjail

Offline

#4 2020-09-26 23:22:47

wh0@m1r007
Member
Registered: 2020-09-26
Posts: 3

Re: Cannot chroot to fully prepared jail

Upd: I've lifted Virtualbox with Ubuntu and it worked as it was initially expected with 0 problems, but it doesn't work in my main machine which runs Arch. Weird.

Offline

#5 2020-09-26 23:39:09

loqs
Member
Registered: 2014-03-06
Posts: 17,497

Re: Cannot chroot to fully prepared jail

The executables and libraries in the chroot are from Arch?

Offline

#6 2020-09-27 12:40:38

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,769
Website

Re: Cannot chroot to fully prepared jail

Can we see

uname -m
file /full/path/to/chroot/bin/bash
ldd /full/path/to/chroot/bin/bash

And as a side note I would observe that your "jail" should not be regarded as secure: https://deepsec.net/docs/Slides/2015/Ch … Balazs.pdf

Offline

Board footer

Powered by FluxBB