I am planning to build an app which gives information about the network port and the service name for non-opensource based products. Is there a legal implication of building such apps? because someone can know the port on which admin services are running (although the service does authentication before accessing it).
There are absolutely no legal implications (in any country) regarding the public information of IANA (Internet Assigned Numbers Authority) and the current registry of service names & transport protocol port numbers.
From the manual;
Port numbers are assigned in various ways, based on three ranges: System Ports (0-1023), User Ports (1024-49151), and the Dynamic and/or Private Ports (49152-65535); the difference uses of these ranges is described in [RFC6335]. System Ports are assigned by IETF process for standards-track protocols, as per [RFC6335]. User Ports are assigned by IANA using the "IETF Review" process, the "IESG Approval" process, or the "Expert Review" process, as per [RFC6335]. Dynamic Ports are not assigned.