Skip to content

Instantly share code, notes, and snippets.

@chrisdiana
Last active March 15, 2019 15:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chrisdiana/e417dca5dc535da59139 to your computer and use it in GitHub Desktop.
Save chrisdiana/e417dca5dc535da59139 to your computer and use it in GitHub Desktop.
Kali with USB Persistence

Kali USB Persistence

  1. Partition USB to 3 sections (KaliLinux, Persistence, USBStorage)

  2. Run Mac Linux USB Loader for KaliLinux partition and install with iso

  3. In KaliLinux partition, set 'efi/boot/enterprise.cfg' to this:

entry Kali
family Debian
kernel /live/vmlinuz findiso=/efi/boot/boot.iso boot=live noconfig=sudo
username=root hostname=kali persistence
  1. Reboot into Kali and format the Persistence partition
  • open gparted
  • select /dev/sdb
  • select the persistence partition
  • partition > unmount
  • partition > format > ext3
  • edit > apply all
  1. Now time to encrypt the parition. Open terminal and then:
cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb3
cryptsetup luksOpen /dev/sdb3 my_usb
mkfs.ext3 -L persistence /dev/mapper/my_usb
e2label /dev/mapper/my_usb persistence
mkdir -p /mnt/my_usb
mount /dev/mapper/my_usb /mnt/my_usb
echo "/ union" > /mnt/my_usb/persistence.conf
umount /dev/mapper/my_usb
cryptsetup luksClose /dev/mapper/my_usb
  1. Reboot into OSX and edit the line in 'enterprise.cfg' file to this to enable encryption
username=root hostname=kali persistence persistence-encryption=luks
  1. Reboot into Kali and run apt-get update && apt-get upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment