Is there a way, on a non-rooted Android device, to see a list of what apps are listening on what port? Or even a way to see if an app is listening on a specific port?
I was able to see which app had an open port using standard linux knowledge.
terminal emulator or do an
adb shell and execute the following:
shell@android:/ $ cat /proc/net/tcp sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode 0: 0100007F:1C23 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1001 0 2111 1 e22cc000 300 0 0 2 -1
The important stuff above is:
- 0100007F:1C23 listen IP-address:port in hex notation, here 127.0.0.1:7203
- 00000000:0000 remote address empty (listening)
- 1001 uid of the app
You can map the uid list to apps via How can I find app name by UID?
If you're using mobile data connection, you don't have to worry because you should not be able to open ports (at least I am not).
If you are connected to wi-fi, you can open ports. Then you just need a computer which is connected to same network and install nmap on it and do a port scan but first you have to find out your phones local ip (not by going to i.e. whatsmyip.com). You should be able to find your ip from your settings.
To run port scan on linux you have to just type: nmap (your phones ip).
Install OS Monitor. It will list all the open ports.