remote control android, a reverse ssh tunnel

Posted May 18th, 2010 by cool

If you are so happy to own a android phone, you can log in from remote using a reverse shell making all kinds of fun possible. The android OS is not exactly Linux as we know it, but it has a Linux kernel and can be tweaked to look and feel a lot like a original Linux system.

Reasons for using a reverse shell include: you can bypass firewalls, you can connect to your phone without knowing the ip, the connection is initiated from the phone so you don't need to have a ssh server listening on your phone. Just think of all the fun this makes possible!

As the android phone has a build in shell, it's actually possible to install a console emulator from android market, giving you local shell access. Even gaining root access is really easy.

android root shell
I would not replace su, but just create another program using a name you only know yourself, making it a lot less easy for rogue apps to "use" the su command. (password protected su anybody?)

Next thing to do is install connectbot

Which is on android market. Configure port forwarding in your connectbot app:

go to the port forward options
choose "remote", source port 8081, destination localhost:22

replace source port with the port (>1024) you like to use on your pc.

Then after you configured this is you start a shell to a remote system, you have created a listening port on that remote machine. Now when you are on your PC and you ssh to localhost port 8081 ( ssh -p 8081 user@localhost) you get a shell on your android.

More info about connectbot at google code connectbot

Looking for more cool Linux stuff? blogrol is here


Won't work with Android 1.6

Anonymous 15 weeks 23 hours 36 min 10 sec ago

This only works with Android 1.5. In the 1.6 version all of the well known easy ways to root the phone have been addressed.

Jan

Now

Anonymous 15 weeks 1 day 17 hours 7 min ago

"as we now it" ????

sorry

admin 15 weeks 1 day 11 hours 43 min ago

sorry about that