#!ipxe # Script: live/infosec/kali/everything.ipxe # ID: 6fb03cac-eaca-444e-8a81-8200e4a9def5 # For more information, see: # https://ipxe.org/ # https://ipxe.org/scripting ################################# # Script-wide/global variables. # ################################# :set_script_vars isset ${do_debug} || set do_debug 0 isset ${do_serial} || set do_serial 0 set base_url https://boot.netfire.com/ set http_base_url http://boot.netfire.com/ :set_bg iseq ${bg_set} 1 && goto skip_set_bg || echo Setting up menus... # Try different backgrounds sequentially until we find one that works. console --keep --picture ${base_url}bg.png && set bg_set 1 && goto skip_set_bg || console --keep --picture ${base_url}bg_lores.png && set bg_set 1 && goto skip_set_bg || console --keep --picture ${base_url}bg.pnm && set bg_set 1 && goto skip_set_bg || console --keep --picture ${base_url}bg_lores.pnm && set bg_set 1 && goto skip_set_bg || # Finally, fall back to text-only mode. echo Failed to use graphical console; reverting to text-only. console --x 1024 --y 768 || # "Red" xformed to a brighter/robust red) colour --rgb 0xb52a3d 1 || # "Green" xformed to orange) colour --rgb 0xcf6245 2 || # "Yellow" xformed to more of a gold) colour --rgb 0xc7a34d 3 || # "Magenta" xformed to a light purple) colour --rgb 0x6139a9 5 || # "Cyan" xformed to dark blue) colour --rgb 0x000120 6 || ## cpair --foreground 7 --background 5 0 || cpair --foreground 7 --background 6 1 || cpair --foreground 3 --background 6 2 || cpair --foreground 7 --background 6 3 || cpair --foreground 1 --background 6 4 || cpair --foreground 6 --background 1 5 || cpair --foreground 7 --background 6 6 || cpair --foreground 7 --background 6 7 || set bg_set 1 || :skip_set_bg set script_path ${base_url}live/infosec/kali/everything.ipxe || # If 6fb03cac-eaca-444e-8a81-8200e4a9def5/prev (this script) is not set, assume this is the entry script. isset ${6fb03cac-eaca-444e-8a81-8200e4a9def5/prev} || set 6fb03cac-eaca-444e-8a81-8200e4a9def5/prev ${script_path} isset ${entry_script} && goto skip_set_entry || set entry_script ${script_path} || :skip_set_entry # Since we are at the beginning of a script, we need to set this to "true". set prev_is_script 1 || ##################################### # End script-wide/global variables. # ##################################### :skip_script_vars ############################################ # Set hardware architecture and # # bitness strings for use in templating. # # Note: # # (U)EFI vs. BIOS can be determined by # # the ${platform} iPXE builtin. # # More information: # # https://ipxe.org/cfg/platform # ############################################ # bits: 64, 32 # # arch0: x86_64, i386, arm64, arm32 # # arch0u: X86_64, I386, ARM64, ARM32 # # arch1: x86_64, x86, arm64, arm32 # # arch1u: X86_64, X86, ARM64, ARM32 # # arch2: amd64, i686, arm64, arm32 # # arch2u: AMD64, I686, ARM64, ARM32 # # ${buildarch}: x86_64, i386, arm64, arm32 # # ${platform}: efi, pcbios, linux # ############################################ :setarch isset ${bits} && goto skiparch || set arch0 ${buildarch} goto setarch-${arch0} || goto exiterr :setarch-i386 # If true, it's a 32-bit build but a 64-bit CPU, so... cpuid --ext 29 && goto setarch-x86_64 || # Otherwise definitely 32-bit. set bits 32 set arch0u I386 set arch1 x86 set arch1u X86 set arch2 i686 set arch2u I686 goto skiparch :setarch-x86_64 iseq ${arch0} i386 && set arch0 x86_64 || set bits 64 set arch0u X86_64 set arch1 x86_64 set arch1u ${arch0u} set arch2 amd64 set arch2u AMD64 goto skiparch :setarch-arm32 set bits 32 set arch0u ARM32 set arch1 arm32 set arch1u ${arch0u} set arch2 ${arch1} set arch2u ${arch0u} goto skiparch :setarch-arm64 set bits 64 set arch0u ARM64 set arch1 arm64 set arch1u ${arch0u} set arch2 ${arch1} set arch2u ${arch0u} goto skiparch ########################################## # End hardware architecture and bitness. # ########################################## :skiparch ######################### # Convenience variables # ######################### :setconvenience isset ${esc} && goto skipconvenience || set esc:hex 1b set cls ${esc:string}[2J ############################# # End convenience variables # ############################# :skipconvenience ############################################### # Boot options for all (supported) MenuItems. # ############################################### :getbootopts # Bootopts for Standard ## "Live"/Active isset ${f13aec32-4bfa-4659-9051-4c30a7dfb616/bootopts} || set f13aec32-4bfa-4659-9051-4c30a7dfb616/bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs splash initrd=initrd.img quiet ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 ## Original set f13aec32-4bfa-4659-9051-4c30a7dfb616/orig_bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs splash initrd=initrd.img quiet ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 # Bootopts for Fail-Safe ## "Live"/Active isset ${00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/bootopts} || set 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs initrd=initrd.img ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash ## Original set 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/orig_bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs initrd=initrd.img ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 memtest noapic noapm nodma nomce nolapic nomodeset nosmp nosplash # Bootopts for Forensic Mode ## "Live"/Active isset ${23f1436d-46b0-4611-a3cf-edeeecfe4994/bootopts} || set 23f1436d-46b0-4611-a3cf-edeeecfe4994/bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs splash initrd=initrd.img quiet ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 noswap noautomount ## Original set 23f1436d-46b0-4611-a3cf-edeeecfe4994/orig_bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs splash initrd=initrd.img quiet ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 noswap noautomount # Bootopts for Persistent Mode ## "Live"/Active isset ${622d2593-4883-4fa8-b0cf-47b4797377fd/bootopts} || set 622d2593-4883-4fa8-b0cf-47b4797377fd/bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs splash initrd=initrd.img quiet ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 persistence ## Original set 622d2593-4883-4fa8-b0cf-47b4797377fd/orig_bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs splash initrd=initrd.img quiet ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 persistence # Bootopts for Encrypted Persistent Mode ## "Live"/Active isset ${d805610d-2f6b-4141-8b64-46c468a08409/bootopts} || set d805610d-2f6b-4141-8b64-46c468a08409/bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs splash initrd=initrd.img quiet ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 persistent=cryptsetup persistence-encryption=luks ## Original set d805610d-2f6b-4141-8b64-46c468a08409/orig_bootopts boot=live components fetch=${base_url}loop/kali/everything/live/filesystem.squashfs splash initrd=initrd.img quiet ssh encpasswd=$6$rounds=1000000$8Lpa7wUSlsEfUDEe$xl/0km886Pujmp2w00IbxT81ekvZljED1Fe2FProldQiO/OzpT6urmUeXZ4liDMwhULlha66jYrljy5oHOiaq0 persistent=cryptsetup persistence-encryption=luks ##################### # End boot options. # ##################### :skipgetbootopts ########################## # Target Selection/flow. # ########################## :findtarget # If we previously loaded (and left/attempted to leave) a menu within this script, # ${6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt} will be set to that menu's label. # It will be unset/null (${} -- `isset ${foo} == false` is the same as `iseq ${foo} == ${}` if it is unset.) # if this is the first time loading this script. isset ${6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt} && goto ${6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt} || ######################## # End Target Selection # ######################## :skipfindtarget ##################### # Menu definitions. # ##################### :menudefs ############## # BEGIN MENU # ############## :2a9f8138-3058-49cc-b974-55600058ea18 # Menu: "Kali (Everything)" # Label: 2a9f8138-3058-49cc-b974-55600058ea18 set prev_menu 2a9f8138-3058-49cc-b974-55600058ea18 set 6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt 2a9f8138-3058-49cc-b974-55600058ea18 # Script main/default menu. set prev_is_script 1 menu Kali (Everything) item --key s f13aec32-4bfa-4659-9051-4c30a7dfb616 (s) Standard set f13aec32-4bfa-4659-9051-4c30a7dfb616/prev 2a9f8138-3058-49cc-b974-55600058ea18 item --key f 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6 (f) Fail-Safe set 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/prev 2a9f8138-3058-49cc-b974-55600058ea18 item --key F 23f1436d-46b0-4611-a3cf-edeeecfe4994 (F) Forensic Mode set 23f1436d-46b0-4611-a3cf-edeeecfe4994/prev 2a9f8138-3058-49cc-b974-55600058ea18 item --key p 622d2593-4883-4fa8-b0cf-47b4797377fd (p) Persistent Mode set 622d2593-4883-4fa8-b0cf-47b4797377fd/prev 2a9f8138-3058-49cc-b974-55600058ea18 item --key e d805610d-2f6b-4141-8b64-46c468a08409 (e) Encrypted Persistent Mode set d805610d-2f6b-4141-8b64-46c468a08409/prev 2a9f8138-3058-49cc-b974-55600058ea18 item --gap item --key 0x147e 2a9f8138-3058-49cc-b974-55600058ea18_help (F8) Help > set 2a9f8138-3058-49cc-b974-55600058ea18_help/prev 2a9f8138-3058-49cc-b974-55600058ea18 item --key 0x157e 2a9f8138-3058-49cc-b974-55600058ea18_cfg (F9) Configure boot options for item(s) above set 2a9f8138-3058-49cc-b974-55600058ea18_cfg/prev 2a9f8138-3058-49cc-b974-55600058ea18 item --key 0x1b previous (ESC) Previous menu item --key 0x167e main_menu (F10) Main Menu ... choose --default f13aec32-4bfa-4659-9051-4c30a7dfb616 target || goto ${target} || goto ${2a9f8138-3058-49cc-b974-55600058ea18/prev} || goto previous ############ # END MENU # ############ ###################### # BEGIN SUBMENU HELP # ###################### # Menu: "Kali (Everything)" (HELP) # Label: 2a9f8138-3058-49cc-b974-55600058ea18 :2a9f8138-3058-49cc-b974-55600058ea18_help set prev_menu 2a9f8138-3058-49cc-b974-55600058ea18_help set 6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt 2a9f8138-3058-49cc-b974-55600058ea18_help menu Kali (Everything) Help item f13aec32-4bfa-4659-9051-4c30a7dfb616_help Standard > set f13aec32-4bfa-4659-9051-4c30a7dfb616/prev 2a9f8138-3058-49cc-b974-55600058ea18_help item 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6_help Fail-Safe > set 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/prev 2a9f8138-3058-49cc-b974-55600058ea18_help item 23f1436d-46b0-4611-a3cf-edeeecfe4994_help Forensic Mode > set 23f1436d-46b0-4611-a3cf-edeeecfe4994/prev 2a9f8138-3058-49cc-b974-55600058ea18_help item 622d2593-4883-4fa8-b0cf-47b4797377fd_help Persistent Mode > set 622d2593-4883-4fa8-b0cf-47b4797377fd/prev 2a9f8138-3058-49cc-b974-55600058ea18_help item d805610d-2f6b-4141-8b64-46c468a08409_help Encrypted Persistent Mode > set d805610d-2f6b-4141-8b64-46c468a08409/prev 2a9f8138-3058-49cc-b974-55600058ea18_help item --gap item --key 0x1b previous (ESC) Previous menu item --key 0x167e main_menu (F10) Main Menu ... choose target || goto ${target} || goto ${2a9f8138-3058-49cc-b974-55600058ea18_help/prev} || goto previous #################### # END SUBMENU HELP # #################### ######################## # BEGIN SUBMENU CONFIG # ######################## # Menu: "Kali (Everything)" (CONFIGURATION) # Label: 2a9f8138-3058-49cc-b974-55600058ea18 :2a9f8138-3058-49cc-b974-55600058ea18_cfg set prev_menu 2a9f8138-3058-49cc-b974-55600058ea18_cfg set 6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt 2a9f8138-3058-49cc-b974-55600058ea18_cfg menu Kali (Everything) Configuration item f13aec32-4bfa-4659-9051-4c30a7dfb616_cfg Standard > set f13aec32-4bfa-4659-9051-4c30a7dfb616/prev 2a9f8138-3058-49cc-b974-55600058ea18_cfg item 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6_cfg Fail-Safe > set 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/prev 2a9f8138-3058-49cc-b974-55600058ea18_cfg item 23f1436d-46b0-4611-a3cf-edeeecfe4994_cfg Forensic Mode > set 23f1436d-46b0-4611-a3cf-edeeecfe4994/prev 2a9f8138-3058-49cc-b974-55600058ea18_cfg item 622d2593-4883-4fa8-b0cf-47b4797377fd_cfg Persistent Mode > set 622d2593-4883-4fa8-b0cf-47b4797377fd/prev 2a9f8138-3058-49cc-b974-55600058ea18_cfg item d805610d-2f6b-4141-8b64-46c468a08409_cfg Encrypted Persistent Mode > set d805610d-2f6b-4141-8b64-46c468a08409/prev 2a9f8138-3058-49cc-b974-55600058ea18_cfg item --gap item --key 0x1b previous (ESC) Previous menu item --key 0x167e main_menu (F10) Main Menu ... choose target || goto ${target} || goto ${2a9f8138-3058-49cc-b974-55600058ea18_cfg/prev} || goto previous ###################### # END SUBMENU CONFIG # ###################### ################# # BEGIN ENTRIES # ################# # Entries for menu "Kali (Everything)" (2a9f8138-3058-49cc-b974-55600058ea18) ############### # BEGIN ENTRY # ############### # Entry: "Standard" # Label: f13aec32-4bfa-4659-9051-4c30a7dfb616 # Type: ItemTypeKernel # https://kali.org/ # Kali Standard mode options. :f13aec32-4bfa-4659-9051-4c30a7dfb616 set prev_is_script 0 iseq ${do_serial} 1 && kernel ${base_url}loop/kali/everything/live/vmlinuz ${f13aec32-4bfa-4659-9051-4c30a7dfb616/bootopts} console=tty1 console=ttyS0,9600n8 noquick || kernel ${base_url}loop/kali/everything/live/vmlinuz ${f13aec32-4bfa-4659-9051-4c30a7dfb616/bootopts} || goto previous initrd ${base_url}loop/kali/everything/live/initrd.img || goto previous boot || goto ${f13aec32-4bfa-4659-9051-4c30a7dfb616/prev} || goto previous ############# # END ENTRY # ############# #################### # BEGIN ENTRY HELP # #################### # Entry: "Standard" (HELP) # Label: f13aec32-4bfa-4659-9051-4c30a7dfb616 # Type: ItemTypeKernel # https://kali.org/ # Kali Standard mode options. :f13aec32-4bfa-4659-9051-4c30a7dfb616_help set prev_is_script 0 set f13aec32-4bfa-4659-9051-4c30a7dfb616_help/prev f13aec32-4bfa-4659-9051-4c30a7dfb616 echo Standard: echo Kali Standard mode options. prompt (Press any key to exit) goto ${f13aec32-4bfa-4659-9051-4c30a7dfb616/prev} || goto previous ################## # END ENTRY HELP # ################## ###################### # BEGIN ENTRY CONFIG # ###################### # Entry: "Standard" (CONFIGURATION) # Label: f13aec32-4bfa-4659-9051-4c30a7dfb616 # Type: ItemTypeKernel # https://kali.org/ # Kali Standard mode options. :f13aec32-4bfa-4659-9051-4c30a7dfb616_cfg set prev_is_script 0 echo Set custom boot options for Standard below. echo Leave blank to use the currently configured options. echo Use the string "%DEFAULT%" (without quotes) to reset to the default. echo echo CURRENT: echo ${f13aec32-4bfa-4659-9051-4c30a7dfb616/bootopts} echo echo DEFAULT: echo ${f13aec32-4bfa-4659-9051-4c30a7dfb616/orig_bootopts} echo echo -n Boot options: ${} && read user_bootopts || goto prev_menu_f13aec32-4bfa-4659-9051-4c30a7dfb616_cfg iseq ${user_bootopts} ${} && goto prev_menu_f13aec32-4bfa-4659-9051-4c30a7dfb616_cfg || iseq ${user_bootopts} %DEFAULT% && set f13aec32-4bfa-4659-9051-4c30a7dfb616/bootopts ${f13aec32-4bfa-4659-9051-4c30a7dfb616/orig_bootopts} && goto prev_menu_f13aec32-4bfa-4659-9051-4c30a7dfb616_cfg || set f13aec32-4bfa-4659-9051-4c30a7dfb616/bootopts ${user_bootopts} && goto ${f13aec32-4bfa-4659-9051-4c30a7dfb616/prev} || goto previous #################### # END ENTRY CONFIG # #################### ############### # BEGIN ENTRY # ############### # Entry: "Fail-Safe" # Label: 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6 # Type: ItemTypeKernel # https://kali.org/ # Kali Fail-Safe mode options - this may have a better chance of working if the host has issues booting Standard. :00a1e5f3-7c09-4dd9-aee6-a53e91092bd6 set prev_is_script 0 iseq ${do_serial} 1 && kernel ${base_url}loop/kali/everything/live/vmlinuz ${00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/bootopts} console=tty1 console=ttyS0,9600n8 noquick || kernel ${base_url}loop/kali/everything/live/vmlinuz ${00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/bootopts} || goto previous initrd ${base_url}loop/kali/everything/live/initrd.img || goto previous boot || goto ${00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/prev} || goto previous ############# # END ENTRY # ############# #################### # BEGIN ENTRY HELP # #################### # Entry: "Fail-Safe" (HELP) # Label: 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6 # Type: ItemTypeKernel # https://kali.org/ # Kali Fail-Safe mode options - this may have a better chance of working if the host has issues booting Standard. :00a1e5f3-7c09-4dd9-aee6-a53e91092bd6_help set prev_is_script 0 set 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6_help/prev 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6 echo Fail-Safe: echo Kali Fail-Safe mode options - this may have a better chance of working if the host has issues booting Standard. prompt (Press any key to exit) goto ${00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/prev} || goto previous ################## # END ENTRY HELP # ################## ###################### # BEGIN ENTRY CONFIG # ###################### # Entry: "Fail-Safe" (CONFIGURATION) # Label: 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6 # Type: ItemTypeKernel # https://kali.org/ # Kali Fail-Safe mode options - this may have a better chance of working if the host has issues booting Standard. :00a1e5f3-7c09-4dd9-aee6-a53e91092bd6_cfg set prev_is_script 0 echo Set custom boot options for Fail-Safe below. echo Leave blank to use the currently configured options. echo Use the string "%DEFAULT%" (without quotes) to reset to the default. echo echo CURRENT: echo ${00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/bootopts} echo echo DEFAULT: echo ${00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/orig_bootopts} echo echo -n Boot options: ${} && read user_bootopts || goto prev_menu_00a1e5f3-7c09-4dd9-aee6-a53e91092bd6_cfg iseq ${user_bootopts} ${} && goto prev_menu_00a1e5f3-7c09-4dd9-aee6-a53e91092bd6_cfg || iseq ${user_bootopts} %DEFAULT% && set 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/bootopts ${00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/orig_bootopts} && goto prev_menu_00a1e5f3-7c09-4dd9-aee6-a53e91092bd6_cfg || set 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/bootopts ${user_bootopts} && goto ${00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/prev} || goto previous #################### # END ENTRY CONFIG # #################### ############### # BEGIN ENTRY # ############### # Entry: "Forensic Mode" # Label: 23f1436d-46b0-4611-a3cf-edeeecfe4994 # Type: ItemTypeKernel # https://kali.org/ # Forensic mode will not automatically touch any of the disks installed on the system (e.g. no swap or automounting). :23f1436d-46b0-4611-a3cf-edeeecfe4994 set prev_is_script 0 iseq ${do_serial} 1 && kernel ${base_url}loop/kali/everything/live/vmlinuz ${23f1436d-46b0-4611-a3cf-edeeecfe4994/bootopts} console=tty1 console=ttyS0,9600n8 noquick || kernel ${base_url}loop/kali/everything/live/vmlinuz ${23f1436d-46b0-4611-a3cf-edeeecfe4994/bootopts} || goto previous initrd ${base_url}loop/kali/everything/live/initrd.img || goto previous boot || goto ${23f1436d-46b0-4611-a3cf-edeeecfe4994/prev} || goto previous ############# # END ENTRY # ############# #################### # BEGIN ENTRY HELP # #################### # Entry: "Forensic Mode" (HELP) # Label: 23f1436d-46b0-4611-a3cf-edeeecfe4994 # Type: ItemTypeKernel # https://kali.org/ # Forensic mode will not automatically touch any of the disks installed on the system (e.g. no swap or automounting). :23f1436d-46b0-4611-a3cf-edeeecfe4994_help set prev_is_script 0 set 23f1436d-46b0-4611-a3cf-edeeecfe4994_help/prev 23f1436d-46b0-4611-a3cf-edeeecfe4994 echo Forensic Mode: echo Forensic mode will not automatically touch any of the disks installed on the system (e.g. no swap or automounting). prompt (Press any key to exit) goto ${23f1436d-46b0-4611-a3cf-edeeecfe4994/prev} || goto previous ################## # END ENTRY HELP # ################## ###################### # BEGIN ENTRY CONFIG # ###################### # Entry: "Forensic Mode" (CONFIGURATION) # Label: 23f1436d-46b0-4611-a3cf-edeeecfe4994 # Type: ItemTypeKernel # https://kali.org/ # Forensic mode will not automatically touch any of the disks installed on the system (e.g. no swap or automounting). :23f1436d-46b0-4611-a3cf-edeeecfe4994_cfg set prev_is_script 0 echo Set custom boot options for Forensic Mode below. echo Leave blank to use the currently configured options. echo Use the string "%DEFAULT%" (without quotes) to reset to the default. echo echo CURRENT: echo ${23f1436d-46b0-4611-a3cf-edeeecfe4994/bootopts} echo echo DEFAULT: echo ${23f1436d-46b0-4611-a3cf-edeeecfe4994/orig_bootopts} echo echo -n Boot options: ${} && read user_bootopts || goto prev_menu_23f1436d-46b0-4611-a3cf-edeeecfe4994_cfg iseq ${user_bootopts} ${} && goto prev_menu_23f1436d-46b0-4611-a3cf-edeeecfe4994_cfg || iseq ${user_bootopts} %DEFAULT% && set 23f1436d-46b0-4611-a3cf-edeeecfe4994/bootopts ${23f1436d-46b0-4611-a3cf-edeeecfe4994/orig_bootopts} && goto prev_menu_23f1436d-46b0-4611-a3cf-edeeecfe4994_cfg || set 23f1436d-46b0-4611-a3cf-edeeecfe4994/bootopts ${user_bootopts} && goto ${23f1436d-46b0-4611-a3cf-edeeecfe4994/prev} || goto previous #################### # END ENTRY CONFIG # #################### ############### # BEGIN ENTRY # ############### # Entry: "Persistent Mode" # Label: 622d2593-4883-4fa8-b0cf-47b4797377fd # Type: ItemTypeKernel # https://kali.org/prst # Persistent mode allows for loading persistent settings, etc. from an attached disk. See https://kali.org/prst for more information. :622d2593-4883-4fa8-b0cf-47b4797377fd set prev_is_script 0 iseq ${do_serial} 1 && kernel ${base_url}loop/kali/everything/live/vmlinuz ${622d2593-4883-4fa8-b0cf-47b4797377fd/bootopts} console=tty1 console=ttyS0,9600n8 noquick || kernel ${base_url}loop/kali/everything/live/vmlinuz ${622d2593-4883-4fa8-b0cf-47b4797377fd/bootopts} || goto previous initrd ${base_url}loop/kali/everything/live/initrd.img || goto previous boot || goto ${622d2593-4883-4fa8-b0cf-47b4797377fd/prev} || goto previous ############# # END ENTRY # ############# #################### # BEGIN ENTRY HELP # #################### # Entry: "Persistent Mode" (HELP) # Label: 622d2593-4883-4fa8-b0cf-47b4797377fd # Type: ItemTypeKernel # https://kali.org/prst # Persistent mode allows for loading persistent settings, etc. from an attached disk. See https://kali.org/prst for more information. :622d2593-4883-4fa8-b0cf-47b4797377fd_help set prev_is_script 0 set 622d2593-4883-4fa8-b0cf-47b4797377fd_help/prev 622d2593-4883-4fa8-b0cf-47b4797377fd echo Persistent Mode: echo Persistent mode allows for loading persistent settings, etc. from an attached disk. See https://kali.org/prst for more information. prompt (Press any key to exit) goto ${622d2593-4883-4fa8-b0cf-47b4797377fd/prev} || goto previous ################## # END ENTRY HELP # ################## ###################### # BEGIN ENTRY CONFIG # ###################### # Entry: "Persistent Mode" (CONFIGURATION) # Label: 622d2593-4883-4fa8-b0cf-47b4797377fd # Type: ItemTypeKernel # https://kali.org/prst # Persistent mode allows for loading persistent settings, etc. from an attached disk. See https://kali.org/prst for more information. :622d2593-4883-4fa8-b0cf-47b4797377fd_cfg set prev_is_script 0 echo Set custom boot options for Persistent Mode below. echo Leave blank to use the currently configured options. echo Use the string "%DEFAULT%" (without quotes) to reset to the default. echo echo CURRENT: echo ${622d2593-4883-4fa8-b0cf-47b4797377fd/bootopts} echo echo DEFAULT: echo ${622d2593-4883-4fa8-b0cf-47b4797377fd/orig_bootopts} echo echo -n Boot options: ${} && read user_bootopts || goto prev_menu_622d2593-4883-4fa8-b0cf-47b4797377fd_cfg iseq ${user_bootopts} ${} && goto prev_menu_622d2593-4883-4fa8-b0cf-47b4797377fd_cfg || iseq ${user_bootopts} %DEFAULT% && set 622d2593-4883-4fa8-b0cf-47b4797377fd/bootopts ${622d2593-4883-4fa8-b0cf-47b4797377fd/orig_bootopts} && goto prev_menu_622d2593-4883-4fa8-b0cf-47b4797377fd_cfg || set 622d2593-4883-4fa8-b0cf-47b4797377fd/bootopts ${user_bootopts} && goto ${622d2593-4883-4fa8-b0cf-47b4797377fd/prev} || goto previous #################### # END ENTRY CONFIG # #################### ############### # BEGIN ENTRY # ############### # Entry: "Encrypted Persistent Mode" # Label: d805610d-2f6b-4141-8b64-46c468a08409 # Type: ItemTypeKernel # https://kali.org/prst # Encrypted persistent mode is like persistent mode but encrypts/uses an encrypted attached storage. See https://kali.org/prst for more information. :d805610d-2f6b-4141-8b64-46c468a08409 set prev_is_script 0 iseq ${do_serial} 1 && kernel ${base_url}loop/kali/everything/live/vmlinuz ${d805610d-2f6b-4141-8b64-46c468a08409/bootopts} console=tty1 console=ttyS0,9600n8 noquick || kernel ${base_url}loop/kali/everything/live/vmlinuz ${d805610d-2f6b-4141-8b64-46c468a08409/bootopts} || goto previous initrd ${base_url}loop/kali/everything/live/initrd.img || goto previous boot || goto ${d805610d-2f6b-4141-8b64-46c468a08409/prev} || goto previous ############# # END ENTRY # ############# #################### # BEGIN ENTRY HELP # #################### # Entry: "Encrypted Persistent Mode" (HELP) # Label: d805610d-2f6b-4141-8b64-46c468a08409 # Type: ItemTypeKernel # https://kali.org/prst # Encrypted persistent mode is like persistent mode but encrypts/uses an encrypted attached storage. See https://kali.org/prst for more information. :d805610d-2f6b-4141-8b64-46c468a08409_help set prev_is_script 0 set d805610d-2f6b-4141-8b64-46c468a08409_help/prev d805610d-2f6b-4141-8b64-46c468a08409 echo Encrypted Persistent Mode: echo Encrypted persistent mode is like persistent mode but encrypts/uses an encrypted attached storage. See https://kali.org/prst for more information. prompt (Press any key to exit) goto ${d805610d-2f6b-4141-8b64-46c468a08409/prev} || goto previous ################## # END ENTRY HELP # ################## ###################### # BEGIN ENTRY CONFIG # ###################### # Entry: "Encrypted Persistent Mode" (CONFIGURATION) # Label: d805610d-2f6b-4141-8b64-46c468a08409 # Type: ItemTypeKernel # https://kali.org/prst # Encrypted persistent mode is like persistent mode but encrypts/uses an encrypted attached storage. See https://kali.org/prst for more information. :d805610d-2f6b-4141-8b64-46c468a08409_cfg set prev_is_script 0 echo Set custom boot options for Encrypted Persistent Mode below. echo Leave blank to use the currently configured options. echo Use the string "%DEFAULT%" (without quotes) to reset to the default. echo echo CURRENT: echo ${d805610d-2f6b-4141-8b64-46c468a08409/bootopts} echo echo DEFAULT: echo ${d805610d-2f6b-4141-8b64-46c468a08409/orig_bootopts} echo echo -n Boot options: ${} && read user_bootopts || goto prev_menu_d805610d-2f6b-4141-8b64-46c468a08409_cfg iseq ${user_bootopts} ${} && goto prev_menu_d805610d-2f6b-4141-8b64-46c468a08409_cfg || iseq ${user_bootopts} %DEFAULT% && set d805610d-2f6b-4141-8b64-46c468a08409/bootopts ${d805610d-2f6b-4141-8b64-46c468a08409/orig_bootopts} && goto prev_menu_d805610d-2f6b-4141-8b64-46c468a08409_cfg || set d805610d-2f6b-4141-8b64-46c468a08409/bootopts ${user_bootopts} && goto ${d805610d-2f6b-4141-8b64-46c468a08409/prev} || goto previous #################### # END ENTRY CONFIG # #################### # End entries for menu "Kali (Everything)" (2a9f8138-3058-49cc-b974-55600058ea18) ############### # END ENTRIES # ############### ######################### # End menu definitions. # ######################### :skipmenudefs ###################################### # Menu navigation and exit handling. # ###################################### :previous iseq ${do_debug} 1 && goto prev_debug || goto prev_no_debug :prev_debug ## Debugging ## echo cls: ${cls} echo prev_is_script: ${prev_is_script} echo 6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt: ${6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt} echo main_menu: ${main_menu} echo prev_menu: ${prev_menu} echo prev_menu (dereferenced); ${prev_menu}/prev: ${${prev_menu}/prev} echo Script live/infosec/kali/everything.ipxe (current script): # The "${} ${} " is to force two spaces. They'd be trimmed otherwise. echo ${} ${} 6fb03cac-eaca-444e-8a81-8200e4a9def5/prev: ${6fb03cac-eaca-444e-8a81-8200e4a9def5/prev} echo ${} ${} 6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt: ${6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt} echo Menus (local to this script) (A blank /prev tends to indicate script's default/entry menu): echo ${} ${} 2a9f8138-3058-49cc-b974-55600058ea18 ("Kali (Everything)") echo ${} ${} ${} ${} 2a9f8138-3058-49cc-b974-55600058ea18/prev: ${2a9f8138-3058-49cc-b974-55600058ea18/prev} echo ${} ${} ${} ${} 2a9f8138-3058-49cc-b974-55600058ea18/tgt: ${2a9f8138-3058-49cc-b974-55600058ea18/tgt} echo target: ${target} echo main_menu: ${main_menu} prompt (press any key to continue to arch) echo echo bits: 64, 32 echo arch0: x86_64, i386, arm64, arm32 echo arch0u: X86_64, I386, ARM64, ARM32 echo arch1: x86_64, x86, arm64, arm32 echo arch1u: X86_64, X86, ARM64, ARM32 echo arch2: amd64, i686, arm64, arm32 echo arch2u: AMD64, I686, ARM64, ARM32 echo buildarch: x86_64, i386, arm64, arm32 echo platform: efi, pcbios, linux echo echo bits, arch0, arch0u, arch1, arch1u, arch2, arch2u, buildarch, platform: echo ${bits}, ${arch0}, ${arch0u}, ${arch1}, ${arch1u}, ${arch2}, ${arch2u}, ${buildarch}, ${platform} echo # ECHO DEBUG OF PREV_NO_DEBUG HERE prompt (press any key to continue regular previous target) :prev_no_debug :prev_test0 # If prev_is_script is true and prev_6fb03cac-eaca-444e-8a81-8200e4a9def5 is set and is this script, # assume exit (as this is probably entry_script, and "previous" dest in this logic tree is to actually exit). # Otherwise continue. iseq ${do_debug} 1 && prompt (PREVIOUS: prev_test0) || iseq ${prev_is_script} 1 && iseq ${prev_6fb03cac-eaca-444e-8a81-8200e4a9def5} ${script_path} && exit || :prev_test1 # If 6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt is set and prev_is_script is false, go to menu in this script - otherwise continue. iseq ${do_debug} 1 && prompt (PREVIOUS: prev_test1) || iseq ${prev_is_script} 0 && isset ${${prev_menu}/prev} && goto ${${prev_menu}/prev} || :prev_test2 # If prev_is_script is set, continue to prev_test3. Otherwise, set to true (default for scripts) and # go to 6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt (otherwise continue to prev_test3). # This is in case prev_test1 fails but should have succeeded. iseq ${do_debug} 1 && prompt (PREVIOUS: prev_test2) || isset ${prev_is_script} && goto prev_test3 || set prev_is_script 1 && isset ${6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt} && goto ${6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt} || :prev_test3 # If prev_is_script is 1 (true), our previous menu is in another script so skip to chainloading that. # Otherwise, use this script's last set target. iseq ${do_debug} 1 && prompt (PREVIOUS: prev_test3) || iseq ${prev_is_script} 1 && goto prev_last || isset ${6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt} && goto ${6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt} || :prev_last # If prev_is_script is true, then we need to go to ${prev_6fb03cac-eaca-444e-8a81-8200e4a9def5}. The target and exiterr gotos are fallbacks. iseq ${do_debug} 1 && prompt (PREVIOUS: prev_last; chain to ${6fb03cac-eaca-444e-8a81-8200e4a9def5/prev}) && prompt (press any key to continue) || chain ${6fb03cac-eaca-444e-8a81-8200e4a9def5/prev} || goto ${target} || goto exiterr :exiterr echo ERROR ENCOUNTERED iseq ${do_debug} 1 && sleep 2 || exit 1 :exitsuccess exit 0 :exit goto exit_${platform} :exit_efi # We exit 1 instead of just exit (exit with error vs. exit without error) so some broken UEFI will boot the "next" device. exit 0 :exit_pcbios # Boot the "first hard disk". Unpredictable, but so's BIOS lol. sanboot --no-describe --drive 0x80 || # TODO: https://ipxe.org/appnote/work_around_bios_halting_on_ipxe_exit ? exit 1 #exit :main_menu goto ${main_menu} || chain ${entry_script} || goto previous :clear_all # Clear dynamic session-based variables. imgfree || clear do_debug clear bg_set clear prev_is_script clear 6fb03cac-eaca-444e-8a81-8200e4a9def5/prev clear 6fb03cac-eaca-444e-8a81-8200e4a9def5/tgt clear main_menu clear ${prev_menu}/prev clear prev_menu clear 2a9f8138-3058-49cc-b974-55600058ea18/prev clear 2a9f8138-3058-49cc-b974-55600058ea18/tgt clear target clear main_menu clear bits clear arch0 clear arch0u clear arch1 clear arch1u clear arch2 clear arch2u clear esc clear cls clear f13aec32-4bfa-4659-9051-4c30a7dfb616/bootopts clear f13aec32-4bfa-4659-9051-4c30a7dfb616/orig_bootopts clear 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/bootopts clear 00a1e5f3-7c09-4dd9-aee6-a53e91092bd6/orig_bootopts clear 23f1436d-46b0-4611-a3cf-edeeecfe4994/bootopts clear 23f1436d-46b0-4611-a3cf-edeeecfe4994/orig_bootopts clear 622d2593-4883-4fa8-b0cf-47b4797377fd/bootopts clear 622d2593-4883-4fa8-b0cf-47b4797377fd/orig_bootopts clear d805610d-2f6b-4141-8b64-46c468a08409/bootopts clear d805610d-2f6b-4141-8b64-46c468a08409/orig_bootopts chain --autofree --replace ${entry_script} || goto exiterr :ipxe_shell echo ${cls} echo This is the NetFire NetBoot shell. echo Use the 'help' command for a list of possible commands. echo Exit back to the menu by executing the command 'exit'. shell || goto exiterr goto previous ###################################### # End menu navigation/exit handling. # ######################################