• 17 Posts
  • 3.55K Comments
Joined 2 years ago
cake
Cake day: August 17th, 2023

help-circle
  • it follows that a malicious wifi modem, knowing all devices’ mac addresses, could, perhaps, feign being the phone, mac-wise. And issue its own commands, which the phone wouldn’t tell aren’t its own.

    I just tested some scenarios:

    • I start Shizuku in one wifi network (prompt to trust the network, then I had to enter the pairing code since I hadn’t used it before)
    • Then switch wifi networks
      • Shizuku was immediately disconnected
    • When I press “Start” again in Shizuku, I get prompted to trust the network
    • Then I switch back
      • Shizuku stays running
    • Then I disabled Wifi
      • Shizuku stays running
    • Then I disabled mobile data
      • Shizuku stays running
    • Then I stop Shizuku & press “Start” again
      • It asks me to enable wireless debugging, and that enables wifi

    So you’re safe as long as you don’t start Shizuku & trust the network while connected to a potentially malicious network.

    In any case, I just wish Android provided networkless self-debugging.

    I agree 100%! It’s definitely possible to add a better API that would allow Android users to trust specific apps with ADB debugging connections. Unfortunately Google is hell-bent on restricting the platform instead of opening it up :(



  • Ah, sorry, seems like I was wrong on the whole “no network connection needed”, but the reason is the explanation for your question!

    The only way for your phone to recognize/authenticate the source of an incoming ADB connection is the MAC address. Basically every device that sends/receives ethernet packets has to have a unique “fingerprint”, so everyone knows it’s still the same device if it disconnects & reconnects etc. Everything else (IP address etc.) can change at any time, so the MAC address is the only fingerprint available.

    But devices can spoof (change) their MAC address. That’s a really useful feature in many cases, e.g. phones these days use a random MAC for every new network, so a network provider can’t track you moving through multiple different networks. Also there’s no way to prevent it with our current network design. But this means that a malicious actor could wait for your trusted device to disconnect, then change their MAC to the one from your trusted device, and thus send malicious ADB commands.

    Androids solution is to make you trust both the network and the device. So as long as you don’t have malicious actors in your trusted network, you’re safe - even if you connect to a different network with malicious actors, they can’t send ADB commands.




    1. You don’t need to be connected to a network to set Shizuku up. Even while you’re not connected to an external network (through Wifi or mobile data), your phone has a “loopback” network that allows applications on your phone to talk to other applications as if they were connected through an external network. So if you’re scared of giving access to the wrong thing, just turn off wifi & data.
    2. When Android asks you to approve an external debugging connection, it’s approved for the specific device that’s connecting. Other devices on the network are not allowed to connect. If I use my computer to connect wirelessly to ADB, only my computer can execute commands, not other devices on my network (they’d show another popup).

    Hope this helps!