More cleanup across the scripts
This commit is contained in:
25
banana-pi.sh
25
banana-pi.sh
@@ -7,12 +7,19 @@ fi
|
||||
|
||||
basedir=`pwd`/bananapi-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-bananapi
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -194,13 +201,13 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-bananapi.img bs=1M count=7000
|
||||
parted kali-linux-$1-bananapi.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-bananapi.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted kali-linux-$1-bananapi.img --script -- mkpart primary ext4 264192s 100%
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-bananapi.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -322,13 +329,13 @@ fi
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-bananapi.img"
|
||||
pixz ${basedir}/kali-linux-$1-bananapi.img ${basedir}/../kali-linux-$1-bananapi.img.xz
|
||||
rm ${basedir}/kali-linux-$1-bananapi.img
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}
|
||||
rm -rf ${basedir}
|
||||
@@ -12,12 +12,19 @@ fi
|
||||
|
||||
basedir=`pwd`/bananapro-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-bananapro
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -169,13 +176,13 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-bananapro.img bs=1M count=7000
|
||||
parted kali-linux-$1-bananapro.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-bananapro.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted kali-linux-$1-bananapro.img --script -- mkpart primary ext4 264192s 100%
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-bananapro.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -287,23 +294,16 @@ umount $bootp
|
||||
umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}/u-boot-bananapi ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot ${basedir}/patches ${basedir}/*sunxi*
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha256sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha256sum of kali-linux-$1-bananapro.img"
|
||||
sha256sum kali-linux-$1-bananapro.img > ${basedir}/kali-linux-$1-bananapro.img.sha256sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-bananapro.img"
|
||||
pixz ${basedir}/kali-linux-$1-bananapro.img ${basedir}/kali-linux-$1-bananapro.img.xz
|
||||
rm ${basedir}/kali-linux-$1-bananapro.img
|
||||
echo "Generating sha256sum of kali-linux-$1-bananapro.img.xz"
|
||||
sha256sum kali-linux-$1-bananapro.img.xz > ${basedir}/kali-linux-$1-bananapro.img.xz.sha256sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
34
bbb.sh
34
bbb.sh
@@ -12,10 +12,17 @@ fi
|
||||
|
||||
basedir=`pwd`/beaglebone-black-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-bbb
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
@@ -51,7 +58,7 @@ mkdir -p ${basedir}
|
||||
cd ${basedir}
|
||||
|
||||
# create the rootfs - not much to modify here, except maybe the hostname.
|
||||
if [ $0 == 'nightly' ]; then
|
||||
if [ $1 == 'nightly' ]; then
|
||||
debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http://$mirror/kali
|
||||
else
|
||||
debootstrap --foreign --arch $architecture kali-last-snapshot kali-$architecture http://$mirror/kali
|
||||
@@ -209,14 +216,14 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for Beaglebone Black"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-bbb.img bs=1M count=7000
|
||||
parted kali-linux-$1-bbb.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-bbb.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted kali-linux-$1-bbb.img --script -- mkpart primary ext4 264192s 100%
|
||||
echo "Creating image file for $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-bbb.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -361,8 +368,6 @@ ln -s /usr/src/kernel build
|
||||
ln -s /usr/src/kernel source
|
||||
cd ${basedir}
|
||||
|
||||
|
||||
|
||||
# Unused currently, but this script is a part of using the usb as an ethernet
|
||||
# device.
|
||||
wget -c https://raw.github.com/RobertCNelson/tools/master/scripts/beaglebone-black-g-ether-load.sh -O ${basedir}/root/root/beaglebone-black-g-ether-load.sh
|
||||
@@ -383,17 +388,16 @@ umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
losetup -d $loopdevice
|
||||
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-bbb.img"
|
||||
pixz ${basedir}/kali-linux-$1-bbb.img ${basedir}/../kali-linux-$1-bbb.img.xz
|
||||
rm ${basedir}/kali-linux-$1-bbb.img
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}
|
||||
rm -rf ${basedir}
|
||||
@@ -12,12 +12,19 @@ fi
|
||||
|
||||
basedir=`pwd`/nyan-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-acer
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -42,11 +49,11 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="alsa-utils e2fsprogs initramfs-tools kali-defaults kali-menu laptop-mode-tools parted sudo usbutils"
|
||||
base="alsa-utils e2fsprogs initramfs-tools kali-defaults kali-menu laptop-mode-tools parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev xserver-xorg-input-synaptics xserver-xorg-input-all xserver-xorg-input-libinput"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
extras="iceweasel xfce4-goodies xfce4-terminal wpasupplicant firmware-linux firmware-linux-nonfree firmware-libertas firmware-atheros"
|
||||
extras="iceweasel xfce4-goodies xfce4-terminal wpasupplicant"
|
||||
|
||||
packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
|
||||
architecture="armhf"
|
||||
@@ -166,16 +173,16 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/dev/
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
echo "Creating image file for Acer Chromebook"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-acer.img bs=1M count=7000
|
||||
parted kali-linux-$1-acer.img --script -- mklabel gpt
|
||||
cgpt create -z kali-linux-$1-acer.img
|
||||
cgpt create kali-linux-$1-acer.img
|
||||
echo "Creating image file for $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel gpt
|
||||
cgpt create -z $imagename.img
|
||||
cgpt create $imagename.img
|
||||
|
||||
cgpt add -i 1 -t kernel -b 8192 -s 32768 -l kernel -S 1 -T 5 -P 10 kali-linux-$1-acer.img
|
||||
cgpt add -i 2 -t data -b 40960 -s `expr $(cgpt show kali-linux-$1-acer.img | grep 'Sec GPT table' | awk '{ print \$1 }') - 40960` -l Root kali-linux-$1-acer.img
|
||||
cgpt add -i 1 -t kernel -b 8192 -s 32768 -l kernel -S 1 -T 5 -P 10 $imagename.img
|
||||
cgpt add -i 2 -t data -b 40960 -s `expr $(cgpt show $imagename.img | grep 'Sec GPT table' | awk '{ print \$1 }') - 40960` -l Root $imagename.img
|
||||
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-acer.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -478,9 +485,9 @@ losetup -d $loopdevice
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-acer.img"
|
||||
pixz ${basedir}/kali-linux-$1-acer.img ${basedir}/../kali-linux-$1-acer.img.xz
|
||||
rm ${basedir}/kali-linux-$1-acer.img
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
|
||||
@@ -12,7 +12,9 @@ fi
|
||||
|
||||
basedir=`pwd`/exynos-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-exynos
|
||||
|
||||
if [ $2 ]; then
|
||||
|
||||
@@ -12,7 +12,9 @@ fi
|
||||
|
||||
basedir=`pwd`/veyron-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-veyron
|
||||
|
||||
if [ $2 ]; then
|
||||
|
||||
@@ -12,12 +12,19 @@ fi
|
||||
|
||||
basedir=`pwd`/cubieboard2-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-cubieboard2
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -42,7 +49,7 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
@@ -123,7 +130,6 @@ apt-get update
|
||||
apt-get -y install git-core binutils ca-certificates initramfs-tools u-boot-tools
|
||||
apt-get -y install locales console-common less nano git
|
||||
echo "root:toor" | chpasswd
|
||||
sed -i -e 's/KERNEL\!=\"eth\*|/KERNEL\!=\"/' /lib/udev/rules.d/75-persistent-net-generator.rules
|
||||
rm -f /etc/udev/rules.d/70-persistent-net.rules
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get --yes --allow-change-held-packages install $packages
|
||||
@@ -164,13 +170,13 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-cubieboard2.img bs=1M count=7000
|
||||
parted kali-linux-$1-cubieboard2.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-cubieboard2.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted kali-linux-$1-cubieboard2.img --script -- mkpart primary ext4 264192s 100%
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-cubieboard2.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -273,27 +279,21 @@ chmod 755 ${basedir}/root/etc/init.d/zram
|
||||
sed -i -e 's/^#PermitRootLogin.*/PermitRootLogin yes/' ${basedir}/root/etc/ssh/sshd_config
|
||||
|
||||
# Unmount partitions
|
||||
sync
|
||||
umount $bootp
|
||||
umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot ${basedir}/patches ${basedir}/*sunxi*
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha256sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha256sum of kali-linux-$1-cubieboard2.img"
|
||||
sha256sum kali-linux-$1-cubieboard2.img > ${basedir}/kali-linux-$1-cubieboard2.img.sha256sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-cubieboard2.img"
|
||||
pixz ${basedir}/kali-linux-$1-cubieboard2.img ${basedir}/kali-linux-$1-cubieboard2.img.xz
|
||||
rm ${basedir}/kali-linux-$1-cubieboard2.img
|
||||
echo "Generating sha256sum of kali-linux-$1-cubieboard2.img.xz"
|
||||
sha256sum kali-linux-$1-cubieboard2.img.xz > ${basedir}/kali-linux-$1-cubieboard2.img.xz.sha256sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
@@ -12,12 +12,19 @@ fi
|
||||
|
||||
basedir=`pwd`/cubietruck-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-cubietruck
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -42,7 +49,7 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
@@ -123,7 +130,6 @@ apt-get update
|
||||
apt-get -y install git-core binutils ca-certificates initramfs-tools u-boot-tools
|
||||
apt-get -y install locales console-common less nano git
|
||||
echo "root:toor" | chpasswd
|
||||
sed -i -e 's/KERNEL\!=\"eth\*|/KERNEL\!=\"/' /lib/udev/rules.d/75-persistent-net-generator.rules
|
||||
rm -f /etc/udev/rules.d/70-persistent-net.rules
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get --yes --allow-change-held-packages install $packages
|
||||
@@ -164,13 +170,13 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-cubietruck.img bs=1M count=7000
|
||||
parted kali-linux-$1-cubietruck.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-cubietruck.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted kali-linux-$1-cubietruck.img --script -- mkpart primary ext4 264192s 100%
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-cubietruck.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -262,10 +268,6 @@ make -j $(grep -c processor /proc/cpuinfo)
|
||||
|
||||
dd if=u-boot-sunxi-with-spl.bin of=$loopdevice bs=1024 seek=8
|
||||
|
||||
rm -rf ${basedir}/root/lib/firmware
|
||||
cd ${basedir}/root/lib
|
||||
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware
|
||||
rm -rf ${basedir}/root/lib/firmware/.git
|
||||
cd ${basedir}
|
||||
|
||||
cp ${basedir}/../misc/zram ${basedir}/root/etc/init.d/zram
|
||||
@@ -274,27 +276,21 @@ chmod 755 ${basedir}/root/etc/init.d/zram
|
||||
sed -i -e 's/^#PermitRootLogin.*/PermitRootLogin yes/' ${basedir}/root/etc/ssh/sshd_config
|
||||
|
||||
# Unmount partitions
|
||||
sync
|
||||
umount $bootp
|
||||
umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot ${basedir}/patches ${basedir}/*sunxi*
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha256sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha256sum of kali-linux-$1-cubietruck.img"
|
||||
sha256sum kali-linux-$1-cubietruck.img > ${basedir}/kali-linux-$1-cubietruck.img.sha256sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-cubietruck.img"
|
||||
pixz ${basedir}/kali-linux-$1-cubietruck.img ${basedir}/kali-linux-$1-cubietruck.img.xz
|
||||
rm ${basedir}/kali-linux-$1-cubietruck.img
|
||||
echo "Generating sha256sum of kali-linux-$1-cubietruck.img.xz"
|
||||
sha256sum kali-linux-$1-cubietruck.img.xz > ${basedir}/kali-linux-$1-cubietruck.img.xz.sha256sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
32
cubox-i.sh
32
cubox-i.sh
@@ -14,12 +14,19 @@ fi
|
||||
|
||||
basedir=`pwd`/cubox-i-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-cubox-i
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -44,7 +51,7 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
@@ -69,10 +76,13 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http:
|
||||
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
|
||||
|
||||
LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage
|
||||
|
||||
cat << EOF > kali-$architecture/etc/apt/sources.list
|
||||
deb http://$mirror/kali kali-rolling main contrib non-free
|
||||
EOF
|
||||
|
||||
echo "$hostname" > kali-$architecture/etc/hostname
|
||||
|
||||
cat << EOF > kali-$architecture/etc/hosts
|
||||
127.0.0.1 $hostname localhost
|
||||
::1 localhost ip6-localhost ip6-loopback
|
||||
@@ -181,13 +191,13 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/dev/
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
echo "Creating image file for Cubox-i"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-cubox-i.img bs=1 count=0 seek=7G
|
||||
parted kali-linux-$1-cubox-i.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-cubox-i.img --script -- mkpart primary ext4 2048 100%
|
||||
echo "Creating image file for $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1 count=0 seek=7G
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary ext4 2048 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-cubox-i.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -262,10 +272,6 @@ mmcargs=setenv bootargs root=/dev/mmcblk0p1 rootwait video=mxcfb0:dev=hdmi \
|
||||
consoleblank=0 console=ttymxc0,115200 net.ifnames=0 rw rootfstype=ext4
|
||||
EOF
|
||||
|
||||
rm -rf ${basedir}/root/lib/firmware
|
||||
cd ${basedir}/root/lib
|
||||
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware
|
||||
rm -rf ${basedir}/root/lib/firmware/.git
|
||||
cd ${basedir}
|
||||
|
||||
# For some reason the brcm firmware doesn't work properly in linux-firmware git
|
||||
@@ -306,9 +312,9 @@ losetup -d $loopdevice
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-cubox-i.img"
|
||||
pixz ${basedir}/kali-linux-$1-cubox-i.img ${basedir}/../kali-linux-$1-cubox-i.img.xz
|
||||
rm ${basedir}/kali-linux-$1-cubox-i.img
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
|
||||
51
cubox.sh
51
cubox.sh
@@ -14,10 +14,17 @@ fi
|
||||
|
||||
basedir=`pwd`/cubox-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-cubox
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
@@ -44,7 +51,7 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
@@ -123,7 +130,6 @@ apt-get update
|
||||
apt-get -y install git-core binutils ca-certificates initramfs-tools u-boot-tools
|
||||
apt-get -y install locales console-common less nano git
|
||||
echo "root:toor" | chpasswd
|
||||
sed -i -e 's/KERNEL\!=\"eth\*|/KERNEL\!=\"/' /lib/udev/rules.d/75-persistent-net-generator.rules
|
||||
rm -f /etc/udev/rules.d/70-persistent-net.rules
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get --yes --allow-change-held-packages install $packages
|
||||
@@ -163,13 +169,13 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/dev/
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
echo "Creating image file for Cubox"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-cubox.img bs=1M count=7000
|
||||
parted kali-linux-$1-cubox.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-cubox.img --script -- mkpart primary ext4 0 100%
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary ext4 0 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-cubox.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -264,10 +270,6 @@ EOF
|
||||
# Create u-boot boot script image
|
||||
mkimage -A arm -T script -C none -d ${basedir}/root/boot/boot.txt ${basedir}/root/boot/boot.scr
|
||||
|
||||
rm -rf ${basedir}/root/lib/firmware
|
||||
cd ${basedir}/root/lib
|
||||
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware
|
||||
rm -rf ${basedir}/root/lib/firmware/.git
|
||||
cd ${basedir}
|
||||
|
||||
cp ${basedir}/../misc/zram ${basedir}/root/etc/init.d/zram
|
||||
@@ -280,23 +282,16 @@ umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
losetup -d $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Removing temporary build files"
|
||||
rm -rf ${basedir}/kernel ${basedir}/root ${basedir}/kali-$architecture ${basedir}/patches
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha256sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha256sum for kali-linux-$1-cubox.img"
|
||||
sha256sum kali-linux-$1-cubox.img > ${basedir}/kali-linux-$1-cubox.img.sha256sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-cubox.img"
|
||||
pixz ${basedir}/kali-linux-$1-cubox.img ${basedir}/kali-linux-$1-cubox.img.xz
|
||||
rm ${basedir}/kali-linux-$1-cubox.img
|
||||
echo "Generating sha256sum for kali-linux-$1-cubox.img.xz"
|
||||
sha256sum kali-linux-$1-cubox.img.xz > ${basedir}/kali-linux-$1-cubox.img.xz.sha256sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
56
efikamx.sh
56
efikamx.sh
@@ -14,12 +14,19 @@ echo "This script is now deprecated. The kernel is too old to run systemd"
|
||||
|
||||
basedir=`pwd`/efikamx-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-efikamx
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -44,7 +51,7 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate vboot-utils vboot-kernel-utils uboot-mkimage"
|
||||
base="kali-menu kali-defaults initramfs-tools usbutils"
|
||||
base="kali-menu kali-defaults initramfs-tools usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="xfce4 network-manager network-manager-gnome xserver-xorg-video-fbdev"
|
||||
tools="passing-the-hash winexe aircrack-ng hydra john sqlmap wireshark libnfc-bin mfoc"
|
||||
services="openssh-server apache2"
|
||||
@@ -171,14 +178,14 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for EfikaMX"
|
||||
dd if=/dev/zero of=${basedir}/kali-$1-efikamx.img bs=1M count=7000
|
||||
parted kali-$1-efikamx.img --script -- mklabel msdos
|
||||
parted kali-$1-efikamx.img --script -- mkpart primary ext2 4096s 266239s
|
||||
parted kali-$1-efikamx.img --script -- mkpart primary ext4 266240s 100%
|
||||
echo "Creating image file for $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary ext2 4096s 266239s
|
||||
parted $imagename.img --script -- mkpart primary ext4 266240s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-$1-efikamx.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
device="/dev/mapper/${device}"
|
||||
bootp=${device}p1
|
||||
@@ -258,36 +265,25 @@ EOF
|
||||
# Create u-boot boot script image
|
||||
mkimage -A arm -T script -C none -d ${basedir}/bootp/boot.script ${basedir}/bootp/boot.scr
|
||||
|
||||
rm -rf ${basedir}/root/lib/firmware
|
||||
cd ${basedir}/root/lib
|
||||
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware
|
||||
cd firmware
|
||||
rm -rf .git
|
||||
cd ${basedir}
|
||||
|
||||
# Unmount partitions
|
||||
umount $bootp
|
||||
umount $rootp
|
||||
sync
|
||||
umount -l $bootp
|
||||
umount -l $rootp
|
||||
kpartx -dv $loopdevice
|
||||
losetup -d $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Removing temporary build files"
|
||||
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/patches
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha1sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha1sum for kali-$1-efikamx.img"
|
||||
sha1sum kali-$1-efikamx.img > ${basedir}/kali-$1-efikamx.img.sha1sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-$1-efikamx.img"
|
||||
pixz ${basedir}/kali-$1-efikamx.img ${basedir}/kali-$1-efikamx.img.xz
|
||||
rm ${basedir}/kali-$1-efikamx.img
|
||||
echo "Generating sha1sum for kali-$1-efikamx.img.xz"
|
||||
sha1sum kali-$1-efikamx.img.xz > ${basedir}/kali-$1-efikamx.img.xz.sha1sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
51
kalitap.sh
51
kalitap.sh
@@ -12,12 +12,19 @@ fi
|
||||
|
||||
basedir=`pwd`/kalitap-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-kalitap
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -31,7 +38,7 @@ machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate vboot-utils vboot-kernel-utils u-boot-tools"
|
||||
base="kali-menu kali-defaults initramfs-tools usbutils"
|
||||
base="kali-menu kali-defaults initramfs-tools usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="xfce4 network-manager network-manager-gnome ntpdate xserver-xorg-video-fbdev"
|
||||
tools="passing-the-hash winexe aircrack-ng hydra john sqlmap wireshark libnfc-bin mfoc"
|
||||
services="openssh-server apache2"
|
||||
@@ -118,7 +125,6 @@ apt-get update
|
||||
apt-get -y install git-core binutils ca-certificates initramfs-tools u-boot-tools
|
||||
apt-get -y install locales console-common less nano git
|
||||
echo "root:toor" | chpasswd
|
||||
sed -i -e 's/KERNEL\!=\"eth\*|/KERNEL\!=\"/' /lib/udev/rules.d/75-persistent-net-generator.rules
|
||||
rm -f /etc/udev/rules.d/70-persistent-net.rules
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get --yes --allow-change-held-packages install $packages
|
||||
@@ -167,15 +173,15 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for kalitap"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-kalitap.img bs=1M count=7000
|
||||
parted kali-linux-$1-kalitap.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-kalitap.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted kali-linux-$1-kalitap.img --script -- mkpart primary ext4 264192s 100%
|
||||
parted kali-linux-$1-kalitap.img --script -- set 1 boot on
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
parted $imagename.img --script -- set 1 boot on
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-kalitap.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -239,10 +245,6 @@ cat << EOF > ${basedir}/root/etc/fstab
|
||||
/dev/mmcblk0p1 /boot auto noauto 0 0
|
||||
EOF
|
||||
|
||||
rm -rf ${basedir}/root/lib/firmware
|
||||
cd ${basedir}/root/lib
|
||||
git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware
|
||||
rm -rf ${basedir}/root/lib/firmware/.git
|
||||
cd ${basedir}
|
||||
|
||||
# Fix up the symlink for building external modules
|
||||
@@ -304,23 +306,16 @@ umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
losetup -d $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Removing temporary build files"
|
||||
rm -rf ${basedir}/bootp ${basedir}/root ${basedir}/u-boot ${basedir}/kali-$architecture ${basedir}/patches ${basedir}/kernel ${basedir}/utilities
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha256sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha256sum for kali-linux-$1-kalitap.img"
|
||||
sha256sum kali-linux-$1-kalitap.img > ${basedir}/kali-linux-$1-kalitap.img.sha256sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-kalitap.img"
|
||||
pixz ${basedir}/kali-linux-$1-kalitap.img
|
||||
echo "Generating sha256sum for kali-linux-$1-kalitap.img.xz"
|
||||
sha256sum kali-linux-$1-kalitap.img.xz > ${basedir}/kali-linux-$1-kalitap.img.xz.sha256sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
49
luna.sh
49
luna.sh
@@ -12,12 +12,19 @@ fi
|
||||
|
||||
basedir=`pwd`/luna-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=$imagename
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -154,13 +161,13 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for LUNA"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-luna.img bs=1M count=7000
|
||||
parted kali-linux-$1-luna.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-luna.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted kali-linux-$1-luna.img --script -- mkpart primary ext4 264192s 100%
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-luna.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -215,12 +222,6 @@ cat << EOF > ${basedir}/root/etc/fstab
|
||||
/dev/mmcblk0p1 /boot auto defaults 0 0
|
||||
EOF
|
||||
|
||||
rm -rf ${basedir}/root/lib/firmware
|
||||
cd ${basedir}/root/lib
|
||||
git clone https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware
|
||||
rm -rf ${basedir}/root/lib/firmware/.git
|
||||
cd ${basedir}
|
||||
|
||||
# Fix up the symlink for building external modules
|
||||
# kernver is used so we don't need to keep track of what the current compiled
|
||||
# version is
|
||||
@@ -259,22 +260,18 @@ umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
losetup -d $loopdevice
|
||||
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img
|
||||
echo "Generating sha256sum for $imagename.img.xz"
|
||||
sha256sum $imagename.img.xz > ${basedir}/../$imagename.img.xz.sha256sum
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Removing temporary build files"
|
||||
rm -rf ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/patches ${basedir}/kernel
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha256sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha256sum for kali-linux-$1-luna.img"
|
||||
sha256sum kali-linux-$1-luna.img > ${basedir}/kali-linux-$1-luna.img.sha256sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-luna.img"
|
||||
pixz ${basedir}/kali-linux-$1-luna.img
|
||||
echo "Generating sha256sum for kali-linux-$1-luna.img.xz"
|
||||
sha256sum kali-linux-$1-luna.img.xz > ${basedir}/kali-linux-$1-luna.img.xz.sha256sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
@@ -12,7 +12,10 @@ fi
|
||||
|
||||
basedir=`pwd`/mini-x-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
|
||||
@@ -15,7 +15,10 @@ fi
|
||||
|
||||
basedir=`pwd`/nanopi2-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
|
||||
@@ -15,7 +15,10 @@ fi
|
||||
|
||||
basedir=`pwd`/nanopi3-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
|
||||
@@ -15,7 +15,10 @@ fi
|
||||
|
||||
basedir=`pwd`/odroidc-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
|
||||
@@ -15,7 +15,10 @@ fi
|
||||
|
||||
basedir=`pwd`/odroidc2-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
|
||||
@@ -15,7 +15,10 @@ fi
|
||||
|
||||
basedir=`pwd`/odroid-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
|
||||
@@ -15,12 +15,19 @@ fi
|
||||
|
||||
basedir=`pwd`/odroid-w-devkit-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-owdk
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -34,7 +41,7 @@ machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
@@ -125,7 +132,6 @@ apt-get update
|
||||
apt-get -y install git-core binutils ca-certificates initramfs-tools u-boot-tools
|
||||
apt-get -y install locales console-common less nano git
|
||||
echo "root:toor" | chpasswd
|
||||
sed -i -e 's/KERNEL\!=\"eth\*|/KERNEL\!=\"/' /lib/udev/rules.d/75-persistent-net-generator.rules
|
||||
rm -f /etc/udev/rules.d/70-persistent-net.rules
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get --yes --allow-change-held-packages install $packages
|
||||
@@ -169,14 +175,14 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for ODROID-W Dev Kit"
|
||||
dd if=/dev/zero of=${basedir}/kali-$1-owdk.img bs=1M count=$size
|
||||
parted kali-$1-owdk.img --script -- mklabel msdos
|
||||
parted kali-$1-owdk.img --script -- mkpart primary fat32 0 64
|
||||
parted kali-$1-owdk.img --script -- mkpart primary ext4 64 -1
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=$size
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 0 64
|
||||
parted $imagename.img --script -- mkpart primary ext4 64 -1
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-$1-owdk.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -333,23 +339,16 @@ umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
losetup -d $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot ${basedir}/tools ${basedir}/patches
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha1sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha1sum for kali-$1-owdk.img"
|
||||
sha1sum kali-$1-owdk.img > ${basedir}/kali-$1-owdk.img.sha1sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-$1-owdk.img"
|
||||
pixz ${basedir}/kali-$1-owdk.img ${basedir}/kali-$1-owdk.img.xz
|
||||
rm ${basedir}/kali-$1-owdk.img
|
||||
echo "Generating sha1sum for kali-$1-owdk.img.xz"
|
||||
sha1sum kali-$1-owdk.img.xz > ${basedir}/kali-$1-owdk.img.xz.sha1sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
52
odroid-w.sh
52
odroid-w.sh
@@ -15,12 +15,19 @@ fi
|
||||
|
||||
basedir=`pwd`/odroid-w-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-odroidw
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -34,7 +41,7 @@ machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
@@ -125,7 +132,6 @@ apt-get update
|
||||
apt-get -y install git-core binutils ca-certificates initramfs-tools u-boot-tools
|
||||
apt-get -y install locales console-common less nano git
|
||||
echo "root:toor" | chpasswd
|
||||
sed -i -e 's/KERNEL\!=\"eth\*|/KERNEL\!=\"/' /lib/udev/rules.d/75-persistent-net-generator.rules
|
||||
rm -f /etc/udev/rules.d/70-persistent-net.rules
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get --yes --allow-change-held-packages install $packages
|
||||
@@ -168,14 +174,14 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for ODROID-W"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-odroidw.img bs=1M count=$size
|
||||
parted kali-linux-$1-odroidw.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-odroidw.img --script -- mkpart primary fat32 0 64
|
||||
parted kali-linux-$1-odroidw.img --script -- mkpart primary ext4 64 -1
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=$size
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 0 64
|
||||
parted $imagename.img --script -- mkpart primary ext4 64 -1
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-odroidw.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -246,11 +252,6 @@ cat << EOF > ${basedir}/bootp/cmdline.txt
|
||||
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 elevator=deadline root=/dev/mmcblk0p2 rootfstype=ext4 rootwait net.ifnames=0 rw
|
||||
EOF
|
||||
|
||||
rm -rf ${basedir}/root/lib/firmware
|
||||
cd ${basedir}/root/lib
|
||||
git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware
|
||||
rm -rf ${basedir}/root/lib/firmware/.git
|
||||
|
||||
# rpi-wiggle
|
||||
mkdir -p ${basedir}/root/scripts
|
||||
wget https://raw.github.com/dweeber/rpiwiggle/master/rpi-wiggle -O ${basedir}/root/scripts/rpi-wiggle.sh
|
||||
@@ -269,23 +270,16 @@ umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
losetup -d $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot ${basedir}/tools ${basedir}/patches
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha1sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha1sum for kali-linux-$1-odroidw.img"
|
||||
sha1sum kali-linux-$1-odroidw.img > ${basedir}/kali-linux-$1-odroidw.img.sha1sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-odroidw.img"
|
||||
pixz ${basedir}/kali-linux-$1-odroidw.img ${basedir}/kali-linux-$1-odroidw.img.xz
|
||||
rm ${basedir}/kali-linux-$1-odroidw.img
|
||||
echo "Generating sha1sum for kali-linux-$1-odroidw.img.xz"
|
||||
sha1sum kali-linux-$1-odroidw.img.xz > ${basedir}/kali-linux-$1-odroidw.img.xz.sha1sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
47
odroid-xu.sh
47
odroid-xu.sh
@@ -15,12 +15,19 @@ fi
|
||||
|
||||
basedir=`pwd`/odroidxu-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-odroidxu
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -49,7 +56,7 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
@@ -163,7 +170,6 @@ apt-get --yes --allow-change-held-packages autoremove
|
||||
systemctl enable regenerate_ssh_host_keys
|
||||
systemctl enable ssh
|
||||
|
||||
|
||||
rm /usr/sbin/policy-rc.d
|
||||
rm -f /usr/sbin/invoke-rc.d
|
||||
dpkg-divert --remove --rename /usr/sbin/invoke-rc.d
|
||||
@@ -194,14 +200,14 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for ODROID-XU"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-odroidxu.img bs=1M count=7000
|
||||
parted kali-linux-$1-odroidxu.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-odroidxu.img --script -- mkpart primary fat32 3072s 264191s
|
||||
parted kali-linux-$1-odroidxu.img --script -- mkpart primary ext4 264192s 100%
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 3072s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-odroidxu.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -370,23 +376,16 @@ kpartx -dv $loopdevice
|
||||
|
||||
losetup -d $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Removing temporary build files"
|
||||
rm -rf ${basedir}/patches ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha256sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha256sum for kali-linux-$1-odroidxu.img"
|
||||
sha256sum kali-linux-$1-odroidxu.img > ${basedir}/kali-linux-$1-odroidxu.img.sha256sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-odroidxu.img"
|
||||
pixz ${basedir}/kali-linux-$1-odroidxu.img ${basedir}/kali-linux-$1-odroidxu.img.xz
|
||||
rm ${basedir}/kali-linux-$1-odroidxu.img
|
||||
echo "Generating sha256sum for kali-linux-$1-odroidxu.img.xz"
|
||||
sha256sum kali-linux-$1-odroidxu.img.xz > ${basedir}/kali-linux-$1-odroidxu.img.xz.sha256sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
@@ -15,12 +15,19 @@ fi
|
||||
|
||||
basedir=`pwd`/odroidxu3-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-odroidxu3
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -45,7 +52,7 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
@@ -190,14 +197,14 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for ODROID-XU3"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-odroidxu3.img bs=1M count=7000
|
||||
parted kali-linux-$1-odroidxu3.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-odroidxu3.img --script -- mkpart primary fat32 3072s 264191s
|
||||
parted kali-linux-$1-odroidxu3.img --script -- mkpart primary ext4 264192s 100%
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 3072s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-odroidxu3.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -326,10 +333,6 @@ setenv bootargs "\${bootrootfs} \${videoconfig} smsc95xx.macaddr=\${macaddr}"
|
||||
boot
|
||||
EOF
|
||||
|
||||
rm -rf ${basedir}/root/lib/firmware
|
||||
cd ${basedir}/root/lib
|
||||
git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware
|
||||
rm -rf ${basedir}/root/lib/firmware/.git
|
||||
cd ${basedir}
|
||||
|
||||
cp ${basedir}/../misc/zram ${basedir}/root/etc/init.d/zram
|
||||
@@ -350,23 +353,16 @@ kpartx -dv $loopdevice
|
||||
losetup -d $loopdevice
|
||||
losetup -d $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Removing temporary build files"
|
||||
rm -rf ${basedir}/patches ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha256sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha256sum for kali-linux-$1-odroidxu3.img"
|
||||
sha256sum kali-linux-$1-odroidxu3.img > ${basedir}/kali-linux-$1-odroidxu3.img.sha256sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-odroidxu3.img"
|
||||
pixz ${basedir}/kali-linux-$1-odroidxu3.img ${basedir}/kali-linux-$1-odroidxu3.img.xz
|
||||
rm ${basedir}/kali-linux-$1-odroidxu3.img
|
||||
echo "Generating sha256sum for kali-linux-$1-odroidxu3.img.xz"
|
||||
sha256sum kali-linux-$1-odroidxu3.img.xz > ${basedir}/kali-linux-$1-odroidxu3.img.xz.sha256sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
27
riot.sh
27
riot.sh
@@ -15,12 +15,19 @@ fi
|
||||
|
||||
basedir=`pwd`/riot-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-riot
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
# Make sure that the cross compiler can be found in the path before we do
|
||||
@@ -218,14 +225,14 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for riot"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-riot.img bs=1M count=7000
|
||||
parted kali-linux-$1-riot.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-riot.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted kali-linux-$1-riot.img --script -- mkpart primary ext4 264192s 100%
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 2048s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-riot.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -345,13 +352,13 @@ losetup -d $loopdevice
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-riot.img"
|
||||
pixz ${basedir}/kali-linux-$1-riot.img ${basedir}/../kali-linux-$1-riot.img.xz
|
||||
rm ${basedir}/kali-linux-$1-riot.img
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Removing temporary build files"
|
||||
rm -rf ${basedir}
|
||||
rm -rf ${basedir}
|
||||
29
rpi-tft.sh
29
rpi-tft.sh
@@ -15,10 +15,17 @@ fi
|
||||
|
||||
basedir=`pwd`/rpi-tft-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-rpitft
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
@@ -208,14 +215,14 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for Raspberry PiTFT"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-rpitft.img bs=1M count=$size
|
||||
parted kali-linux-$1-rpitft.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-rpitft.img --script -- mkpart primary fat32 0 64
|
||||
parted kali-linux-$1-rpitft.img --script -- mkpart primary ext4 64 -1
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=$size
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 0 64
|
||||
parted $imagename.img --script -- mkpart primary ext4 64 -1
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-rpitft.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -363,13 +370,13 @@ losetup -d $loopdevice
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-rpitft.img"
|
||||
pixz ${basedir}/kali-linux-$1-rpitft.img ${basedir}/../kali-linux-$1-rpitft.img.xz
|
||||
rm ${basedir}/kali-linux-$1-rpitft.img
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}
|
||||
rm -rf ${basedir}
|
||||
32
rpi.sh
32
rpi.sh
@@ -14,11 +14,18 @@ if [[ $# -eq 0 ]] ; then
|
||||
fi
|
||||
|
||||
basedir=`pwd`/rpi-$1
|
||||
workfile=$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-rpi
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
@@ -216,14 +223,14 @@ fi
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for Raspberry Pi"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$workfile-rpi.img bs=1M count=$size
|
||||
parted kali-linux-$workfile-rpi.img --script -- mklabel msdos
|
||||
parted kali-linux-$workfile-rpi.img --script -- mkpart primary fat32 0 64
|
||||
parted kali-linux-$workfile-rpi.img --script -- mkpart primary ext4 64 -1
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=$size
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 0 64
|
||||
parted $imagename.img --script -- mkpart primary ext4 64 -1
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$workfile-rpi.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -336,14 +343,13 @@ losetup -d $loopdevice
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$workfile-rpi.img"
|
||||
pixz ${basedir}/kali-linux-$workfile-rpi.img ${basedir}/kali-linux-$workfile-rpi.img.xz
|
||||
mv ${basedir}/kali-linux-$workfile-rpi.img.xz ${basedir}/../
|
||||
rm ${basedir}/kali-linux-$workfile-rpi.img
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}
|
||||
rm -rf ${basedir}
|
||||
@@ -19,8 +19,8 @@ TOPDIR=`pwd`
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image name variable - MUST include .img at the end.
|
||||
imagename=kali-linux-$1-rpi0w-nexmon-p4wnp1.img
|
||||
# Custom image name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-rpi0w-nexmon-p4wnp1
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
@@ -381,14 +381,14 @@ chmod 755 ${basedir}/kali-$architecture/etc/init.d/zram
|
||||
sed -i -e 's/^#PermitRootLogin.*/PermitRootLogin yes/' ${basedir}/root/etc/ssh/sshd_config
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for Raspberry Pi"
|
||||
dd if=/dev/zero of=${basedir}/$imagename bs=1M count=$size
|
||||
parted $imagename --script -- mklabel msdos
|
||||
parted $imagename --script -- mkpart primary fat32 0 64
|
||||
parted $imagename --script -- mkpart primary ext4 64 -1
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=$size
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 0 64
|
||||
parted $imagename.img --script -- mkpart primary ext4 64 -1
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -418,9 +418,9 @@ losetup -d $loopdevice
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename"
|
||||
pixz ${basedir}/$imagename ${basedir}/../$imagename.xz
|
||||
rm ${basedir}/$imagename
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
|
||||
@@ -19,8 +19,8 @@ TOPDIR=`pwd`
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST include .img at the end.
|
||||
imagename=kali-linux-$1-rpi0w-nexmon.img
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-rpi0w-nexmon
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
@@ -337,14 +337,14 @@ chmod 755 ${basedir}/kali-$architecture/etc/init.d/zram
|
||||
sed -i -e 's/^#PermitRootLogin.*/PermitRootLogin yes/' ${basedir}/kali-$architecture/etc/ssh/sshd_config
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for Raspberry Pi"
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename bs=1M count=$size
|
||||
parted $imagename --script -- mklabel msdos
|
||||
parted $imagename --script -- mkpart primary fat32 0 64
|
||||
parted $imagename --script -- mkpart primary ext4 64 -1
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 0 64
|
||||
parted $imagename.img --script -- mkpart primary ext4 64 -1
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -374,9 +374,9 @@ losetup -d $loopdevice
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename"
|
||||
pixz ${basedir}/$imagename ${basedir}/../$imagename.xz
|
||||
rm ${basedir}/$imagename
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
|
||||
2
rpi2.sh
2
rpi2.sh
@@ -15,7 +15,9 @@ fi
|
||||
|
||||
basedir=`pwd`/rpi2-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-rpi2
|
||||
|
||||
if [ $2 ]; then
|
||||
|
||||
@@ -12,12 +12,18 @@ if [[ $# -eq 0 ]] ; then
|
||||
fi
|
||||
|
||||
basedir=`pwd`/rpi3-nexmon-$1
|
||||
workfile=$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-rpi3-nexmon
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
@@ -435,14 +441,14 @@ cp ${basedir}/../misc/zram ${basedir}/kali-$architecture/etc/init.d/zram
|
||||
chmod 755 ${basedir}/kali-$architecture/etc/init.d/zram
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for Raspberry Pi3 Nexmon"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$workfile-rpi3-nexmon.img bs=1M count=$size
|
||||
parted kali-linux-$workfile-rpi3-nexmon.img --script -- mklabel msdos
|
||||
parted kali-linux-$workfile-rpi3-nexmon.img --script -- mkpart primary fat32 0 64
|
||||
parted kali-linux-$workfile-rpi3-nexmon.img --script -- mkpart primary ext4 64 -1
|
||||
echo "Creating image file $imagename.img"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=$size
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary fat32 0 64
|
||||
parted $imagename.img --script -- mkpart primary ext4 64 -1
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$workfile-rpi3-nexmon.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -477,13 +483,13 @@ losetup -d $loopdevice
|
||||
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$workfile-rpi3-nexmon.img"
|
||||
pixz ${basedir}/kali-linux-$workfile-rpi3-nexmon.img ${basedir}/kali-linux-$workfile-rpi3-nexmon.img.xz
|
||||
mv ${basedir}/kali-linux-$workfile-rpi3-nexmon.img.xz ${basedir}/../
|
||||
rm ${basedir}/kali-linux-$workfile-rpi3-nexmon.img
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Cleaning up the temporary build files..."
|
||||
rm -rf ${basedir}
|
||||
rm -rf ${basedir}
|
||||
30
trimslice.sh
30
trimslice.sh
@@ -15,10 +15,17 @@ fi
|
||||
|
||||
basedir=`pwd`/trimslice-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-trimslice
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
@@ -188,6 +195,7 @@ fi
|
||||
apt-get --yes --allow-change-held-packages dist-upgrade
|
||||
apt-get --yes --allow-change-held-packages autoremove
|
||||
|
||||
# Install the kernel here. This is due to needing to fake being an arm device for flash-kernel to work properly.
|
||||
cd /root && gcc -Wall -shared -o libfakeuname.so fakeuname.c
|
||||
LD_PRELOAD=/root/libfakeuname.so apt-get --yes --allow-change-held-packages install linux-image-armmp
|
||||
cd /
|
||||
@@ -229,14 +237,14 @@ LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup
|
||||
#umount kali-$architecture/proc
|
||||
|
||||
# Create the disk and partition it
|
||||
echo "Creating image file for Trimslice"
|
||||
dd if=/dev/zero of=${basedir}/kali-linux-$1-trimslice.img bs=1M count=7000
|
||||
parted kali-linux-$1-trimslice.img --script -- mklabel msdos
|
||||
parted kali-linux-$1-trimslice.img --script -- mkpart primary ext2 2048s 264191s
|
||||
parted kali-linux-$1-trimslice.img --script -- mkpart primary ext4 264192s 100%
|
||||
echo "Creating image file $imagename"
|
||||
dd if=/dev/zero of=${basedir}/$imagename.img bs=1M count=7000
|
||||
parted $imagename.img --script -- mklabel msdos
|
||||
parted $imagename.img --script -- mkpart primary ext2 2048s 264191s
|
||||
parted $imagename.img --script -- mkpart primary ext4 264192s 100%
|
||||
|
||||
# Set the partition variables
|
||||
loopdevice=`losetup -f --show ${basedir}/kali-linux-$1-trimslice.img`
|
||||
loopdevice=`losetup -f --show ${basedir}/$imagename.img`
|
||||
device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1`
|
||||
sleep 5
|
||||
device="/dev/mapper/${device}"
|
||||
@@ -401,12 +409,12 @@ losetup -d $loopdevice
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-trimslice.img"
|
||||
pixz ${basedir}/kali-linux-$1-trimslice.img ${basedir}/../kali-linux-$1-trimslice.img.xz
|
||||
rm ${basedir}/kali-linux-$1-trimslice.img
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
rm -rf ${basedir}
|
||||
rm -rf ${basedir}
|
||||
@@ -13,6 +13,7 @@ fi
|
||||
basedir=`pwd`/usbarmory-$1
|
||||
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-usbarmory
|
||||
|
||||
if [ $2 ]; then
|
||||
@@ -47,7 +48,7 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="dosfstools e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="dosfstools e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
#desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 haveged openssh-server"
|
||||
@@ -132,7 +133,6 @@ apt-get update
|
||||
apt-get -y install git-core binutils ca-certificates initramfs-tools u-boot-tools
|
||||
apt-get -y install locales console-common less nano git
|
||||
echo "root:toor" | chpasswd
|
||||
sed -i -e 's/KERNEL\!=\"eth\*|/KERNEL\!=\"/' /lib/udev/rules.d/75-persistent-net-generator.rules
|
||||
rm -f /etc/udev/rules.d/70-persistent-net.rules
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get --yes --allow-change-held-packages install $packages
|
||||
|
||||
38
utilite.sh
38
utilite.sh
@@ -15,12 +15,19 @@ fi
|
||||
|
||||
basedir=`pwd`/utilite-$1
|
||||
|
||||
# Custom hostname variable
|
||||
hostname=kali
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=kali-linux-$1-utilite
|
||||
|
||||
if [ $2 ]; then
|
||||
hostname=$2
|
||||
fi
|
||||
|
||||
if [ $3 ]; then
|
||||
imagename=$3
|
||||
fi
|
||||
|
||||
# Generate a random machine name to be used.
|
||||
machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
|
||||
|
||||
@@ -45,7 +52,7 @@ unset CROSS_COMPILE
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils firmware-linux firmware-atheros firmware-libertas firmware-realtek"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
@@ -275,10 +282,6 @@ EOF
|
||||
# And generate the boot.scr
|
||||
mkimage -A arm -T script -C none -d ${basedir}/bootp/boot.txt ${basedir}/bootp/boot.scr
|
||||
|
||||
rm -rf ${basedir}/root/lib/firmware
|
||||
cd ${basedir}/root/lib
|
||||
git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git firmware
|
||||
rm -rf ${basedir}/root/lib/firmware/.git
|
||||
cd ${basedir}
|
||||
|
||||
cp ${basedir}/../misc/zram ${basedir}/root/etc/init.d/zram
|
||||
@@ -292,23 +295,16 @@ umount $rootp
|
||||
kpartx -dv $loopdevice
|
||||
losetup -d $loopdevice
|
||||
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing $imagename.img"
|
||||
pixz ${basedir}/$imagename.img ${basedir}/../$imagename.img.xz
|
||||
rm ${basedir}/$imagename.img
|
||||
fi
|
||||
|
||||
# Clean up all the temporary build stuff and remove the directories.
|
||||
# Comment this out to keep things around if you want to see what may have gone
|
||||
# wrong.
|
||||
echo "Removing temporary build files"
|
||||
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot ${basedir}/patches
|
||||
|
||||
# If you're building an image for yourself, comment all of this out, as you
|
||||
# don't need the sha256sum or to compress the image, since you will be testing it
|
||||
# soon.
|
||||
echo "Generating sha256sum for kali-linux-$1-utilite.img"
|
||||
sha256sum kali-linux-$1-utilite.img > ${basedir}/kali-linux-$1-utilite.img.sha256sum
|
||||
# Don't pixz on 32bit, there isn't enough memory to compress the images.
|
||||
MACHINE_TYPE=`uname -m`
|
||||
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
|
||||
echo "Compressing kali-linux-$1-utilite.img"
|
||||
pixz ${basedir}/kali-linux-$1-utilite.img ${basedir}/kali-linux-$1-utilite.img.xz
|
||||
rm ${basedir}/kali-linux-$1-utilite.img
|
||||
echo "Generating sha256sum for kali-linux-$1-utilite.img.xz"
|
||||
sha256sum kali-linux-$1-utilite.img.xz > ${basedir}/kali-linux-$1-utilite.img.xz.sha256sum
|
||||
fi
|
||||
rm -rf ${basedir}
|
||||
Reference in New Issue
Block a user