Startup script to set PaX perms.
Posted: Wed Nov 12, 2014 9:39 pm
http://pastebin.ca/2852871
Might be useful if you're setting up a box and don't want to be bothered finding it out yourself programme by programme
Might be useful if you're setting up a box and don't want to be bothered finding it out yourself programme by programme
- Code: Select all
#!/bin/sh
### BEGIN INIT INFO
# Provides: stupfc
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Sets permissions for PAX sensitive programs
# Description:
### END INIT INFO
/bin/echo "Starting Stupf-client script"
/sbin/bastille-netfilter start
chmod 755 /usr/bin/ssh
chmod 755 /usr/bin/scp
#mount /usr -o remount,rw
chown root:r00t /usr/bin/nmap
chmod 4750 /usr/bin/nmap
chown root:r00t /usr/bin/traceroute
chmod 4750 /usr/bin/traceroute
chown root:r00t /usr/bin/mtr
chmod 4750 /usr/bin/mtr
chown root:r00t /usr/bin/traceproto
chmod 4750 /usr/bin/traceproto
chown root:r00t /bin/su
chmod 4750 /bin/su
chown root:r00t /bin/sudo
chmod 4750 /bin/sudo
chown root:r00t /bin/ping
chmod 4750 /bin/ping
chown root:r00t /bin/ping6
chmod 4750 /bin/ping6
chown root:r00t /bin/mount
chmod 4750 /bin/mount
chown root:r00t /bin/mount.*
chmod 4750 /bin/mount.*
chown root:r00t /bin/umount
chmod 4750 /bin/umount
chown root:r00t /bin/umount.*
chmod 4750 /bin/umount.*
chown root:r00t /
chmod u=rwx /
chmod g=rx /
chmod o=x /
chown root:r00t /home
chmod u=rwx /home
chmod g=rx /home
chmod o=x /home
chown root:r00t /etc
chmod u=rwx /etc
chmod g=rx /etc
chmod o=x /etc
modprobe fuse
#mount /usr -o remount,ro
/bin/echo "Making /var/log/ directories and files for Tor"
mkdir /var/log/tor
chown debian-tor:r00t /var/log/tor
chmod u=rwx /var/log/tor
chmod g=rx /var/log/tor
chmod o= /var/log/tor
touch /var/log/tor/log
chown debian-tor:r00t /var/log/tor/log
chmod 740 /var/log/tor/log
/sbin/chpax -p /etc/X11/X
/sbin/chpax -pms /usr/games/q3map2
/sbin/chpax -pms /usr/games/q3map2.big
/sbin/chpax -pms /usr/games/q3map2.bigvis
/sbin/chpax -pms /usr/games/q3map2.bigvisdivpatched
/sbin/chpax -pms /usr/games/q3map2.bigvisdivpatchedmoreplanes
/sbin/chpax -pms /usr/games/q3map2.bigvisdivpatchedmoreplanes2
/sbin/chpax -pms /usr/games/q3map2.bigvisdivpatchedmoreplanes2moresurfaceverts
/sbin/chpax -pms /usr/games/q3map2.big-vis-tjunc-ent
/sbin/chpax -pms /usr/games/q3map2.normal
/sbin/chpax -pms /usr/games/q3map2.x86
/sbin/chpax -p /usr/games/tdfsb
/sbin/chpax -p /usr/bin/timidity
/sbin/chpax -m /usr/bin/vba
/sbin/chpax -p /usr/bin/VisualBoyAdvance
/sbin/chpax -p /usr/bin/gij-4.1
/sbin/chpax -p /usr/games/neverball
/sbin/chpax -p /usr/games/neverputt
/sbin/chpax -p /usr/bin/gmplayer
/sbin/chpax -p /usr/lib/openoffice/program/*
/sbin/chpax -p /usr/bin/sweep
/sbin/chpax -p /usr/bin/muse
/sbin/chpax -p /usr/bin/ogg123
/sbin/chpax -p /usr/bin/oggenc
/sbin/chpax -p /usr/share/games/vultureseye/vultureseye
/sbin/chpax -p /usr/share/games/vulturesclaw/vulturesclaw
/sbin/chpax -rm /usr/lib/iceape/iceape-bin
/sbin/chpax -rm /usr/lib/iceweasel/firefox-bin
/sbin/chpax -r /usr/lib/xulrunner-8.0/plugin-container
/sbin/chpax -r /usr/lib/xulrunner*/plugin-container
/sbin/chpax -r /usr/bin/gtk-gnash
/sbin/chpax -pmrxs /usr/sbin/grub-setup
/sbin/chpax -pmrxs /usr/sbin/grub-probe
/sbin/chpax -pmrxs /usr/sbin/grub-mkdevicemap
/sbin/chpax -m /usr/bin/xlock
/sbin/chpax -m /usr/bin/xlockmore
/sbin/chpax -m /usr/bin/galeon
/sbin/chpax -m /home/r00t/stuff/gtkradiant/NetRadiant/install//radiant.x86
/sbin/chpax -psr /home/r00t/tor-browser_en-US/App/Firefox/firefox
/sbin/chpax -psr /home/r00t/tor-browser_en-US/App/Firefox/firefox-bin
/sbin/chpax -psr /home/r00t/newtor-browser_en-US/tor-browser_en-US/Browser/firefox
/sbin/chpax -spEmrx /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java
/sbin/chpax -m /usr/lib32/wine-unstable/wine-preloader
/sbin/chpax -pemrxs /usr/bin/grub-script-check
/sbin/chpax -ps /usr/bin/wireshark
/bin/echo "Freeing GCC from PAX shackles"
/sbin/chpax -pemrxs /usr/bin/make
/sbin/chpax -pemrxs /usr/bin/g++
/sbin/chpax -pemrxs /usr/bin/g++-4.1
/sbin/chpax -pemrxs /usr/bin/g++-4.4
/sbin/chpax -pemrxs /usr/bin/g++-4.4.4
/sbin/chpax -pemrxs /usr/bin/g++-4.6
/sbin/chpax -pemrxs /usr/bin/gcc
/sbin/chpax -pemrxs /usr/bin/gcc-3.4
/sbin/chpax -pemrxs /usr/bin/gcc-4.1
/sbin/chpax -pemrxs /usr/bin/gcc-4.4
/sbin/chpax -pemrxs /usr/bin/gcc-4.4.4
/sbin/chpax -pemrxs /usr/bin/gcc-4.6
/sbin/chpax -pemrxs /usr/lib/gcc/*/*/cc1
/sbin/chpax -pemrxs /usr/lib/gcc/*/*/cc1plus
/sbin/chpax -pemrxs /usr/lib/gcc/*/*/collect2
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/3.4.6/cc1
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/4.1.2/cc1
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/4.4/cc1
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/4.4.4/cc1
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/3.4.6/cc1plus
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/4.1.2/cc1plus
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/4.4/cc1plus
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/4.4.4/cc1plus
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/3.4.6/collect2
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/4.1.2/collect2
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/4.4/collect2
/sbin/chpax -pemrxs /usr/lib/gcc/i486-linux-gnu/4.4.4/collect2
/sbin/chpax -pemrxs /usr/local/bin/ld
/sbin/chpax -pemrxs /usr/bin/ld
/sbin/chpax -pemrxs /usr/bin/ld86
/sbin/chpax -pemrxs /usr/bin/ldrdf
/sbin/chpax -pemrxs /usr/bin/ldd
/sbin/chpax -pemrxs /usr/bin/lddlibc4
/sbin/chpax -pemrxs /usr/bin/gdb
/bin/echo "Finished Freeing GCC from PAX shackles"
/bin/echo "Finished Stupf-client script"