aboutsummaryrefslogtreecommitdiff
path: root/disable_prot.sh
blob: e33fe14b5d47f4f1a974ccd46b7532c791df6373 (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 .."
  su -l root -c "$(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 will not work!"
fi

set -x
sysctl -w kernel.randomize_va_space=0
sysctl -w kernel.exec-shield=0