Create the Persistent Kali USB Drive

(Printable view - Return to the main page)

Note: Data on the USB drive will be lost.

Here's a preview of the steps:

  1. Boot from the DVD.
  2. Determine which device is your flash drive.
  3. Write the ISO disk image to the flash drive.
  4. Add persistence to the drive.
    1. Use the GNU Partition Editor (GParted) to create, format, and label the ext3-formatted partition.
    2. Mount the partition and write the configuration file.
  5. Shut down.

Step 1: Boot from the DVD.

During startup you'll be prompted for a keymap. Accept the default.

Step 2: Determine which device is your flash drive.

Be certain the device you're writing is the correct one.

  <remove the USB drive if it's inserted>
  <insert the drive>
  dmesg | tail
  lsblk 
dmesg displays kernel messages that happened when you inserted the drive.
tail causes the end portion (the "tail" portion) of a file to be displayed.
lsblk lists block devices.

You can also try watch lsblk and then

  <insert the USB drive>
  wait
  <remove the drive> 
  wait
  repeat until you are certain which device is the USB drive

Use Ctrl-C to exit.

The examples show this device ==> /dev/sdX
Substitute your drive's device.

Step 3: Write the ISO

Write the ISO disk image to the flash drive.

  ddrescue kali-linux-2017.1-am64.iso /dev/sdX --force

or

  dd if=kali-linux-2017.1-am64.iso of=/dev/sdX bs=512M status=progress

(It will take a while to write the 2.7 GB image, so be patient.)

Now you have a bootable Kali flash drive (without persistence).

Step 4: Add Persistence

Next you can add persistence to the drive by creating a third primary partition. (Two were created by the previous step.) The new partition will be ext3-formatted and have these characteristics:

  • It will be labeled "persistence".
  • There will be a text file named "persistence.conf" on it that contains a single line of text.

Start X.

  startx

Use the terminal window to start the GNU Partition Editor.

  gparted

Create the ext3-formatted partition

  Select the device. (GParted -> Devices -> /dev/sdX)
  Select the unallocated space.
  Partition -> New

The new partition will have these attributes:

  Free space following (MB): 512
  Filesystem: ext3
  Label: persistence
  Add

Apply your changes.

  Edit -> Apply All Operations

Exit GNU Partition Editor.

  GParted -> Quit

Mount the partition. We're doing this so we can write the tiny persistence.conf configuration file.

  mkdir /mnt/usb
  mount /dev/sdX3 /mnt/usb

Add the text file.

  echo "/ union" > /mnt/usb/persistence.conf

Verify the configuration file has been written.

  cat /mnt/usb/persistence.conf

Your persistent Kali flash disk has been created.

Step 5: Shut Down

You can shut down from the GUI or use the command line.

  shutdown -h now

First Boot Task

Boot from your drive and select "Live USB Persistence". Your first boot into Kali should be disconnected from a network so you can change the default password before connecting.

Change the Password

Persistent Kali ordinarily reverts the password using a configuration file that runs at boot time. This behavior can be modified by commenting out a line of text.

First, set the root password.

  passwd root

Next, edit the configuration file that sets the password during boot. Comment out the line that sets the password by putting a # at the beginning of the line.

 leafpad /lib/live/config/0031-root-password

 usermod [...]

becomes

 #usermod [...]

Enjoy.

Page last modified on June 23, 2017
Powered by: PmWiki and Quick Wiki CMS