Topics: Security

Kali Linux Bootable USB drive

This is the first article in a series of security awareness articles. The first few articles will focus initially on WiFi security.

For the purposes of hacking, people often tend to use the Kali distribution of Linux, which is generally regarded as the de facto standard package of tools used to facilitate penetration testing to secure data and voice networks. It was developed by Mati Aharoni and Devon Kearns of Offensive Security.


This article will focus on creating a bootable USB drive containing Kali Linux, allowing one to boot up a computer from USB with Kali Linux. The original documentation can be found at https://docs.kali.org/downloading/kali-linux-live-usb-install and https://docs.kali.org/downloading/kali-linux-live-usb-persistence.

For this article, you will need a Windows based computer and a USB drive of at least 8 GB.

Start of by downloading the 64 bit ISO image file from https://www.kali.org/downloads/. Select the very first 3 GB file, named "Kali Linux 64bit" for amd64 based systems, assuming you will be using a 64 bit computer. Then, insert a USB drive into the computer of at least 8 GB.

Download Win32 Disk Imager from https://sourceforge.net/projects/win32diskimager/. Note that this tool doesn't work on Windows if you have a RAM disk and/or Encrypted disk configured on your system. If you do, then unmount these first. Use the Win32 Disk Imager tool to write the Kali ISO image file to the USB drive. Writing the ISO file takes a few minutes.

As an alternative, you can also download the ISO image file on a Linux system, and use the dd command to write the ISO image file to the USB drive. For example, assuming the USB device on Linux is /dev/sdb, and the ISO image file is called kali-linux-2018.3a-amd64.iso, run:
# dd if=kali-linux-2018.3a-amd64.iso of=/dev/sdb bs=512k
At this point, you can boot up Kali Linux from the USB drive. It may be necessary to change the boot order in the BIOS of the computer to boot from the USB drive (instead of the internal hard drive) first. The default password for the root user of Kali Linux is "toor".

What has been created at this point is an operating system that you can use normally. You will notice however, that once you shut down and restart Kali Linux, that any changes you have made, will be gone. This is due to it not having any persistent storage, and thus losing all the changes mades once the operating system has been shut down or restarted.

There is a way to create a persistent Kali Linux USB setup:

Fist, boot Kali Linux from the USB drive you have prepared above. Run "lsblk" to identify which drive the USB drive is, for example /dev/sda. By looking at the output of the lsblk command, you can see that about 3.7 GB is in use for two different partitions. We'll be creating an additional partition for the persistent storage. Just to be safe, we'll create a new partition of 4 GB, starting at a location 4 GB through 8 GB on the USB drive:
# parted /dev/sda mkpart primary 4gb 8gb
This will create a new partition called /dev/sda3. You can see this by running lsblk again. Next, create a file system on the new partition:
# mkfs.ext3 -L persistence /dev/sda3
# e2label /dev/sda3 persistence
Now create a mount point, mount the new partition there, and then create the configuration file to enable persistence. Finally, unmount the partition:
# mkdir -p /mnt/my_usb
# mount /dev/sda3 /mnt/my_usb
# echo "/ union" > /mnt/my_usb/persistence.conf
# umount /dev/sda3
Next, reboot the system, and boot the Kali Linux Live persistence option:
# reboot
From now on it will be possible to write to the file systems, and changes will be maintained. The downside of creating a persistent USB version of Kali Linux is however, that the OS becomes slower, because it is now writing to the USB drive, which isn't that fast as writes to memory.

There's also a method for creating an encrypted version of the persistent Kali Live Linux USB drive, which is described in more detail at https://docs.kali.org/downloading/kali-linux-live-usb-persistence.



If you found this useful, here's more on the same topic(s) in our blog:


UNIX Health Check delivers software to scan Linux and AIX systems for potential issues. Run our software on your system, and receive a report in just a few minutes. UNIX Health Check is an automated check list. It will report on perfomance, capacity, stability and security issues. It will alert on configurations that can be improved per best practices, or items that should be improved per audit guidelines. A report will be generated in the format you wish, and the report includes the issues discovered and information on how to solve the issues as well.

Interested in learning more?