Simulating a hacker attack

Daniel J Walsh dwalsh at
Tue Sep 27 12:48:58 UTC 2005

Ok here is how I have simulated what you are trying to do.

cp /bin/sh /var/www/httpdsh
chcon -t httpd_exec_t /var/www/httpdsh

Add the following lines to 

domain_auto_trans(unconfined_t,httpd_exec_t, httpd_t)
allow httpd_t devpts_t:chr_file rw_file_perms;

cd /etc/selinux/targeted/src/policy/
make load
setsebool httpd_tty_comm=1

Then run
as root.

httpdsh: /root/.bashrc: Permission denied
# id
uid=0(root) gid=0(root) 
# cat /etc/shadow
cat: /etc/shadow: Permission denied
# cat /var/log/messages
cat: /var/log/messages: Permission denied


More information about the fedora-selinux-list mailing list