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.

Did this or another article help you? If you like and can afford it, you can buy me a coffee (3 EUR) ☕️ to support me in writing more posts. In case you would like to contribute more or I helped you directly via email or coding/troubleshooting session, you can opt to give a higher amount through the following links or adjust the quantity: 50 EUR, 100 EUR, 500 EUR. All links redirect to Stripe.