Previous Page

nihilist@mainpc - 2024-11-03

Using the Host-OS in live-mode to prepare for long-term Sensitive Use

OPSEC Recommendations:

  1. Hardware : (Personal Computer / Laptop)

  2. System Harddrive: not LUKS encrypted [1]

  3. Non-System Harddrive: 500Gb (will be used to contain our Veracrypt encrypted volumes)

  4. Host OS: Linux

  5. Hypervisor: QEMU/KVM

What is the usecase ?

The main usecase of using your Host OS in live mode, is that you want to use it for long term sensitive activities (meaning, you want to save sensitive files on a harddrive). As you're going to see, using the Host OS in live mode is effectively a hard requirement for deniability.

When we are talking sensitive use, we are talking about our need of Deniability. Which means that we need to use deniable encryption using Veracrypt's hidden volumes:

In theory it is impossible to prove the existence of the hidden volume by itself once it is closed, and if there is no proof of it's existence our deniability is maintained.

But the issue is that we have more variables that we also need to keep under control, on the Host OS side you have system logs, kernel logs, the various other non-standard log files that software is writing on the disk, and even the content of the RAM itself can be used to prove the existence of a hidden volume.

Now when you are using your computer for regular public, private and anonymous activities, normally you don't need to care about those things. But the Host OS is a potential goldmine of forensic evidence to be used against you, so for sensitive use specifically we need to take care of it.

Now you could start to manually erase all logs, all kernel logs, all non-standard system logs, manually overwrite the RAM contents, but this is going to be way too tedious and you're likely to miss something. So we have one simple solution: use the Host OS in live mode.

Thanks to live mode, we are able to load the entire Host OS in RAM directly, allowing us to avoid writing anything on the system disk (no system logs, no kernel logs, no non-standard logs, only ram contents to worry about)

And since everything is loaded inside the RAM, all we need is to reboot the computer to wipe all of the RAM contents, effectively erase all forensic evidence (and all potential forensic evidence) of the existence of the hidden volume in one simple action.

Setting up Live Mode



To do so, we need to install Kickstart's apt repository to have the grub-live package:


nothing@debian-tests:~$ su -
Password: 
root@debian-tests:~# wget https://www.kicksecure.com/keys/derivative.asc
--2024-11-04 07:22:22--  https://www.kicksecure.com/keys/derivative.asc
Resolving www.kicksecure.com (www.kicksecure.com)... 95.216.66.124, 64:ff9b::5fd8:427c
Connecting to www.kicksecure.com (www.kicksecure.com)|95.216.66.124|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 77312 (76K) [application/octet-stream]
Saving to: ‘derivative.asc’

derivative.asc            100%[=====================================>]  75.50K  --.-KB/s    in 0.1s    

2024-11-04 07:22:22 (794 KB/s) - ‘derivative.asc’ saved [77312/77312]

root@debian-tests:~# sudo cp ~/derivative.asc /usr/share/keyrings/derivative.asc
root@debian-tests:~# echo "deb [signed-by=/usr/share/keyrings/derivative.asc] https://deb.kicksecure.com bookworm main contrib non-free" | sudo tee /etc/apt/sources.list.d/derivative.list
deb [signed-by=/usr/share/keyrings/derivative.asc] https://deb.kicksecure.com bookworm main contrib non-free
root@debian-tests:~# sudo apt-get update -y
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease                     
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease             
Get:4 https://deb.kicksecure.com bookworm InRelease [62.0 kB]             
Get:5 https://deb.kicksecure.com bookworm/main amd64 Packages [37.6 kB]
Get:6 https://deb.kicksecure.com bookworm/contrib amd64 Packages [509 B]
Get:7 https://deb.kicksecure.com bookworm/non-free amd64 Packages [917 B]
Fetched 101 kB in 1s (73.7 kB/s)
Reading package lists... Done

Then we install the grub-live package, and the ram-wipe package (warning, the ram-wipe package may cause your system to fail to boot in case if you encrypted the system drive using LUKS, click here for more details on this). Therefore i recommend having the Host OS system drive not encrypted until dracut supports LUKS encryption, but it shouldn't matter though, as the actual VMs that we'll be running will be on a non-system drive, which will be manually kept in deniable encryption.


root@debian-tests:~#  apt install grub-live ram-wipe -y

Once that's done, let's take a quick look at the mounted drives using the lsblk command:


