制作uefi的kali安装盘_制作 UD + EFI + PE + KALI 启动U盘
0x01 制作KALI GHOST 文件
準備一個32G的U盤,然后下載KALI ISO,使用LIVE進入KALI系統(tǒng),并使用DD命令將kali系統(tǒng)ISO寫入U盤中
1.虛擬機進入Kali環(huán)境,插入U盤,使用dmesg命令檢查U盤的盤符和信息
2.啟動gparted 卸載掉分區(qū)后,刪除分區(qū)
3.使用dd命令將Kali iso 寫入U盤
dd if=kali-linux-kde-2019.2-amd64.iso of=/dev/sdb bs=1M
4.使用DiskGenius 將U盤中EFI分區(qū)的文件保存起來備用
5.使用ghost工具將制作好的KALI系統(tǒng)分區(qū)備份成kali.gho
5.1 打開Ghost按照1.2.2的菜單順序備份分區(qū)
0x02 制作PE及UD和EFI分區(qū)
使用DiskGenius將U盤格式化成NTFS的一個分區(qū)
去無憂論壇下載一個可以格式化三分區(qū)的EFI系統(tǒng)
打開相關PE制作文件,使用專用U盤三分區(qū)工具來制作PE
制作完成后,打開DiskGenius來查看分區(qū)
分區(qū)已經制作好
檢查EFI分區(qū)中的文件夾是否與圖片一致
如果不一致需要重新制作
0x03 將KALI LINUX 還原到U盤中
1.使用DiskGenius將DATA分區(qū)格式化成4G的分區(qū)FAT32格式,注意4K對其
2.使用DiskGenius將剩余的分區(qū)格式化成10G的KALI的數(shù)據分區(qū)和剩余的U盤自用分區(qū)
3.使用GHOST還原KALI分區(qū)
使用1.2.3 的順序來還原分區(qū)
還原完成后,使用DiskGenus查看分區(qū)情況
如圖則為還原igg
0x04 配置啟動菜單
1.配置BIOS啟動的啟動菜單
使用FbinstTool來讀取UD分區(qū)中的文件
如果提示MBR被破壞,修復它!
打開后,會讀取UD分區(qū)中的內容
將wepe.iso拷貝出來
使用UltraISO打開拷貝出來的wepe.iso
將其中的WEPEMENU.INI拷貝出來
打開后是如下代碼
timeout 5
default 1
gfxmenu /WEPE/MESSAGE
title [01] 微 PE 工具箱(10) [支持NVMe] 64位
chainloader ()/WEPE/W10PE64 || find --set-root --ignore-floppies --ignore-cd chainloader /WEPE/W10PE64
title [02] 微 PE 工具箱(8) [老機適用] 64位
chainloader ()/WEPE/W8PE64 || find --set-root --ignore-floppies --ignore-cd chainloader /WEPE/W8PE64
title [03] MaxDOS 工具箱
map --mem /WEPE/MAXDOS.IMG (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
title [04] 自定義ISO鏡像
graphicsmode -1 640
font /WEPE/MENU.HEX
/WEPE/RUN --automenu-all /ISO/
title [05] 從硬盤啟動
find --set-root --ignore-floppies --ignore-cd /ntldr || find --set-root --ignore-floppies --ignore-cd /bootmgr
map () (hd0)
map (hd0) ()
map --rehook
find --set-root --ignore-floppies --ignore-cd /ntldr || find --set-root --ignore-floppies --ignore-cd /bootmgr
chainloader /ntldr || chainloader /bootmgr
title [06] 重啟計算機
reboot
title [07] 關閉計算機
halt
在02 和 03 之間添加一個啟動項用于啟動KALI
timeout 5
default 1
gfxmenu /WEPE/MESSAGE
title [01] 微 PE 工具箱(10) [支持NVMe] 64位
chainloader ()/WEPE/W10PE64 || find --set-root --ignore-floppies --ignore-cd chainloader /WEPE/W10PE64
title [02] 微 PE 工具箱(8) [老機適用] 64位
chainloader ()/WEPE/W8PE64 || find --set-root --ignore-floppies --ignore-cd chainloader /WEPE/W8PE64
title [03] MaxDOS 工具箱
map --mem /WEPE/MAXDOS.IMG (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
title [04] Kali Linux
configfile /WEPE/KALI.LST
title [05] 自定義ISO鏡像
graphicsmode -1 640
font /WEPE/MENU.HEX
/WEPE/RUN --automenu-all /ISO/
title [06] 從硬盤啟動
find --set-root --ignore-floppies --ignore-cd /ntldr || find --set-root --ignore-floppies --ignore-cd /bootmgr
map () (hd0)
map (hd0) ()
map --rehook
find --set-root --ignore-floppies --ignore-cd /ntldr || find --set-root --ignore-floppies --ignore-cd /bootmgr
chainloader /ntldr || chainloader /bootmgr
title [07] 重啟計算機
reboot
title [08] 關閉計算機
halt
新建一個文本文件取名為KALI.LST
內容如下
timeout 25
default 2
gfxmenu /WEPE/MESSAGE
title [01] Kali Linux 【persistence】
find --set-root /g2ldr.mbr
kernel /live/vmlinuz boot=live noconfig=sudo username=root hostname=kali persistence
initrd /live/initrd.img
title [02] Kali Linux 【Encrypted Persistence】
find --set-root /g2ldr.mbr
kernel /live/vmlinuz boot=live noconfig persistent=cryptsetup persistence-encryption=luks noconfig=sudo username=root hostname=kali persistence
initrd /live/initrd.img
title [03] Kali Linux 【failsafe】
find --set-root /g2ldr.mbr
kernel /live/vmlinuz boot=live config memtest noapic noapm nodma nomce nolapic nomodeset
nosmp nosplash vag=normal
initrd /live/initrd.img
title [04] Kali Linux 【forensic mode】
find --set-root /g2ldr.mbr
kernel /live/vmlinuz boot=live noconfig=sudo username=root hostname=kali noswap
noautomount
initrd /live/initrd.img
title [05] 命令行
commandline
title [06] 返回主菜單
configfile /WEPE/WEPEMENU.INI
將修改好的文件WEPEMENU.INI和KALI.LST導入回剛剛提取出來的wepe.iso
最后結果如下
保存該ISO
然后導入到UD分區(qū)中去
2.配置UEFI的KALI啟動
下載grub-2.02-for-windows
解壓縮后進入目錄
建立一個配置文件x86_64-eif.cfg
內容如下
search.file /EFI/grub/x64.cfg root
set prefix=($root)/EFI/grub
configfile ($root)/EFI/grub/x64.cfg
進入該目錄的CMD
輸入一下代碼
grub-mkimage.exe -d x86_64-efi -c x86_64-efi.cfg -p /EFI/grub -o bootx64.efi -O x86_64-efi part_gpt part_msdos disk fat exfat ext2 ntfs xfs appleldr hfs iso9660 normal search_fs_file configfile linux linux16 chain loopback echo efi_gop efi_uga video_bochs video_cirrus file gfxmenu gfxterm gfxterm_background gfxterm_menu halt reboot help jpeg ls png true
執(zhí)行完成后,會生成bootx64.efi
打開U盤EFI分區(qū)的EFI目錄
建立KALI文件夾
將EFI文件夾下BOOT中的BOOTX64.efi復制一份到EFI/MICROSOFT/BOOT下
將之前grub中生成的bootx64.efi復制到EFI/BOOT下覆蓋
在EFI文件夾下建立grub文件夾
在grub文件夾下建立配置文件x64.cfg
內容如下
set default=0
set fallback=1
set timeout=5
menuentry "Windows" --hotkey=0 {
chainloader /efi/microsoft/boot/bootx64.efi
}
menuentry "Kali Linux" --hotkey=1 {
chainloader /efi/kali/bootx64.efi
}
現(xiàn)在UEFI啟動更改完成
0x05 設置KALI系統(tǒng)的持久性以及加密分區(qū)
這里使用虛擬機來演示
1.使用EFI進入菜單界面,選擇Kali Linux
2.選擇live 模式
3.進入kali后,打開終端,使用gparted查看需要持久化和加密的分區(qū)標識
這里是/dev/sdb2
4.使用luks加密該分區(qū)
cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb2
提示會刪除掉這個分區(qū)的所有數(shù)據,是否繼續(xù)呢?
輸入大寫的YES后,輸入加密分區(qū)的密碼,即可加密成功。
5.設置持久化
首先使用luks open 打開該分區(qū),掛在到/dev/mapper/usb下。
cryptsetup luksOpen /dev/sdb2 usb
將加密分區(qū)格式化成EXT4
mkfs.ext4 /dev/mapper/usb
格式化完成后,需要給這分區(qū)添加一個卷標 persistence
卷標名必須為【persistence】,這個是Kali系統(tǒng)規(guī)定的的可持續(xù)卷標
e2label /dev/mapper/usb persistence
寫入一個配置文件 persistence.conf 到加密分區(qū),以便kali啟動時候尋找
persistence.conf
/ union
首先mount 該加密分區(qū)到文件系統(tǒng)
mkdir -p /mnt/usb
mount /dev/mapper/usb /mnt/usb/
echo " / union" > /mnt/usb/persistence.conf
至此所有操作完成
0x06 測試
重啟系統(tǒng),其后選擇外部加密登錄
系統(tǒng)會檢查到加密分區(qū)
輸入密碼后,即可進入Kali系統(tǒng)
總結
以上是生活随笔為你收集整理的制作uefi的kali安装盘_制作 UD + EFI + PE + KALI 启动U盘的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C gdb调试工具
- 下一篇: ASP.NET Core ---日志