Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## --------------------------------------------------------------------------------------------------------------- ##
- ## [+] Xe1phix-[How-To-Create-A-[Persistent]-[LUKS-Encrypted]-USB-Device-With-[Parrot-Linux]-Cheatsheet.txt
- ## --------------------------------------------------------------------------------------------------------------- ##
- ##
- ## ---------------------------------------------------------------------------- ##
- ## [?] Xe1phix GitLab: https://gitlab.com/users/xe1phix/projects
- ## [?] Xe1phix Pastebin: https://pastebin.com/u/xe1phix
- ## [?] Xe1phix YouTube: https://youtube.com/@xe1phix/videos
- ## ---------------------------------------------------------------------------- ##
- ##-======================================================================-##
- ## [+] GParted - Associate The Empty Space With The sda3 Partition:
- ##-======================================================================-##
- gparted & ## format sdc3 to ext4
- ##-===================================-##
- ## [+] Format The sdc3 Partition:
- ##-===================================-##
- mkfs.ext4 /dev/sdc3
- ##-==================================================================-##
- ## [+] Encrypt The Newly Created Partition With LUKS Encryption:
- ##-==================================================================-##
- cryptsetup --verbose --verify-passphrase luksFormat /dev/sdc3
- ##-=================================================-##
- ## [+] Initialize The LUKS Encrypted Partition:
- ##-=================================================-##
- cryptsetup luksOpen /dev/sdc3 parrot_usb
- ##-==============================================================-##
- ## [+] Create The Ext4 Filesystem, And Label It parrot_usb:
- ##-==============================================================-##
- mkfs.ext4 -L persistence /dev/mapper/parrot_usb
- e2label /dev/mapper/parrot_usb persistence
- ##-=======================================================================-##
- ## [+] Create A Mount Point, Mount Our New Encrypted Partition There
- ## [+] Set Up The Persistence.conf File, And Unmount The Partition:
- ##-=======================================================================-##
- mkdir -p /mnt/parrot_usb
- mount /dev/mapper/parrot_usb /mnt/parrot_usb
- echo "/ union" > /mnt/parrot_usb/persistence.conf
- ##-===========================================-##
- ## [+] Status of The Mapping (parrot_usb):
- ##-===========================================-##
- cryptsetup status /dev/mapper/parrot_usb
- ##-=======================================================-##
- ## [+] Dump The Header Information of A LUKS Device:
- ##-=======================================================-##
- cryptsetup luksDump /dev/sdc3
- ##-======================================================================-##
- ## [+] Show All The Current Logical Volumes, and Their Device Names: "
- ##-======================================================================-##
- lvs -o devices
- ## --------------------------------------------------------------- ##
- ## [?] The Encrypted Logical Volumes Are Mounted At Boot Time
- ## [?] Using The Information From The /etc/crypttab File.
- ## --------------------------------------------------------------- ##
- cat /etc/crypttab
- ##-=======================================-##
- ## [+] Print the UUID of a LUKS device.
- ##-=======================================-##
- cryptsetup luksUUID /dev/sdc3
- ##-======================================-##
- ## [+] Add a Nuke Slot to /dev/sdc3:
- ##-======================================-##
- cryptsetup luksAddNuke /dev/sdc3
- ##-===============================================-##
- ## [+] Check if the Nuke Slot has been added:
- ##-===============================================-##
- cryptsetup luksDump /dev/sdc3
- ##-=====================================-##
- ## [+] Check if its a LUKS Device:
- ##-=====================================-##
- cryptsetup isLuks /dev/sdc3
- ##-=====================================================================-##
- ## [+] Store a binary backup of the LUKS Header and keyslot Area:
- ##-=====================================================================-##
- cryptsetup luksHeaderBackup --header-backup-file luksheader.back /dev/sdc3
- ##-=================================================-##
- ## [+] Print LUKS Header File Type & Attributes:
- ##-=================================================-##
- file luksheader.back
- ##-====================================================-##
- ## [+] Encrypt The LUKS Header Backup With OpenSSL:
- ##-====================================================-##
- openssl enc -aes-256-cbc -salt -in luksheader.back -out luksheader.back.enc ## openssl enc -aes-256-cbc -e -salt -in $key -out $1
- ##-==========================================-##
- ## [+] List Both The Header Backup Files:
- ##-==========================================-##
- ls -lh luksheader.back*
- ##-===================================================================-##
- ## [+] Cross Examine The Unencrypted Header Vs The Encrypted One:
- ##-===================================================================-##
- file luksheader.back*
- ##-===================================================-##
- ## [+] Decrypt The OpenSSL Encrypted LUKS Header:
- ##-===================================================-##
- openssl enc -d -aes-256-cbc -in luksheader.back.enc -out luksheader.back
- ##-======================================================================-##
- ## [+] Copy This Script To The Persistent Partition For Future Use:
- ##-======================================================================-##
- cp -v $File /mnt/parrot_usb/
- ##-=================================================================-##
- ## [+] Close The Encrypted Channel To Our Persistent Partition.
- ## [+] And Unmount The Partition.
- ##-=================================================================-##
- umount /dev/mapper/parrot_usb
- cryptsetup luksClose /dev/mapper/parrot_usb
- ##-====================================================-##
- ## [+] Restore a binary backup of The LUKS Header
- ## And Keyslot Area From The Specified File:
- ##-====================================================-##
- cryptsetup luksHeaderRestore /dev/sdc3 --header-backup-file luksheader.back
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement