|
Project Information
Members
|
UPDATE
WARNINGThe techniques and software provided in this project are dangerous to the well-being of your Archos if you don't know what you're doing. If you're not comfortable in a Unix/Linux environment, DO NOT USE THIS SOFTWARE. You will brick your Archos and have nobody to blame but yourself. In using these techniques and software you assume all risk and hold harmless the arcwelder project and myself for any damages real or imagined. Don't go crying to Archos either, it's not their fault. To make things even more interesting, I've haven't tested things rigorously. Scared yet? You should be! Nathan Ramella, n ar @ h u sh.com SummaryThrough a technique dubbed "Go Fighting Tabby!", or GFT for short, you can gain root access on an Archos 605 wifi running 1.7.13 firmware and execute arbitrary programs in its embedded Linux environment. This is the first step to gain access to the running Linux operating system, which until now has not been possible. Using the GFT technique, you can install the 'ARCwelder' package which will allow you to ssh into the Archos 605 wifi and run unix commands from a shell. Currently ARCwelder only provides an ssh package, however in time more packages may be included as they are tested and verified as working, some customization is necessary to ensure that they work on the embedded system, so the term 'hack' is definitely applicable. Go Fighting Tabby! Technique ExplainedThe GFT technique is pretty simple, after auditing the GPL tarball from Archos, I found a script named 'smbpasswdhelper'. smbpasswdhelper #!/bin/sh
if test $# -ne 2
then
echo "usage: $0 account password"
exit 1
fi
/opt/usr/bin/smbpasswd -x $1
/opt/usr/bin/smbpasswd -s -a $1 << EOF
$2
$2
EOFWhat got me interested was that it didn't quote $2, I figured $1 would be hard-coded to whatever the smb user is for connecting (guest maybe?), so I started poking it a bit. As it turns out, that wasn't even necessary, as I believe the avos application is doing a straight system call without sanitizing the user supplied password string. If you're at all familiar with shell commands, the prospect of an unsanitized string being used in a system() call is pretty attractive from a hacker's perspective. It means by using a little shell trickery you can launch your own command. But how do you use this script? That's the nice part, the Archos UI has provided you a text box to type in whatever you want for the 'password' under the wifi settings, after you've connected to a wifi network. You can set the password and launch an smb server, in doing so the smbpasswdhelper script is run (along with your hijack command). Even better, it runs your command as root, so you've got full privileges from the start. GFT Technique Applied
Installing ARCwelder
+ mkdir /tmp/ssh/ + mkdir /tmp/empty + chmod 755 /tmp/empty + cp /mnt/data/Data/ssh/authorized_keys /mnt/data/Data/ssh/fix /mnt/data/Data/ssh/id_archos /mnt/data/Data/ssh/id_arcwelder.pub /mnt/data/Data/ssh/sftp-server /mnt/data/Data/ssh/ssh-keysign /mnt/data/Data/ssh/ssh_banner /mnt/data/Data/ssh/ssh_config /mnt/data/Data/ssh/ssh_host_dsa_key /mnt/data/Data/ssh/ssh_host_dsa_key.pub /mnt/data/Data/ssh/ssh_host_key /mnt/data/Data/ssh/ssh_host_key.pub /mnt/data/Data/ssh/ssh_host_rsa_key /mnt/data/Data/ssh/ssh_host_rsa_key.pub /mnt/data/Data/ssh/sshd /mnt/data/Data/ssh/sshd_config /tmp/ssh/ + cd /tmp/ssh + chmod 755 authorized_keys fix id_arcwelder id_arcwelder.pub sftp-server ssh-keysign ssh_banner ssh_config ssh_host_dsa_key ssh_host_dsa_key.pub ssh_host_key ssh_host_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub sshd sshd_config + chmod 4711 ssh-keysign + chmod 600 /tmp/ssh/ssh_host_dsa_key /tmp/ssh/ssh_host_key /tmp/ssh/ssh_host_rsa_key + chmod 600 /tmp/ssh/authorized_keys + chmod 644 /tmp/ssh/id_arcwelder.pub /tmp/ssh/ssh_host_dsa_key.pub /tmp/ssh/ssh_host_key.pub /tmp/ssh/ssh_host_rsa_key.pub + /tmp/ssh/sshd -f /tmp/ssh/sshd_config Using ARCwelder
$ ssh -l root 192.168.1.120
_ _
__ _ _ __ _____ _____| | __| | ___ _ __
/ _` | '__/ __\ \ /\ / / _ \ |/ _` |/ _ \ '__|
| (_| | | | (__ \ V V / __/ | (_| | __/ |
\__,_|_| \___| \_/\_/ \___|_|\__,_|\___|_|
BusyBox v1.01 (2007.12.14-07:49+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
~ #
~ # uname -a
Linux (none) 2.6.10_mvl402 #2 Fri Dec 14 14:59:01 CET 2007 armv5tejl unknown Caveats
Want to do more?If you're interested in taking this to the next level, you'll want to download the Archos GPL tarball from their webpage. Once you have it you can create your own cross-compiling toolchain and create your own packages and potentially, even a distro if you're able to figure out how to make it boot without bricking your 605. |