This lab will allow you to practice creating a chrooted environment, adding access to Linux commands, along with including shared libraries for these commands.
You will create a chrooted jailed environment as well as ensuring the inmates can `cat` out the false escape plans that you will leave behind.
Successfully complete this lab by achieving the following learning objectives:
- Create a directory named /home/elba
Create a directory for
- Create a new user called napoleon.
Create a new user for your environment named
- Create the bin and lib64 directories in /home/elba
Create two new directories,
lib64, within the
- Copy /bin/bash into /home/elba/bin/bash.
cp /bin/bash /home/elba/bin/bash
- Copy /bin/ls in to /home/elba/bin/ls
cp /bin/ls /home/elba/bin/ls
- Copy /bin/cat in to /home/elba/bin/cat
cp /bin/cat /home/elba/bin/cat
- Copy the libraries needed for bash, ls, and cat over to /home/elba/lib64.
Find and copy the libraries needed for
ldd /bin/bash /bin/ls /bin/cat
cp /lib64/libtinfo.so.5 /lib64/libdl.so.2 /lib64/ld-linux-x86-64.so.2 /lib64/libselinux.so.1 /lib64/librt.so.1 /lib64/libcap.so.2 /lib64/libacl.so.1 /lib64/libc.so.6 /lib64/libpthread.so.0 /lib64/libattr.so.1 /lib64/libpcre.so.1 /home/elba/lib64
- Create the waterloo.txt file in the /home/elba directory
vi, create the
waterloo.txtfile in the
/home/elbadirectory with instructions on how to escape.
- Create a chrooted environment in /home/elba with a bash shell.
chrootcommand, create a chrooted environment in
/home/elbawith a Bash shell.
chroot /home/elba /bin/bash
- Confirm commands work.
Using the command
pwd, confirm the present working directory and then confirm that you can use the
- View the contents of waterloo.txt and find out how to escape your environment.
View the contents of
waterloo.txtand find out how to escape your environment.