summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <paulo@paulo.ac>2018-05-25 18:50:19 -0300
committerPaulo Alcantara <paulo@paulo.ac>2018-05-25 18:50:19 -0300
commitaf15f7165d28f0d498d08d4c268c2c54a152f497 (patch)
tree36f66490e59939b11367137ba66261ae2408cff2
parent84a17878d3799970c231e12ed92862a78e64ebe8 (diff)
downloadvmhtool-af15f7165d28f0d498d08d4c268c2c54a152f497.tar.gz
vmhtool-af15f7165d28f0d498d08d4c268c2c54a152f497.tar.xz
vmhtool-af15f7165d28f0d498d08d4c268c2c54a152f497.zip
Turn off KASLR by default when passing '--gdb' option.
Signed-off-by: Paulo Alcantara <paulo@paulo.ac>
-rwxr-xr-xvmhelper4
1 files changed, 4 insertions, 0 deletions
diff --git a/vmhelper b/vmhelper
index bad9a23..04922a8 100755
--- a/vmhelper
+++ b/vmhelper
@@ -680,6 +680,10 @@ if ($cmd_opts{kernel_path}) {
$qemu_cmd .= " " . sprintf $qemu_linux_opts{'kernel'}, $linux_img;
$qemu_cmd .= " -append \"root=$cmd_opts{rootfs_path} rw";
$qemu_cmd .= " $cmd_opts{kernel_cmdline}" if $cmd_opts{kernel_cmdline};
+ unless ($vm_gdb_port == -1) {
+ print "[*] NOTE: turning off KASLR by appending 'nokaslr' to the kernel cmdline\n";
+ $qemu_cmd .= " nokaslr";
+ }
unless ($cmd_opts{kernel_serial}) {
$qemu_cmd .= "\" -display none $qemu_linux_opts{'mon'}";
} else {