nothing@debian-tests:~$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0     11:0    1 1024M  0 rom  
vda    254:0    0   20G  0 disk 
├─vda1 254:1    0   19G  0 part /
├─vda2 254:2    0    1K  0 part 
└─vda5 254:5    0  975M  0 part [SWAP]
vdb    254:16   0    1G  0 disk 

As you can see here, we are not yet in live mode, so you can see the vda1 system drive mounted in the root directory, meaning that by default everything that is written on the disk by the Host OS is actually being written into the disk, rather than the RAM. So let's reboot to get into live mode:


root@debian-tests:~# reboot now 

and then when you reboot your host OS, you should see that there is a new boot option to choose from grub:

So we select it to boot into the OS, and then we're in live mode!

Testing Live Mode



now we're back into the host OS in live mode, let's first open a terminal and validate that we are in live mode by running lsblk:


nothing@debian-tests:~$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0     11:0    1 1024M  0 rom  
vda    254:0    0   20G  0 disk 
├─vda1 254:1    0   19G  0 part /usr/lib/live/mount/medium
│                               /usr/lib/live/mount/rootfs/filesystem
│                               /run/live/medium
│                               /run/live/rootfs/filesystem
├─vda2 254:2    0    1K  0 part 
└─vda5 254:5    0  975M  0 part [SWAP]
vdb    254:16   0    1G  0 disk 
	

Here you can see that we have the /dev/vda1 system drive mounted under the /run/live and /usr/lib/live directories, so basically now everything that is normally being written into the system disk (like system logs, kernel logs, non-standard logs, and every other file) is instead being written into the RAM, and not writing on the system disk at all.

To test this, we'll create a file in the system drive:


nothing@debian-tests:~$ vim test.txt
nothing@debian-tests:~$ cat test.txt 
THis has been written in the system disk vda1 from live mode !
	

and then we will create a file in the non-system drive /dev/vdb (which contains a veracrypt hidden volume):


nothing@debian-tests:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sr0           11:0    1  1024M  0 rom  
vda          254:0    0    20G  0 disk 
├─vda1       254:1    0    19G  0 part /usr/lib/live/mount/medium
│                                      /usr/lib/live/mount/rootfs/filesystem
│                                      /run/live/medium
│                                      /run/live/rootfs/filesystem
├─vda2       254:2    0     1K  0 part 
└─vda5       254:5    0   975M  0 part [SWAP]
vdb          254:16   0     1G  0 disk 
└─veracrypt1 253:0    0 499.9M  0 dm   /media/veracrypt1

nothing@debian-tests:~$ cd /media/veracrypt1/
nothing@debian-tests:/media/veracrypt1$ ls
lost+found
nothing@debian-tests:/media/veracrypt1$ vim test2.txt
nothing@debian-tests:/media/veracrypt1$ cat test2.txt 
this is a test file written from live mode, into a non-system drive!
	

Then we simply reboot the host OS into regular non-live mode to check if our first test file on the system drive is gone, and if the second test file on the non-system drive has been effectively saved:

And then we check that the first test file we created in the system drive is effectively not there anymore:


nothing@debian-tests:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sr0           11:0    1  1024M  0 rom  
vda          254:0    0    20G  0 disk 
├─vda1       254:1    0    19G  0 part /
├─vda2       254:2    0     1K  0 part 
└─vda5       254:5    0   975M  0 part [SWAP]
vdb          254:16   0     1G  0 disk 
└─veracrypt1 253:0    0 499.9M  0 dm   /media/veracrypt1

nothing@debian-tests:~$ cat test.txt
cat: test.txt: No such file or directory
	

And then we check if the file we created in the non-system veracrypt hidden volume is effectively still there:


nothing@debian-tests:~$ cat /media/veracrypt1/test2.txt 
this is a test file written from live mode, into a non-system drive!
	

And that's it ! we have now validated that running the Host OS in live mode could protect our veracrypt hidden volume's existence from being proven, protecting our deniability.

Nihilism

Until there is Nothing left.



Creative Commons Zero: No Rights Reserved

About nihilist

Donate XMR: 8AUYjhQeG3D5aodJDtqG499N5jXXM71gYKD8LgSsFB9BUV1o7muLv3DXHoydRTK4SZaaUBq4EAUqpZHLrX2VZLH71Jrd9k8


Contact: nihilist@contact.nowhere.moe (PGP)