aboutsummaryrefslogtreecommitdiff
path: root/disable_prot.sh
blob: 712ca6643e8c4373d0699f1023768d9c68447fa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

if [ `id -u` -ne 0 ]; then
  echo "$0: This script should be run as root."
  echo "$0: Try to get root .."
  sudo "$(readlink -f $0)"
  exit $?
fi

cat /proc/cpuinfo | grep -oq pae 2>/dev/null >/dev/null
ret=$?
if [ $ret -eq 0 ]; then
  echo "$0: PAE enabled system found."
  echo "$0: Some exploits may not work!"
fi

set -x
sysctl -w kernel.randomize_va_space=0 2>/dev/null
sysctl -w kernel.exec-shield=0 2>/dev/null