Disabling NX in Linux via Kernel Parameter (using GRUB)

less than 1 minute read

To boot Linux without Data Execution Prevention, so that the OS doesn’t mark certain memory regions as non-executable, we…

1.) … boot and enter the GRUB menu (hold Shift-key on boot*)

GRUB menu

2.) … select the OS and press e to edit the commands and kernel parameters

Kernel parameters

3.) … add noexec=off and/or noexec32=off (depending on what you want) in the linux line

Adding noexec flags

4.) … then boot with Ctrl-x

After booting, we should find the option disabled in the dmesg output:

dmesg output

Now we should be able to overflow and execute all the things :-)

* Tip: If you’re booting a VM and are not fast enough to interrupt the boot to access the menu, add a boot delay to your VM options (for ESXI it is in Settings -> VM Options -> Boot Options -> Boot Delay).

Like to comment? Feel free to send me an email or reach out on Twitter.