How to create encrypted persistence for Kali Linux (2020)

Poisonjuoice

Professional
Messages
220
Reaction score
107
Points
43
Telegram
@poisonjuice0875
As we have seen here, installing Kali linux is very simple, especially if you do it via usb. In the last guide, the execution method chosen was the live version, therefore a portable version, asy to use, but which does not allow you to save the data of the session just ended. That's why we're going to see persistent mode today, especially its encrypted version.

Let's go more specifically, let's see the differences between the three types:

Live: ready-to-use version, easy to install, the only flaw is any file or change will be lost once the session is terminated.

Persistence: very useful variant if you want to keep all the work done previously, not encrypted.

Persistence (encrypted): similar to the previous version, but everything is encrypted.

Method

USB stick (16 GB minimum)
Network connection
Pc

1 We format our usb.
It is important to delete all the contents from the stick, preferably in FAT32 format.

2 Download the Kali Linux operating system image file.
You will need the operating system image,
you can go to the official download page.

3 Mount the operating system on the flash drive.
To carry out this step you will need the win32imager program.

4 Let's resize the partitions.
We "divide" the memory of our usb. Now right click on our device and click on Resize. 4 Gb will be fine, do as the photo below.

minitool-partition-step3.png



Now let's define the new partition.


At this point we need to create a new partition.
To do this right click on Unallocated.
Then Create, here we should set some options.
In partition label we insert the name of our partition.
In file system we select ext3.
Click on Ok.
Finally on Apply at the top left.
Boot Usb

We insert the flash drive into our PC and modify the boot of our computer.
To do this it is very simple, starting the PC you will have to click one or more keys at startup, each manufacturer has its own combination of keys (F2, F12, F10 and ESC are the most common) here is a list of the most famous manufacturers:
Acer: Del or F2
Asus: F2 Samsung: F2
Lenovo: F1 or F2
HP: F1, F2, F10, Esc or Canc
ou are now in the bios, here you will need to change the boot preferences (boot option) and set as primary to USB.


We encrypt Linux


Started linux, select USB Encrypted Persistence.
Ok, the system is working but not encrypted, to do this we open the terminal:
We type from the terminal:

fdisk -l

You will see different devices with various partitions, make sure you find your Usb.
Here is an example:

Code:
Device     Boot    Start       End   Sectors   Size Id Type
/dev/sdb1           2048   8390655   8388608     4G  c W95 FAT32 (LBA)
/dev/sdb2        8390656  30463999  22073344  10.5G 83 HPFS/NTFS/exFAT

Where sdb2 is the persistence created previously (the name of the wording can vary sdb3, sdb4, sdb5 etc)

It is important to specify the partition name, otherwise the encryption will not work. Assuming it is sdb2 we complete everything with this denomination.

Code:
cryptsetup --verbose --verify-passphrase luksFormat / dev / sdb2

After this command there will be a warning message, type YES.

Enter a password, please don't forget it.

When "Command successful" appears, execute the following command:

Code:
cryptsetup luksOpen / dev / sdb2 my_usb


Let's continue with creating the filesystem:

Code:
mkfs.ext3 -L persistence / dev / mapper / my_usb

Code:
e2label / dev / mapper / my_usb persistence

Complete everything with the following commands:

Code:
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

Finally close the session:

Code:
cryptsetup luksClose / dev / mapper / my_usb

Well we're done, restart everything and check that everything is fine.


Posted in News, Security & Hack, Guides & CuriositiesTagged anonymous, encrypted, kali, persistence, usb
 
Top