___ _ _ __ _ _ ___
/ __| _ __| |_ ___ _ __ | |/ /__ _| (_) |_ _|_ __ __ _ __ _ ___
| (_| || (_-< _/ _ \ ' \ | ' </ _` | | | | || ' \/ _` / _` / -_)
\___\_,_/__/\__\___/_|_|_| |_|\_\__,_|_|_| |___|_|_|_\__,_\__, \___|
|___/
Here is where a nice intro will be written later on.
Here is a basic walk through
To start you should go ahead and ensure that your system is up to date. Then you will need to install a few packages specifically used for creation of live images. The full command for this is below:
sudo apt install -y git live-build cdebootstrap devscripts
Next, you will need to clone the build scripts that are used to create the live image.
git clone https://gitlab.com/kalilinux/build-scripts/live-build-config.git && cd live-build-config
cat <<EOF > kali-config/variant-default/package-lists/kali.list.chroot
kali-root-login
kali-linux-headless
kali-defaults
kali-debtags
kali-archive-keyring
debian-installer-launcher
locales-all
dconf-tools
openssh-server
hostapd-wpe
freeradius-wpe
freeradius-utils
isc-dhcp-server
sslsplit
responder
python3-pip
iw
wireless-tools
realtek-rtl88xxau-dkms
EOF
cat <<EOF > kali-config/common/includes.binary/isolinux/install.cfg
label install
menu label ^Install Automated
linux /install/vmlinuz
initrd /install/initrd.gz
append vga=788 -- quiet file=/cdrom/install/preseed.cfg locale=en_US keymap=us hostname=kali domain=local.lan
EOF
After this, Kali developers advise installing one of those trendy wallpapers, but we are not, because we are hardcore like that.
mkdir -p kali-config/common/debian-installer/
wget https://gitlab.com/kalilinux/recipes/kali-preseed-examples/-/raw/master/kali-linux-full-unattended.preseed -O kali-config/common/debian-installer/preseed.cfg
./build.sh -v
We like this one and even better, it can installed in one script.
#!/bin/bash
# Kali Linux ISO recipe for : Evil Access Point
#########################################################################################
# Desktop : None
# Metapackages : None
# ISO size : 1.36 GB
# Special notes : Boots into an Access Point.
# : ppp0 and wlan0 hardcoded.
# Background : http://www.offensive-security.com/kali-linux/kali-linux-recipes/
#########################################################################################
# Update and install dependencies
apt-get update
apt-get install git live-build cdebootstrap -y
# Clone the default Kali live-build config.
git clone https://gitlab.com/kalilinux/build-scripts/live-build-config.git
# Let's begin our customisations:
cd live-build-config
# The user doesn't need the kali-linux-full metapackage, we overwrite with our own basic packages.
cat <<EOF > config/package-lists/kali.list.chroot
# kali meta-package depends on everything we want
kali-root-login
kali-defaults
kali-archive-keyring
debian-installer-launcher
cryptsetup
locales-all
hostapd
dnsmasq
nginx
wireless-tools
iw
aircrack-ng
openssl
sslsplit
responder
openssh-server
openvpn
EOF
mkdir -p config/includes.chroot/etc/hostapd
mkdir -p config/includes.chroot/etc/init.d
cat <<EOF > config/includes.chroot/etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=KaliFreeWifi
channel=1
EOF
cat <<EOF > config/includes.chroot/etc/dnsmasq.conf
log-facility=/var/log/dnsmasq.log
#address=/#/10.0.0.1
#address=/google.com/10.0.0.1
interface=wlan0
dhcp-range=10.0.0.10,10.0.0.250,12h
dhcp-option=3,10.0.0.1
dhcp-option=6,10.0.0.1
#no-resolv
log-queries
EOF
cat <<EOF >> config/includes.chroot/etc/iptables.rules
# Generated by iptables-save v1.4.14 on Mon Jun 9 08:46:32 2014
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Mon Jun 9 08:46:32 2014
# Generated by iptables-save v1.4.14 on Mon Jun 9 08:46:32 2014
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Mon Jun 9 08:46:32 2014
EOF
cat <<EOF > config/includes.chroot/etc/rc.local
#!/bin/bash
ifconfig wlan0 up
ifconfig wlan0 10.0.0.1/24
iptables-restore < /etc/iptables.rules
echo '1' > /proc/sys/net/ipv4/ip_forward
EOF
cat <<EOF >config/hooks/enableservices.chroot
#!/bin/bash
update-rc.d nginx enable
update-rc.d hostapd enable
update-rc.d dnsmasq enable
EOF
cat <<EOF >config/hooks/configurehostapd.chroot
#!/bin/bash
sed -i 's#^DAEMON_CONF=.*#DAEMON_CONF=/etc/hostapd/hostapd.conf#' /etc/init.d/hostapd
EOF
chmod 755 config/hooks/enableservices.chroot
chmod 755 config/hooks/configurehostapd.chroot
chmod 755 config/includes.chroot/etc/rc.local
# Go ahead and run the build!
lb build