Kali Linux持久加密USB制作
root@kali:~# dmesg(查看U盘名称sdX,或输入lsblk)
找到Gparted应用程序 卸载 删除 应用操作(这一步不是很详细,若看不懂,咨询QQ:812630419)
root@kali:~# dd if=镜像文件名.iso of=/dev/sdX bs=1M
再打开一个终端Terminal:
root@kali:~# watch -n 5 killall -USR1 dd(每五秒报告一下dd进度)
root@Kali:~# parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print devices
/dev/sda (21.5GB)
/dev/sdb (15.6GB)
(parted) select /dev/sdb
Using /dev/sdb
(parted) print
Model: Generic Mass-Storage (scsi)
Disk /dev/sdb: 15.6GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 32.8kB 2855MB 2855MB primary boot, hidden
2 2855MB 2856MB 721kB primary
(parted) mkpart primary 2856 15000
(parted) print
Model: Generic Mass-Storage (scsi)
Disk /dev/sdb: 15.6GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 32.8kB 2855MB 2855MB primary boot, hidden
2 2855MB 2856MB 721kB primary
3 2856MB 15.0GB 12.1GB primary lba
(parted) quit
Information: You may need to update /etc/fstab.
root@Kali:~# cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb3(若未安装cryptsetup执行# apt-get install cryptsetup)
WARNING!
========
这将覆盖 /dev/sdb3 上的数据,该动作不可取消。
Are you sure? (Type uppercase yes): YES
输入密码:
确认密码:
命令成功。
root@Kali:~# cryptsetup luksOpen /dev/sdb3 usb
输入 /dev/sdb3 的密码:
root@Kali:~# ls /dev/mapper/usb
/dev/mapper/usb
root@Kali:~# mkfs.ext4 /dev/mapper/usb
mke2fs 1.43.4 (31-Jan-2017)
创建含有 2964224 个块(每块 4k)和 741104 个inode的文件系统
文件系统UUID:e377abe1-a18a-4e41-b42c-61327c156439
超级块的备份存储于下列块:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
正在分配组表: 完成
正在写入inode表: 完成
创建日志(16384 个块)完成
写入超级块和文件系统账户统计信息: 已完成
root@Kali:~# e2label /dev/mapper/usb persistence
root@Kali:~# mkdir -p /mnt/usb
root@Kali:~# mount /dev/mapper/usb /mnt/usb/
root@Kali:~# echo "/ union" > /mnt/usb/persistence.conf
root@Kali:~# umount /dev/mapper/usb
root@Kali:~# cryptsetup luksClose /dev/mapper/usb
网友评论