|
|||||||||||
|
Re: Red Hat 9: free tickets
From: Stephen Samuel <samuel(at)bcgreen.com>
Date: Sun Jul 06 2003 - 15:30:34 EDT ln -s /var/run/sudo/mylogin/0:root /tmp/likely_tmp_name Then you wait for or cause some setuid progrem to attempt to (insecurely) write to /tmp/likely_tmp_name . When that happens, /var/run/sudo/mylogin/0:root is created, and pam_timestamp_check now allows you to run any helper application as if you'd typed in the root password... Since these helper applicaitons tend to allow all sorts of nasty work (like creating a uid=0 user), you've now got a *serious* security violation on your hands. The face that /var/run/sudo is rwx root only is no protection because the open is doen by an suid-root program, and the symlink in /tmp can be created by anybody.
as youreslf:
as root:
as yourself: open the system-settings/users&groups utility from the desktop menu. You can now create an account with uid=0 Now ANY exploit that can cause a setuid/root program to create an arbitrary file (regardless of content) can be used to create an arbitrary root user. Finding such an exploit is left as an exercise for the user.
Carlos Villegas wrote:
Possible solution:
Something like:
tty=`tty`
date=`date +%s` echo $userinfo $date `{ echo $userinfo $date ; cat /etc/ssh/ssh_host_rsa_key ; } | md5sum` > /var/run/sudo/$userinfo would create a reasonably high barrier to entry for any hacker trying to exploit this bug. It's also reasonably easy to verify: datestamp=`awk '{ printf "%s", $2}' /var/run/sudo/$userinfo` echo $userinfo $datestamp `{ echo $userinfo $datestamp ; cat /etc/ssh/ssh_host_rsa_key ; } | md5sum ` | diff - /var/run/sudo/$userinfo You'd also want to compare $datestamp to the modtime on /var/run/sudo/$userinfo to make sure that they were within a couple of seconds of each other (to frustrate replay attacks) -- Stephen Samuel +1(604)876-0426 samuel@bcgreen.com http://www.bcgreen.com/~samuel/ Powerful committed communication. Transformation touching the jewel within each person and bring it to life.Received on Tue Jul 8 19:15:50 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:40 EDT |
||||||||||
|
|||||||||||