aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoni <toni@devlap.local>2015-03-04 10:00:07 +0100
committertoni <toni@devlap.local>2015-03-04 10:00:07 +0100
commit4ba94d8232cdb61b8e07c4a80197d9f704620ffb (patch)
treede8f2230a3982b77124a4decbf8d537c4c13625f
parent1bfe1303d5cc2bfb2d925f00d7d18a5950c2f4ec (diff)
- added PAE check
-rwxr-xr-xdisable_prot.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/disable_prot.sh b/disable_prot.sh
index 54cc3be..dba1bc0 100755
--- a/disable_prot.sh
+++ b/disable_prot.sh
@@ -1,12 +1,19 @@
#!/bin/bash
if [ `id -u` -ne 0 ]; then
- echo "$0: This script should be run as root"
+ 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
+
sysctl -w kernel.randomize_va_space=0 2>/dev/null
sysctl -w kernel.exec-shield=0 2>/dev/null
echo "done."