Virtualization
Alternate Unique system identifier across VM
Check Machine ID
Check current machine ID
cat /etc/machine-id
cat /var/lib/dbus/machine-idCheck if they're linked (they should be)
ls -la /var/lib/dbus/machine-idGenerate new machine ID
Do this for each VM/system
sudo rm /etc/machine-id
sudo rm /var/lib/dbus/machine-id
sudo systemd-machine-id-setup
sudo ln -s /etc/machine-id /var/lib/dbus/machine-idEnsure each
VMhas uniquemachine-idbefore cloningConsider regenerating after cloning
VMs
Create Clean VM Template
Before cloning VMs, ensure clean state:
sudo rm /etc/machine-id /var/lib/dbus/machine-id
sudo rm -rf ~/.mozilla/firefox/*/sessionstore*
sudo rm -rf ~/.cache/mozilla/firefox/*/
history -c && history -wfirejail
Install and configure Firejail for application isolation
sudo pacman -S firejailSet up firejail for common applications
sudo firecfg Run Firefox in isolated environment
firejail --private --dns=1.1.1.1 --netfilter firefoxQemu
Installation
sudo pacman -S qemu libvirt dnsmasq virt-manager bridge-utils ebtables
sudo systemctl enable --now libvirtdCheck/Backup the XML
sudo virsh net-dumpxml c2-labManual XML Virtual Network Configuration
Locked-down Version
<network>
<name>c2-lab</name>
<bridge name="virbr2" stp="off" delay="0"/> <!-- Disable STP (not needed) -->
<forward mode="none"/> <!-- NO NAT, NO ROUTING -->
<interface type="network">
<mac address="52:54:00:XX:XX:XX"/> <!-- Set a static MAC -->
<source network="c2-lab"/>
<model type="virtio"/>
</interface>
<ip address="192.168.100.1" netmask="255.255.255.0">
<ip family="ipv6" address="fe80::1" prefix="64"/>
<!-- No DHCP (assign IPs manually) -->
</ip>
</network>Disable ICMP
sudo iptables -I FORWARD -i virbr2 -p icmp -j DROPStart the Virtual-Network
sudo virsh net-define c2-lab.xml
sudo virsh net-start c2-labStart on boot
sudo virsh net-autostart c2-labCheck Network Info
sudo virsh net-info c2-labCheck for leaks
sudo iptables -L -v -n | grep virbr2Use containerization to avoid Browser fingerprinting and correlation risks
Check Browser Configuration
Check Firefox profiles
ls ~/.mozilla/firefox/
cat ~/.mozilla/firefox/profiles.iniCheck if containers addon is installed
firefox -PSecure Browser Configuration
Install Firefox Multi-Account Containers
This should be done manually through Firefox Add-ons
Create hardened Firefox profile
firefox -CreateProfile "hardened"Configure hardened settings (create user.js in profile directory)
PROFILE_DIR=$(find ~/.mozilla/firefox -name "*.hardened" -type d)
tee "$PROFILE_DIR/user.js" << 'EOF'
// Privacy settings
user_pref("privacy.resistFingerprinting", true);
user_pref("privacy.trackingprotection.enabled", true);
user_pref("privacy.trackingprotection.socialtracking.enabled", true);
user_pref("privacy.firstparty.isolate", true);
user_pref("network.cookie.cookieBehavior", 1);
user_pref("network.http.referer.XOriginPolicy", 2);
user_pref("network.http.referer.trimmingPolicy", 2);
// Disable WebRTC
user_pref("media.peerconnection.enabled", false);
user_pref("media.navigator.enabled", false);
// DNS over HTTPS
user_pref("network.trr.mode", 2);
user_pref("network.trr.uri", "https://cloudflare-dns.com/dns-query");
// Disable telemetry
user_pref("toolkit.telemetry.enabled", false);
user_pref("datareporting.policy.dataSubmissionEnabled", false);
EOFSystem time revealing timezone/location
Check System Time and Timezone
Check current timezone and time
timedatectl status
dateCheck NTP synchronization
timedatectl show-timesync --allConfigure Proper Time Synchronization
Use multiple NTP servers and add random delay
sudo tee /etc/systemd/timesyncd.conf << EOF
[Time]
NTP=pool.ntp.org time.nist.gov time.cloudflare.com
PollIntervalMinSec=32
PollIntervalMaxSec=2048
ConnectionRetrySec=30
EOFCreate service to add random time skew
sudo tee /etc/systemd/system/time-skew.service << 'EOF'
[Unit]
Description=Add random time skew
Before=systemd-timesyncd.service
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'sleep $((RANDOM % 30))'
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOFEnable the time skew service
sudo systemctl enable time-skew.service
sudo systemctl restart systemd-timesyncdLast updated