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?
-
Can you nmap from different computer? – roxan Jun 12 '12 at 03:54
-
1@roxan The problem with that is I need to know specifically what app is using a port. I've written 5 apps that all listen on the same port and somewhere somehow one of them isn't closing it and I need to know which one(s). – nick Jun 12 '12 at 16:16
5 Answers
I was able to see which app had an open port using standard linux knowledge.
Install 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?
-
Hovewer, it not list all applications. I scan my device on wifi - it has 2 open ports, but in that file there is no rows, which correspond to that ports. – Alexey Chernikov Apr 09 '14 at 12:58
Install OS Monitor. It will list all the open ports.
-
Why want the app that I allow so that it can make phone calls? Why does it want to access my gallery? – testing Jun 22 '23 at 08:54
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).

- 521
- 1
- 7
- 16

- 11
- 1
I have always used netstat since its available on almost all android versions
netstat -n
It will list unix and transport layer sockets and their states without reverse dns.

- 121
- 10