Tuesday, June 5, 2018

security - List of open ports on Android


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?



Answer



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?


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...