Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I keep seeing warning signs about enabling ADB over Network when you aren't connected to a WiFi network, but what if I want to connect ADB over 3G/4G ?

Whenever I try to do it with any of the conventional WiFi methods, it returns an invalid IP to connect to. I even tried getting the IP with # ip addr show - but that didn't work, either.

Any ideas on how to do this?

The security implications are precisely what I'm trying to explore.

Yeah, it isn't safe. But how does such a vulnerability get leveraged?

share|improve this question
    
I don't think there is a way to create an adb connection to a remote device. The reason is works on wifi is that you are on the same local network as the computer that is connecting to it. If it were possible to do this over the internet the potential for abuse would be great. –  FoamyGuy Jul 16 '12 at 1:49
    
Yes, it would, but any individual person has to turn on the ADB listener-- Or else, it is automatically turned on to only listen over USB- You have to have a rooted phone to change the listener to listen over TCP/IP, so the security implications aren't that great. Like ND Geek said, I really do want to set up this back door for myself and face the consequences should anyone discover it. (Since there is not really anywhere for a rootkit to hide after a full wipe, I'm not really worried. Especially since I would only require a small window of time to allow the ADB connection. –  rm-vanda Jul 16 '12 at 19:31

2 Answers 2

up vote 5 down vote accepted

Opening ADB on an unsecured connection is a major security risk. On an unrooted phone, it gives access to your entire filesystem. On a rooted phone, it gives access to your entire filesystem with write permissions. The connection isn't encrypted and there is no password or key exchange to access ADB. It's just a bad idea. Beyond that, your carrier may not even allow traffic over 5555 (the standard ADB port), they may be proxying your traffic, or there may be other complicating factors.

Also, setting up SSH shouldn't be difficult. I use SSHDroid all the time. I can get a secure shell from any WiFi connection, and it works great for wireless file transfer. You could set up a task to turn on SSHDroid whenever the device connects to WiFi and another to send you the IP. Technically, you can even run it without WiFi, but I generally wouldn't recommend it, as it's still open to vulnerabilities, which would lead to problems similar to leaving ADB open (although somewhat less likely since SSH is designed to be secure).

Finally, there are a number of apps that are built specifically for locating your phone. Motorola includes this feature with Motoblur, which can also wipe your phone remotely. There are other free and paid alternatives that can do this as well. If your phone is actually stolen, these are going to be much better than any back door you open for yourself.

share|improve this answer
    
Well, I'm not too worried about that. But I want to know more about this security threat- I mean, changing the port away from 5555 isn't too hard, but are there really creepsters out there constantly running nmap scans on GSM networks? I mean, sure it opens my phone up to various problems, but I flash a new ROM generally every week-- I know there are still issues- but. I'm not worried about the security implications. I hear having an SSH tunnel alone can be problematic unless you have a ridiculously high level of encryption. Hackers see an SSH, and they want it. Is what I hear, anyway. –  rm-vanda Jul 16 '12 at 19:20
    
It's not that there are people constantly scanning the cell networks, it's that there is absolutely no security in place to stop the one who does, and happens to find your phone. As for SSH, you can change its port as well, and it's going to be much more secure than ADB just because it's encrypted. –  ND Geek Jul 17 '12 at 15:39
    
Precisely! I understand this- And I realize you're right, I should just go with the SSH route. But, I still want the answer as how to do this via adb. And the fact that people aren't looking for ADB listeners-- IMHO- realistically is enough security. I flash new ROMs often enough, anyway. Also, since my plan is to only establish the connection for seconds at a time- It seems secure enough for my purposes. Additionally- from what I've read- it seems that malicious hackers spend more time seeking out SSH tunnels to crack than seeking out ADB listeners that aren't likely to even exist. –  rm-vanda Jul 18 '12 at 12:06

Most likely because the IP address returned was only valid within the mobile network, i.e. there is a NAT gateway. Even if you tried connecting from another device in the same network, your carrier probably have some routing rules in place to prevent devices from communicating to each other directly.

It would be neat to have a tasker profile or something where, if my phone is ever stolen, I can text my phone, making tasker enable ADB listening, and reply with whichever IP address my phone is connected to, and perhaps turn off after X seconds

Unsurprisingly, that idea wasn't new, there are many stolen/lost phone app in the Play Market. Prey and Plan B/Lookout, Where's My Droid, etc. Use those instead of trying to bend Tasker for it.

share|improve this answer
    
There is one that uses ADB to display a screen shot. But I really wanted to do it an out-of-the-ordinary way. I suppose making any of those apps a /system/app would really do the sort of trick I want it to. –  rm-vanda Jul 16 '12 at 19:23
    
But good point about the NAT gateway. I really wonder, though. With all the warnings--- how is it actually possible? –  rm-vanda Jul 16 '12 at 19:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.