0% found this document useful (0 votes)
137 views5 pages

Preparing A Kali Linux ARM Chroot

Kali Linux

Uploaded by

gejib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
137 views5 pages

Preparing A Kali Linux ARM Chroot

Kali Linux

Uploaded by

gejib
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Home Translators Contribute to Kali Kali Forums F.A.

Have a question? Ask or enter a search term. SEARCH

English Preparing a Kali Linux ARM chroot


简体中文 Home / 06. Kali Linux ARM Architecture
Français
Deutsch
‫اﻟﻌﺮﺑﻴﺔ‬ Although you can download Kali ARM images from our Download area, some prefer building
Português
their own updated boostraped Kali rootfs. The following procedure shows an example of building
Nederlands
a Kali armhf rootfs. Change to armel if needed.
Italiano
Русский
Español
Install Required Tools and Dependencies
Categories
apt-get install debootstrap qemu-user-static
00. Introduction to Kali Linux

01. Downloading Kali Linux

02. Building Custom Kali Images Define Architecture and Custom Packages
03. Installing Kali Linux This is where you define some environment variables for your required ARM architecture (armel
04. Kali Linux Network Installs vs armhf) and list the packages to be installed in your image. These will be used throughout this
article, so make sure to modify them to your needs.
05. Kali Linux General Use

06. Kali Linux ARM Architecture export packages="xfce4 kali-menu wpasupplicant kali-defaults initramfs-tools uboot-mkimage nmap openssh-ser
export architecture="armhf"
07. Kali Linux Development

08. Troubleshooting Kali Linux

09. Kali Community Support


Build the Kali rootfs
10. Kali Linux Policies
We create a standard directory structure and bootstrap ARM rootfs from the Kali Linux
repositories. We then copy over qemu-arm-static from our host machine into the rootfs in order
Latest Articles
to initiate the 2nd stage chroot.
Custom EfikaMX Image

cd ~
Install Kali ARM on an EfikaMX
mkdir -p arm-stuff
cd arm-stuff/
Custom Beaglebone Black Image
mkdir -p kernel
mkdir -p rootfs
Install Kali ARM on a Beaglebone
cd rootfs
Black

Custom CuBox Image debootstrap --foreign --arch $architecture kali kali-$architecture [Link]
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
Install Kali ARM on a CuBox

Kali Linux [Link] repositories


2nd Stage chroot
Install NVIDIA Drivers on Kali Linux
This is where we configure base image settings such as keymaps, repositories, default network
Kali Linux on Galaxy Note 10.1 interface behavior (change if needed), etc.

Submitting Bugs for Kali Linux


cd ~/arm-stuff/rootfs
LANG=C chroot kali-$architecture /debootstrap/debootstrap --second-stage

Twitter Stream cat << EOF > kali-$architecture/etc/apt/[Link]


deb [Link] kali main contrib non-free
deb [Link] kali/updates main contrib non-free
EOF
Follow Us!

echo "kali" > kali-$architecture/etc/hostname

cat << EOF > kali-$architecture/etc/network/interfaces


auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
EOF

cat << EOF > kali-$architecture/etc/[Link]


nameserver [Link]
EOF

3rd Stage chroot

This is where your customization comes in. Your $packages are installed and a default “toor” root
password is set as well as other configuration changes and fixes.

export MALLOC_CHECK_=0 # workaround for LP: #520465


export LC_ALL=C
export DEBIAN_FRONTEND=noninteractive

mount -t proc proc kali-$architecture/proc


mount -o bind /dev/ kali-$architecture/dev/
mount -o bind /dev/pts kali-$architecture/dev/pts

cat << EOF > kali-$architecture/[Link]


console-common console-data/keymap/policy select Select keymap from full list
console-common console-data/keymap/full select en-latin1-nodeadkeys
EOF

cat << EOF > kali-$architecture/third-stage


#!/bin/bash
dpkg-divert --add --local --divert /usr/sbin/[Link] --rename /usr/sbin/invoke-rc.d
cp /bin/true /usr/sbin/invoke-rc.d

apt-get update
Manual Configuration Within the chroot
apt-get install locales-all
#locale-gen en_US.UTF-8
If needed, you can perform any final modifications in your rootfs environment by manually
debconf-set-selections /[Link]
chrooting into it and making any necessary last changes.

LANG=C chroot kali-$architecture


{make additional changes within the chroot}
exit

Cleanup
Lastly, we run a cleanup script in our chroot to free up space used by cached files and run any
other cleanup jobs we may require:

cat << EOF > kali-$architecture/cleanup


#!/bin/bash
rm -rf /root/.bash_history
apt-get update
apt-get clean
rm -f cleanup
EOF

chmod +x kali-$architecture/cleanup
LANG=C chroot kali-$architecture /cleanup

umount kali-$architecture/proc
umount kali-$architecture/dev/pts
umount kali-$architecture/dev/

cd ..

Congratulations! Your custom Kali ARM rootfs is located in the kali-$architecture directory. You
can now tar up this directory or copy it to an image file for further work.

Related Articles
Install Kali ARM on an EfikaMX

Install Kali ARM on a Beaglebone Black

Install Kali ARM on a CuBox

Kali Linux on Galaxy Note 10.1

© Copyright 2013, Offensive Security

English 简体中文 Français Deutsch ‫اﻟﻌﺮﺑﻴﺔ‬ Português Nederlands Italiano Русский Español

You might also like