### Start VMware Setup Source: https://www.kali.org/docs/virtualization/install-vmware-host After the initial installation, run the 'vmware' command to continue the setup process. This may prompt for superuser privileges. ```bash kali@kali:~$ vmware kali@kali:~$ ``` -------------------------------- ### Install and Initialize LXD on Ubuntu Source: https://www.kali.org/docs/containers/kalilinux-lxc-images Initial setup for LXD using snap on an Ubuntu host. ```bash kali@kali:~$ sudo snap install lxd kali@kali:~$ lxd init ``` -------------------------------- ### Make VMware Installer Executable and Run Source: https://www.kali.org/docs/virtualization/install-vmware-host Make the downloaded VMware bundle executable using chmod and then run it with sudo to start the installation process. The installer will extract and configure VMware Workstation. ```bash kali@kali:~$ chmod +x ~/Downloads/vmware.bundle kali@kali:~ kali@kali:~$ sudo ~/Downloads/vmware.bundle Extracting VMware Installer...done. Installing VMware Workstation 17.0.2 Configuring... [######################################################################] 100% Installation was successful. kali@kali:~$ ``` -------------------------------- ### Complete UNIX user setup and verify installation Source: https://www.kali.org/docs/wsl/wsl-preparations Finalizing the user account creation and verifying the Linux environment with uname. ```bash Enter new UNIX username: kali New password: Retype new password: passwd: password updated successfully Installation successful! kali@DESKTOP-AJVAG8O:~$ uname -a Linux DESKTOP-AJVAG8O 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 GNU/Linux kali@DESKTOP-AJVAG8O:~$ ``` -------------------------------- ### Install Required Tools for Kali ARM Build Source: https://www.kali.org/docs/development/kali-linux-arm-chroot Installs debootstrap and qemu-user-static, essential for creating and emulating ARM root filesystems. This is a one-time setup task. ```bash kali@kali:~$ sudo apt install -y debootstrap qemu-user-static ``` -------------------------------- ### Analyze Installation Debug Logs Source: https://www.kali.org/docs/troubleshooting/troubleshooting-a-kali-linux-install Example of log output indicating a failure due to insufficient disk space during the live system installation process. ```text Aug 19 23:45:05 base-installer: error: The tar process copying the live system failed (only 152937 out of 286496 files have been copied, last file was ). Aug 19 23:45:05 main-menu[927]: (process:7553): tar: write error: No space left on device Aug 19 23:45:05 main-menu[927]: WARNING **: Configuring 'live-installer' failed with error code 1 Aug 19 23:45:05 main-menu[927]: WARNING **: Menu item 'live-installer' failed. Aug 19 23:50:23 main-menu[927]: INFO: Modifying debconf priority limit from 'high' to 'medium' Aug 19 23:50:23 debconf: Setting debconf/priority to medium Aug 19 23:56:49 main-menu[927]: INFO: Menu item 'save-logs' selected ``` -------------------------------- ### Install and Initialize LXD Source: https://www.kali.org/docs/containers/kalilinux-lxc-images Install the LXD snap package and perform the initial configuration. ```bash kali@kali:~$ sudo snap install lxd kali@kali:~$ lxd init ``` -------------------------------- ### Install clinfo for Troubleshooting Source: https://www.kali.org/docs/general-use/install-nvidia-drivers-on-kali-linux Installs the clinfo utility, which provides detailed information about OpenCL devices and platforms. This is useful for diagnosing setup issues. ```bash kali@kali:~$ sudo apt install -y clinfo kali@kali:~$ ``` -------------------------------- ### Install and Setup LXC Network Source: https://www.kali.org/docs/containers/kalilinux-lxc-images Install LXC dependencies and configure the default network bridge. ```bash kali@kali:~$ sudo apt install -y lxc libvirt0 libpam-cgfs bridge-utils libvirt-clients libvirt-daemon-system iptables ebtables dnsmasq-base kali@kali:~ kali@kali:~$ sudo cat < /etc/lxc/default.conf lxc.net.0.type = veth lxc.net.0.link = virbr0 lxc.net.0.flags = up lxc.apparmor.profile = generated lxc.apparmor.allow_nesting = 1 EOF kali@kali:~ kali@kali:~$ sudo virsh net-start default kali@kali:~$ sudo virsh net-autostart default ``` -------------------------------- ### Clone and Setup Kali Nethunter Installer Source: https://www.kali.org/docs/nethunter/installing-nethunter-on-the-samsung-galaxy-s10 Clone the kali-nethunter-installer repository and run the bootstrap script to set up the build environment. ```bash # Clone and setup kali-nethunter-installer $ git clone https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-installer.git $ cd kali-nethunter-installer $ ./bootstrap.sh [?] Would you like to grab the full history of kernels? (y/N): [?] Would you like to use SSH authentication (faster, but requires a GitLab account with SSH keys)? (y/N): N [i] Running command: git clone --depth 1 https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-kernels.git kernels Cloning into 'kernels'... ``` -------------------------------- ### Kali Linux Initial Setup Prompt Source: https://www.kali.org/docs/wsl/wsl-preparations This is the initial prompt displayed after launching Kali Linux for the first time, guiding the user through creating a UNIX username and password. ```bash Installing, this may take a few minutes... Please create a default UNIX user account. The username does not need to match your Windows username. For more information visit: https://aka.ms/wslusers Enter new UNIX username: kali New password: Retype new password: passwd: password updated successfully Installation successful! ┏━(Message from Kali developers) ┃ ┃ This is a minimal installation of Kali Linux, you likely ┃ want to install supplementary tools. Learn how: ┃ ⇒ https://www.kali.org/docs/troubleshooting/common-minimum-setup/ ┃ ┗━(Run: “touch ~/.hushlogin” to hide this message) ``` -------------------------------- ### Install and Configure TigerVNC Source: https://www.kali.org/docs/general-use/guacamole-kali-in-browser Install the TigerVNC server and prepare the xstartup configuration file. ```bash kali@kali:~$ sudo apt install -y tigervnc-standalone-server kali@kali:~ kali@kali:~$ mkdir -p ~/.vnc/ kali@kali:~ kali@kali:~$ vim ~/.vnc/xstartup kali@kali:~ kali@kali:~$ cat ~/.vnc/xstartup #!/bin/sh ############################# ``` -------------------------------- ### Install Prerequisites Source: https://www.kali.org/docs/development/custom-efikamx-image Installs necessary packages for image manipulation and compression. ```bash kali@kali:~$ sudo apt install -y kpartx xz-utils sharutils ``` -------------------------------- ### Install docker.io on Kali Linux Source: https://www.kali.org/docs/containers/installing-docker-on-kali Installs the standard Docker package and enables the service. ```bash kali@kali:~$ sudo apt update kali@kali:~ kali@kali:~$ sudo apt install -y docker.io kali@kali:~ kali@kali:~$ sudo systemctl enable docker --now kali@kali:~ kali@kali:~$ docker kali@kali:~ ``` -------------------------------- ### Include Unattended Installation Preseed File Source: https://www.kali.org/docs/development/dojo-mastering-live-build Provide a preseed file to automate the Kali Linux installation process, allowing for an unattended setup. Download a preseed example and save it to the debian-installer directory. ```bash kali@kali:~$ mkdir -pv kali-config/common/debian-installer/ kali@kali:~$ wget https://gitlab.com/kalilinux/recipes/kali-preseed-examples/-/raw/main/kali-linux-full-unattended.preseed -O kali-config/common/debian-installer/preseed.cfg ``` -------------------------------- ### Install and Enable cloud-init Source: https://www.kali.org/docs/cloud/digitalocean Install the cloud-init package, configure it for DigitalOcean data sources, and enable the service to manage system initialization on DigitalOcean. ```bash kali@kali:~$ sudo apt install -y cloud-init kali@kali:~$ sudo sh -c "echo 'datasource_list: [ ConfigDrive, DigitalOcean, NoCloud, None ]' > /etc/cloud/cloud.cfg.d/99_digitalocean.cfg" kali@kali:~$ sudo systemctl enable cloud-init --now ``` -------------------------------- ### Pre-seed Configuration Options Source: https://www.kali.org/docs/installation/network-pxe These are example pre-seed configuration options for a Kali Linux installation. They cover region, locale, keyboard, hostname, domain, package selection, partitioning, and user setup. ```shell d-i time/zone string US/Eastern d-i debian-installer/locale string en_US d-i debian-installer/language string en d-i debian-installer/country string US d-i debian-installer/locale string en_US.UTF-8 d-i keyboard-configuration/xkb-keymap select us d-i grub-installer/bootdev string /dev/sda d-i netcfg/get_hostname string kali d-i netcfg/get_domain string unnasigned-domain tasksel tasksel/first multiselect standard d-i mirror/country string enter information manually d-i mirror/suite string kali-rolling d-i mirror/codename string kali-rolling d-i mirror/http/hostname string http.kali.org d-i mirror/http/directory string /kali d-i mirror/http/proxy string d-i partman-auto/method string regular d-i partman-auto-lvm/guided_size string max d-i partman-auto/choose_recipe select atomic d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i partman-md/confirm boolean true d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i grub-installer/only_debian boolean true d-i grub-installer/with_other_os boolean true d-i finish-install/reboot_in_progress note d-i apt-setup/services-select multiselect d-i apt-setup/non-free boolean true d-i apt-setup/contrib boolean true d-i apt-setup/disable-cdrom-entries boolean true d-i apt-setup/enable-source-repositories boolean false d-i pkgsel/upgrade select full-upgrade d-i passwd/root-login boolean false d-i preseed/early_command string anna-install eatmydata-udeb d-i pkgsel/update-policy select none popularity-contest popularity-contest/participate boolean false encfs encfs/security-information boolean true encfs encfs/security-information seen true console-setup console-setup/charmap47 select UTF-8 samba-common samba-common/dhcp boolean false macchanger macchanger/automatically_run boolean false kismet-capture-common kismet-capture-common/install-users string kismet-capture-common kismet-capture-common/install-setuid boolean true wireshark-common wireshark-common/install-setuid boolean true sslh sslh/inetd_or_standalone select standalone atftpd atftpd/use_inetd boolean false ``` -------------------------------- ### Setup Loop Device and Mount Partitions Source: https://www.kali.org/docs/development/custom-beaglebone-black-image Sets up a loop device for the image file, maps its partitions, formats them with VFAT and EXT4 filesystems, and mounts them to `boot` and `root` directories. ```bash kali@kali:~$ loopdevice=`losetup -f --show kali-custom-bbb.img` kali@kali:~$ device=`kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1` kali@kali:~$ device="/dev/mapper/${device}" kali@kali:~$ bootp=${device}p1 kali@kali:~$ rootp=${device}p2 kali@kali:~ kali@kali:~$ mkfs.vfat -F 16 $bootp -n boot kali@kali:~$ mkfs.ext4 $rootp -L kaliroot kali@kali:~$ mkdir -p boot kali@kali:~$ mkdir -p root kali@kali:~$ mount $bootp boot kali@kali:~$ mount $rootp root ``` -------------------------------- ### Launch Tor Browser Source: https://www.kali.org/docs/tools/tor Execute this command as a user to download, install, and launch Tor Browser. The first launch handles setup and verification; subsequent launches will update and start Tor Browser. ```bash kali@kali:~$ torbrowser-launcher ``` -------------------------------- ### Prepare System and Download Dependencies Source: https://www.kali.org/docs/development/live-build-a-custom-kali-iso Update the system and download the necessary Kali archive keyring and live-build packages. ```bash $ sudo apt update $ sudo apt full-upgrade -y $ $ wget https://http.kali.org/pool/main/k/kali-archive-keyring/kali-archive-keyring_2022.1_all.deb $ wget https://http.kali.org/pool/main/l/live-build/live-build_20230502+kali3_all.deb ``` -------------------------------- ### Handle failed package installation Source: https://www.kali.org/docs/development/advanced-packaging-example Example of errors encountered when installing a package without satisfying dependencies. ```bash kali@kali:~/kali/packages/finalrecon$ sudo dpkg -i ~/kali/build-area/finalrecon_*.deb (Reading database ... 167589 files and directories currently installed.) Preparing to unpack .../finalrecon_0.0~git20201107.0d41eb6-0kali1_all.deb ... Unpacking finalrecon (0.0~git20201107.0d41eb6-0kali1) over (0.0~git20201107.0d41eb6-0kali1) ... dpkg: dependency problems prevent configuration of finalrecon: finalrecon depends on python3-ipwhois; however: Package python3-ipwhois is not installed. finalrecon depends on python3-dnslib; however: Package python3-dnslib is not installed. finalrecon depends on python3-aiohttp; however: Package python3-aiohttp is not installed. finalrecon depends on python3-aiodns; however: Package python3-aiodns is not installed. finalrecon depends on python3-psycopg2; however: Package python3-psycopg2 is not installed. finalrecon depends on python3-tldextract; however: Package python3-tldextract is not installed. dpkg: error processing package finalrecon (–install): dependency problems - leaving unconfigured Processing triggers for kali-menu (2020.3.2) … Errors were encountered while processing: finalrecon kali@kali:~/kali/packages/finalrecon$ ``` -------------------------------- ### Configure dnsmasq.conf Source: https://www.kali.org/docs/installation/network-pxe Configure DHCP, TFTP, and PXE booting settings in /etc/dnsmasq.conf. ```bash kali@kali:~$ cat < ``` -------------------------------- ### Initiate Build Process Source: https://www.kali.org/docs/arm/raspberry-pi-with-luks-full-disk-encryption-2 Execute the build script with the selected configuration profile. ```bash sudo ./cryptmypi.sh examples/kali-encrypted-basic ``` -------------------------------- ### Install VirtualBox Guest Additions Source: https://www.kali.org/docs/virtualization/install-virtualbox-guest-additions-legacy Copies the Guest Additions run file to the Downloads directory, makes it executable, and then runs the installation script. ```bash kali@kali:~$ cp /media/cdrom/VBoxLinuxAdditions.run ~/Downloads/ kali@kali:~$ chmod 0755 ~/Downloads/VBoxLinuxAdditions.run kali@kali:~$ cd ~/Downloads/ kali@kali:~/Downloads$ ./VBoxLinuxAdditions.run ``` -------------------------------- ### Generic NetHunter Installer Filenames Source: https://www.kali.org/docs/nethunter/installing-nethunter These are example filenames for Kali NetHunter installers. Ensure you download the correct version for your device's architecture. ```text kali-nethunter-20YY.X-generic-arm64-kalifs-full.zip ``` ```text kali-nethunter-20YY.X-generic-arm64-kalifs-minimal.zip ``` -------------------------------- ### Mount Image Partitions Source: https://www.kali.org/docs/development/custom-efikamx-image Sets up loop devices and partitions, then formats and mounts them to prepare for copying the rootfs. ```bash kali@kali:~$ loopdevice=$( losetup -f --show kali-custom-efikamx.img ) kali@kali:~$ device=$( kpartx -va $loopdevice| sed -E 's/.*(loop[0-9])p.*/ 1/g' | head -1 ) kali@kali:~$ device="/dev/mapper/${device}" kali@kali:~$ bootp=${device}p1 kali@kali:~$ rootp=${device}p2 kali@kali:~$ kali@kali:~$ mkfs.ext2 $bootp kali@kali:~$ mkfs.ext4 $rootp kali@kali:~$ mkdir -p boot kali@kali:~$ mkdir -p root kali@kali:~$ mount $bootp boot kali@kali:~$ mount $rootp root ``` -------------------------------- ### Start Kernel Build Process Source: https://www.kali.org/docs/nethunter/porting-nethunter-kernel-builder Initiate the kernel building process by running the build script. Follow the on-screen prompts to set up the environment and compile the kernel. ```bash ./build.sh ``` -------------------------------- ### Installing GRUB and Cryptsetup Tools Source: https://www.kali.org/docs/usb/usb-standalone-encrypted Install the required packages for bootloader management and encrypted partition handling. ```bash $ apt-get install grub-common grub-efi-amd64 os-prober $ apt-get install cryptsetup-initramfs ``` -------------------------------- ### Install Linux Kernel Source Code Source: https://www.kali.org/docs/development/recompiling-the-kali-linux-kernel Installs the source code for a specific version of the Linux kernel. This example uses version 4.9. The source is typically found in /usr/src. ```bash kali@kali:~$ sudo apt install -y linux-source-4.9 Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: bc libreadline7 Suggested packages: libncurses-dev | ncurses-dev libqt4-dev The following NEW packages will be installed: bc libreadline7 linux-source-4.9 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 95.4 MB of archives. After this operation, 95.8 MB of additional disk space will be used. [...] kali@kali:~$ ls /usr/src linux-config-4.9 linux-patch-4.9-rt.patch.xz linux-source-4.9.tar.xz ``` -------------------------------- ### Install QEMU and OVMF Packages Source: https://www.kali.org/docs/development/live-build-a-custom-kali-iso Installs the necessary QEMU packages for virtualization and OVMF for UEFI support. Run this before creating virtual disks or booting images. ```bash kali@kali:$ sudo apt update kali@kali:$ sudo apt install -y qemu qemu-system-x86 ovmf ``` -------------------------------- ### Install Kali ARM Build Prerequisites Source: https://www.kali.org/docs/development/kali-linux-arm-chroot Installs necessary tools and dependencies for building Kali Linux ARM images, including debootstrap and cross-compilation tools. This is a one-time setup. ```bash kali@kali:~$ cd ~/ kali@kali:~$ git clone https://gitlab.com/kalilinux/build-scripts/kali-arm.git kali@kali:~$ dpkg --add-architecture i386 kali@kali:~$ sudo apt update kali@kali:~$ sudo apt install -y debootstrap qemu-user-static device-tree-compiler lzma lzop u-boot-tools libncurses5:i386 pixz ``` -------------------------------- ### Create the Image File Source: https://www.kali.org/docs/development/custom-cubox-image Installs necessary utilities and creates a 7000MB image file for the CuBox rootfs. ```bash kali@kali:~$ sudo apt install -y kpartx xz-utils sharutils kali@kali:~$ mkdir -p ~/arm-stuff/images/ kali@kali:~$ cd ~/arm-stuff/images/ kali@kali:~$ dd if=/dev/zero of=kali-custom-cubox.img conv=fsync bs=4M count=7000 ``` -------------------------------- ### Install Xfce and RDP on Kali Linux Source: https://www.kali.org/docs/general-use/xfce-with-rdp This script updates the system, installs Xfce4 and xrdp, and configures xrdp to use port 3390. It's a comprehensive setup for RDP access. ```bash #!/bin/sh echo "[i] Updating and upgrading Kali (this will take a while)" apt-get update apt-get full-upgrade -y echo "[i] Installing Xfce4 & xrdp (this will take a while as well)" apt-get install -y kali-desktop-xfce xorg xrdp xorgxrdp echo "[i] Configuring xrdp to listen to port 3390 (but not starting the service)" sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini ``` -------------------------------- ### Configure git-buildpackage (gbp) Source: https://www.kali.org/docs/development/setting-up-packaging-system Sets up the .gbp.conf file with build configurations, including pristine-tar, export directory, and signing options. ```bash kali@kali:~$ cat < ~/.gbp.conf [DEFAULT] pristine-tar = True cleaner = /bin/true [buildpackage] export-dir = $HOME/kali/build-area/ ignore-branch = True ignore-new = True sign-tags = True [dch] ignore-branch = True multimaint-merge = True [import-orig] filter-pristine-tar = True sign-tags = True [pq] patch-numbers = False EOF kali@kali:~$ ``` -------------------------------- ### Example of Unmet Build Dependencies Source: https://www.kali.org/docs/development/rebuilding-a-package-from-source This output from dpkg-checkbuilddeps indicates which packages are required but not installed for building. ```text dpkg-checkbuilddeps: Unmet build dependencies: dh-autoreconf libnfc-dev libssl-dev ``` -------------------------------- ### Install Yubikey Tools Source: https://www.kali.org/docs/general-use/configuring-yubikeys-for-ssh-authentication Install the Yubikey Personalization Tool and Smart Card Daemon via apt. ```bash kali@kali:~$ sudo apt install -y yubikey-personalization scdaemon ``` -------------------------------- ### Verify installed application Source: https://www.kali.org/docs/general-use/python3-external-packages Run the help command of the newly installed application to verify it is accessible. ```bash ┌──(kali㉿kali)-[~] └─$ xsstrike -h usage: xsstrike [-h] [-u target] [--data paramdata] [-e encode] [--fuzzer] [--update] [--timeout timeout] [--proxy] [--crawl] [--json] [--path] [--seeds args_seeds] [-f args_file] [-l level] [--headers [add_headers]] [-t threadcount] [-d delay] [--skip] [--skip-dom] [--blind] [--console-log-level {debug,info,run,good,warning,error,critical,vuln}] [--file-log-level {debug,info,run,good,warning,error,critical,vuln}] [--log-file log_file] [-n payload_count] [...] ``` -------------------------------- ### Install apt-cacher-ng and observe default disallow policy Source: https://www.kali.org/docs/policy/kali-linux-network-service-policy When installing a tool that starts a network service, Kali Linux's update-rc.d script may disable its persistence across reboots by default. ```bash kali@kali:~$ sudo apt install -y apt-cacher-ng [...] Setting up apt-cacher-ng (0.7.11-1) ... update-rc.d: We have no instructions for the apt-cacher-ng init script. update-rc.d: It looks like a network service, we disable it. [...] kali@kali:~$ ``` -------------------------------- ### Initialize Package Directory and Git Repository Source: https://www.kali.org/docs/development/intro-to-packaging-example Navigate to the package directory and initialize a new Git repository. ```bash kali@kali:~$ cd ~/kali/packages/instaloader/ kali@kali:~/kali/packages/instaloader$ ``` ```bash kali@kali:~/kali/packages/instaloader$ git init Initialized empty Git repository in /home/kali/kali/packages/instaloader/.git/ kali@kali:~/kali/packages/instaloader$ ``` -------------------------------- ### Get Detailed Package Status Source: https://www.kali.org/docs/community/submitting-issues-kali-bug-tracker Use `dpkg --status` to retrieve detailed information about an installed package, including its version, maintainer, architecture, and installation status. This is essential for comprehensive bug reports. ```bash kali@kali:~$ dpkg --status chromium Package: chromium Status: install ok installed Priority: optional Section: web Installed-Size: 188290 Maintainer: Debian Chromium Team Architecture: amd64 Source: chromium-browser Version: 76.0.3809.100-1 [...] kali@kali:~$ ``` -------------------------------- ### Create the Image File Source: https://www.kali.org/docs/development/custom-kali-arm-ss808-image Install necessary utilities and create a blank image file for the root filesystem. ```bash kali@kali:~$ sudo apt install -y kpartx xz-utils sharutils kali@kali:~$ mkdir -p ~/arm-stuff/images/ kali@kali:~$ cd ~/arm-stuff/images/ kali@kali:~/arm-stuff/images$ dd if=/dev/zero of=kali-custom-ss808.img conv=fsync bs=4M count=7000 ``` -------------------------------- ### Identify broken package dependencies Source: https://www.kali.org/docs/troubleshooting/handling-common-apt-errors Example output when 'apt upgrade' encounters unmet dependencies that prevent installation. ```bash kali@kali:~$ sudo apt upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: libwacom9 : Depends: libwacom-common (= 2.2.0-1) but 1.8-2 is to be installed E: Broken packages ``` -------------------------------- ### Boot Kali Image with BIOS (QEMU) Source: https://www.kali.org/docs/development/live-build-a-custom-kali-iso Boots a Kali Live ISO image using QEMU with BIOS firmware. Ensure the ISO path is correct and the virtual disk is created. ```bash kali@kali:$ qemu-system-x86_64 \ -enable-kvm \ -drive if=virtio,aio=threads,cache=unsafe,format=qcow2,file=/tmp/kali-test.hdd.img \ -cdrom /home/kali/live-build-config/images/kali-linux-rolling-live-amd64.iso \ -boot once=d ``` -------------------------------- ### Configure Custom Syslinux Boot Entry Source: https://www.kali.org/docs/development/dojo-mastering-live-build Customize the syslinux boot entry for the ISO installer. This example sets up a boot label for automated installation and includes parameters for a custom preseed file, locale, keymap, hostname, and domain. ```bash kali@kali:~$ cat < 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 ``` -------------------------------- ### Identify missing PATH configuration Source: https://www.kali.org/docs/general-use/python3-external-packages Example output shown when a package is installed but the local binary directory is missing from the PATH. ```bash ┌──(kali㉿kali)-[~] └─$ pipx install xyz installed package xyz 1.0, installed using Python 3.12.6 These apps are now globally available - xyz Note: '/home/kali/.local/bin' is not on your PATH environment variable. These apps will not be globally accessible until your PATH is updated. Run `pipx ensurepath` to automatically add it, or manually modify your PATH in your shell's config file (e.g. ~/.bashrc). done! ``` -------------------------------- ### Start Win-KeX Normal Session with Sound Source: https://www.kali.org/docs/wsl/win-kex-esm Run Kali in WSL and start Win-KeX in ESM mode with sound support. On Windows on ARM, use `--ip` to work around a bug with localhost connections. ```bash kex --esm --sound ``` ```bash kex --esm --ip --sound ``` -------------------------------- ### Create Initrd in Chroot Source: https://www.kali.org/docs/development/custom-odroid-kernel-image Enters the root filesystem to install necessary tools and generate the initial RAM disk. ```bash kali@kali:~$ LANG=C chroot ~/arm-stuff/images/root/ kali@kali:~$ sudo apt install -y initramfs-tools uboot-mkimage kali@kali:~$ cd / kali@kali:~$ # Change the example "3.8.13" to your current odroid kernel revision kali@kali:~$ mkinitramfs -c lzma -o ./initramfs 3.8.13 kali@kali:~$ mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ./initramfs ./uInitrd kali@kali:~$ rm initramfs kali@kali:~$ exit ``` -------------------------------- ### Configure devscripts and create build directories Source: https://www.kali.org/docs/development/setting-up-packaging-system Sets up devscripts configuration, including DEBRELEASE_DEBS_DIR, DEBSIGN_KEYID, and creates necessary build directories. Replace the example GPG key ID with your own. ```bash kali@kali:~$ cat < ~/.devscripts DEBRELEASE_DEBS_DIR=$HOME/kali/build-area/ DEBRELEASE_UPLOADER=dput DEBCHANGE_AUTO_NMU=no DEBCHANGE_MULTIMAINT_MERGE=yes DEBCHANGE_PRESERVE=yes DEBCHANGE_RELEASE_HEURISTIC=changelog DEBSIGN_KEYID=ABC123DE4567890123G4567HIJK890LM12345N6 DEBUILD_LINTIAN_OPTS="--color always -I" USCAN_DESTDIR=$HOME/kali/upstream/ EOF kali@kali:~$ kali@kali:~$ mkdir -pv $HOME/kali/{build-area,upstream} ``` -------------------------------- ### Download and Execute Xfce4 Setup Script Source: https://www.kali.org/docs/general-use/xfce-with-rdp This sequence of commands downloads the xfce4.sh script, makes it executable, and then runs it. It's part of the manual setup process for RDP with Xfce. ```bash # If on Docker, run the following command first before continuing: root@182156129:/$ apt update && DEBIAN_FRONTEND=noninteractive apt install -y wget kali-linux-headless kali@kali:~$ wget https://gitlab.com/kalilinux/recipes/kali-scripts/-/raw/main/xfce4.sh kali@kali:~$ kali@kali:~$ chmod +x xfce4.sh kali@kali:~$ kali@kali:~$ sudo ./xfce4.sh kali@kali:~$ ``` -------------------------------- ### Example Kali Linux PXE pre-seed file Source: https://www.kali.org/docs/installation/network-pxe This is an example pre-seed file for automatically installing Kali Linux via PXE. Customize package selection, user information, region, and hard drive settings as needed. Comment out lines for interactive prompts. ```bash kali@kali:~$ cat <<'EOF' | sudo tee /opt/pxe/preseed.cfg # Package selection d-i pkgsel/include string kali-linux-default kali-desktop-xfce # User information d-i passwd/user-fullname string kali d-i passwd/username string kali d-i passwd/user-password password kali d-i passwd/user-password-again password kali EOF kali@kali:~$ ``` -------------------------------- ### Prepare Environment for VMware Tools Source: https://www.kali.org/docs/virtualization/install-vmware-guest-tools-legacy Install necessary build dependencies and clone the patching repository. ```bash kali@kali:~$ sudo apt update [...] kali@kali:~ kali@kali:~$ sudo apt install -y git gcc make linux-headers-$( uname -r ) [...] kali@kali:~ kali@kali:~$ sudo git clone https://github.com/rasa/vmware-tools-patches.git /opt/vmware-tools-patches/ [...] kali@kali:~ ``` -------------------------------- ### Launch Kali Linux Source: https://www.kali.org/docs/wsl/wsl-preparations Launches the Kali Linux distribution after installation. This command initiates the setup process, including creating a UNIX user account. ```bash C:\Users\Win>kali [...] ``` -------------------------------- ### Create GUI Profile and Launch Container Source: https://www.kali.org/docs/containers/kalilinux-lxc-images Download the GUI profile, apply it to LXD, and launch a Kali Linux container. ```bash kali@kali:~$ wget https://blog.simos.info/wp-content/uploads/2018/06/lxdguiprofile.txt kali@kali:~$ lxc profile create gui kali@kali:~$ cat lxdguiprofile.txt | lxc profile edit gui kali@kali:~$ lxc profile list kali@kali:~$ lxc launch --profile default --profile gui images:kali/current/amd64 gui-kali ``` -------------------------------- ### Manage LXC Containers Source: https://www.kali.org/docs/containers/kalilinux-lxc-images Provides common commands for managing LXC containers, including starting, stopping, listing, getting info, and removing containers. ```bash sudo lxc-start -n my-kali -d ``` ```bash sudo lxc-stop -n my-kali ``` ```bash sudo lxc-ls -f ``` ```bash sudo lxc-info -n my-kali ``` ```bash sudo lxc-destroy -n my-kali ``` -------------------------------- ### Bind Mount and Chroot into Target System Source: https://www.kali.org/docs/usb/usb-standalone-encrypted These commands bind mount necessary directories and then chroot into the target Kali Linux installation to complete system setup. ```bash for n in dev dev/pts proc sys sys/firmware/efi/efivars run etc/resolv.conf; do mount --bind /$n /target/$n; done $ chroot /target $ mount -a ``` -------------------------------- ### Third Stage Chroot Script Source: https://www.kali.org/docs/development/kali-linux-arm-chroot The main script executed within the chroot environment to perform final system configurations, package installations, and user setup. ```bash #!/bin/sh dpkg-divert --add --local --divert /usr/sbin/invoke-rc.d.chroot --rename /usr/sbin/invoke-rc.d cp /bin/true /usr/sbin/invoke-rc.d apt-get update apt-get install -y locales-all #locale-gen en_US.UTF-8 debconf-set-selections /debconf.set rm -f /debconf.set apt-get update apt-get install -y locales-all apt-get install -y git-core binutils ca-certificates initramfs-tools u-boot-tools apt-get install -y locales console-common less vim git echo "kali:kali" | 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 apt-get install -y --force-yes ${packages} rm -f /usr/sbin/invoke-rc.d dpkg-divert --remove --rename /usr/sbin/invoke-rc.d rm -f /third-stage ``` -------------------------------- ### Start Xfce Panel Source: https://www.kali.org/docs/containers/kalilinux-lxc-images Launch the Xfce panel as the non-root user. ```bash kali@kali:~$ lxc exec gui-kali -- sudo -u kali xfce4-panel ``` -------------------------------- ### Set Boot Arguments for NanoPC-T3 Source: https://www.kali.org/docs/arm/nanopc-t To change boot arguments or the kernel command line, install `libubootenv-tool`, create an `env.conf` file with desired arguments, and then use `fw_setenv` to write these to the sdcard. The default arguments are provided as an example. ```bash console=ttySAC0,115200n8 root=/dev/mmcblk0p2 rootfstype=ext3 rootwait rw consoleblank=0 net.ifnames=0 bootdelay 1 ``` ```bash fw_setenv /dev/mmcblk0 -s env.conf ``` -------------------------------- ### Start XFCE Desktop Environment Source: https://www.kali.org/docs/general-use/guacamole-kali-in-browser Use this command to start the XFCE desktop environment. Ensure it's uncommented in your startup script. ```bash startxfce4 & ``` -------------------------------- ### Install GNOME Desktop Environment Source: https://www.kali.org/docs/general-use/xfce-faq Installs the GNOME desktop environment on an existing Kali Linux installation. ```bash sudo apt update && sudo apt install -y kali-desktop-gnome ``` -------------------------------- ### Prepare Chroot Environment Source: https://www.kali.org/docs/arm/raspberry-pi-with-luks-full-disk-encryption-2 Mount the microSD card partitions and set up the chroot environment. This includes mounting necessary virtual filesystems and copying the QEMU static binary for ARM64 emulation. ```bash $ sudo mkdir -vp /mnt/chroot/ $ sudo mount /dev/sdX2 /mnt/chroot/ $ sudo mount /dev/sdX1 /mnt/chroot/boot/ $ sudo mount -t proc none /mnt/chroot/proc $ sudo mount -t sysfs none /mnt/chroot/sys $ sudo mount -o bind /dev /mnt/chroot/dev $ sudo mount -o bind /dev/pts /mnt/chroot/dev/pts $ sudo apt install -y qemu-user-static $ sudo cp /usr/bin/qemu-aarch64-static /mnt/chroot/usr/bin/ ``` -------------------------------- ### Install Hashcat Source: https://www.kali.org/docs/general-use/install-nvidia-drivers-on-kali-linux Installs the Hashcat utility using the apt package manager. Ensure your system is up-to-date before installation. ```bash kali@kali:~$ sudo apt install -y hashcat kali@kali:~$ ``` -------------------------------- ### Install Kali Linux Xfce Environment Source: https://www.kali.org/docs/general-use/xfce-faq Installs the Xfce desktop environment on an existing Kali Linux installation. ```bash sudo apt update && sudo apt install -y kali-desktop-xfce ``` -------------------------------- ### Install Intel SOF Audio Firmware Source: https://www.kali.org/docs/troubleshooting/no-sound For baremetal installations with recent Intel sound cards, install the necessary firmware. This command updates the package list and installs the `firmware-sof-signed` package. A reboot is required. ```bash kali@kali:~$ sudo apt update kali@kali:~$ kali@kali:~$ sudo apt install -y firmware-sof-signed kali@kali:~$ ```