-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinux_off.sh
More file actions
executable file
·33 lines (26 loc) · 843 Bytes
/
Copy pathlinux_off.sh
File metadata and controls
executable file
·33 lines (26 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root. Use sudo."
exit 1
fi
echo 1 > /proc/sys/kernel/randomize_va_space
echo 1 > /proc/sys/kernel/yama/ptrace_scope
echo 1 > /proc/sys/kernel/apparmor_restrict_unprivileged_userns
current_value=$(cat /proc/sys/kernel/randomize_va_space)
if [ "$current_value" -eq 1 ]; then
echo "ASLR has been enabled."
else
echo "Failed to enable ASLR."
fi
current_value=$(cat /proc/sys/kernel/yama/ptrace_scope)
if [ "$current_value" -eq 1 ]; then
echo "ptrace_scope has been enabled."
else
echo "Failed to enable ptrace_scope."
fi
current_value=$(cat /proc/sys/kernel/apparmor_restrict_unprivileged_userns)
if [ "$current_value" -eq 1 ]; then
echo "Apparmor restriction has been enabled."
else
echo "Failed to enable apparmor restriction."
fi