0

Basically I need to say Server1, with ipaddress 1.2.3.4 has Application1 on it, and that network traffic uses ports 100, 101, and 103

Since many of these servers were built and setup before I started working here and there is no documentation from previous admins, I was hoping there might be a tool that could show me that information.

Thanks

Update for those asking: Both windows and linux OS's virtual and physical hardware.

13
  • 1
    For one we're going to need to know your operating system, however in short the tool you need is netstat the syntax varies from os to os.
    – Oneiroi
    Mar 26, 2013 at 14:16
  • Lansweeper comes to mind, but yeah OS, along with how many servers would help. 10 servers = pretty simple, 1000 = might require a lot more resources and expensive software
    – TheCleaner
    Mar 26, 2013 at 14:18
  • 1
    This is more complicated than you think. Some services might be active only for a short period of time (e.g. backup) or only in certain cases (e.g. error recovery/failover or whatever). I would capture the IP address and port number by sniffing the network for a day or a week and work up from here. And even that is a incomplete solution.
    – BatchyX
    Mar 26, 2013 at 14:19
  • I totally agree but I have to start somewhere.
    – MoSiAc
    Mar 26, 2013 at 14:25
  • @MoSiAc After reading your comment to my answer, you need to start by having the requester clarify and essentially completely rework their request. A new firewall is not concerned with every service and port used on every server, it is concerned with what services and ports you allow into and out of the network. I'd smack someone on the back of the head for st00pid if I got this request because of a new firewall install. Mar 26, 2013 at 14:44

6 Answers 6

2

I think most port scanners would do what you want. A popular one is nmap.

Nmap ("Network Mapper") is a free and open source (license) utility for network discovery and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, but works fine against single hosts. Nmap runs on all major computer operating systems, and official binary packages are available for Linux, Windows, and Mac OS X. In addition to the classic command-line Nmap executable, the Nmap suite includes an advanced GUI and results viewer (Zenmap), a flexible data transfer, redirection, and debugging tool (Ncat), a utility for comparing scan results (Ndiff), and a packet generation and response analysis tool (Nping).

1
  • This will only show whatever is not blocked by a firewall/IPS/etc. Also, it will not show what service has the port open - at best it will identify the service by signature.
    – Chris S
    Mar 26, 2013 at 15:07
2

I'd laugh and say "no," in all probability. As mentioned in the comments, nmap/netstat and port scanning isn't a complete solution, since a lot of these services are only active under certain circumstances or during certain times.

The only reliable way I can think of doing this is by checking the firewall rules on each server to see what ports are opened, and correlating those openings to a service. Of course, even this isn't a complete solution - it relies on the servers all having firewalls turned on and the assumption that an open port is open for an existing service (and not for historical reasons or default configuration or misconfiguration, etc.).

Again, though, I'd probably reject the request - this information doesn't seem particularly useful, so I'm thinking this is probably coming form someone non-technical who really needs/wants different information, but is asking for this in an incorrect or misguided fashion.

EDIT:

In response to the information that this is for a new firewall, you need to get the requester to rework their request. A new firewall is not generally concerned with every service and port used on every server, it is concerned with what services and ports you allow into and out of the network. That's probably what they really want you find out, and is a far easier task than the question as asked.

5
  • I would agree with you but this is supposed to be for their new firewall so I'm not sure why they just aren't doing this themselves since it's networking. I don't mind helping but I don't have all the information that they want either.
    – MoSiAc
    Mar 26, 2013 at 14:34
  • @MoSiAc Well, see, already it sounds like they're asking for information they don't need or want. Are connections from the SQL server to some front-end app server going to go through the firewall? What about RDP? You probably want to be able to RDP to internal servers, but do they want to allow that through the firewall? Probably not. So they're not even asking for the right thing. You need to get them to clarify their request/requirements, or you're just going to end up wasting a lot of people's time gathering unnecessary (and potentially dangerous) information. Mar 26, 2013 at 14:40
  • After reading all the comments, I'd be tempted to install the firewall, close all the ports, and handle every request for a fix through a trouble ticket. (Of course, you'd want to be careful how you present that solution to the enterprise.) Mar 28, 2013 at 14:28
  • @MikeSherrill'Catcall' The problem with suggesting that kind of... "solution" is that there's a chance they'll agree to it, and you become the proud owner of 180 incidents, 34 problems and a dozen "production down" emergencies. Mar 28, 2013 at 14:32
  • @HopelessN00b: I wouldn't recommend moving a production process to a new server without testing it first. But your point is well-taken; you have to balance the risk of opening a lot of ports that are no longer used against the time and trouble of accurate documentation and testing. (Trouble tickets = documentation. Not my favorite form of documentation, but documentation nevertheless.) Mar 28, 2013 at 14:36
1

In Windows you can run "netstat -a -n -o" to list all listening ports in numerical form and match those ports to processes.

1
  • netstat also exist on Unix
    – miniBill
    Feb 11, 2014 at 18:19
1

A combination of nmap from the same network (no firewalls in between) and local checks (as the answer by jeoqwerty or lsof/netstat/others on Unix/Linux), check what services are being started, check what is installed.

Look at the ports open on the local firewalls of the targets, check the configuration of "Internet facing" firewalls, what traffic do they let go through to your targets/leave from them. Any special configuration there is presumably to allow some specific service.

Pull all the above together, ask around if somebody can tell you what is supposed to run on the targets, check with users what they use on the machines.

Once you have a reasonably complete picture, you'll have to start questioning which of the identified services are really needed. Check that the configurations are sane, according to best practices for each. Make sure everything is up to date, antivirused if Windows, the works.

Yep, you've got work cut out for you. Good luck!

0

Another possibility would be to scan SNMP information and check out the currently active TCP/IP connections via SNMP. Of course, for windows and Linux computers, SNMP is not sufficient and maybe other protocols such as SSH or telnet need to be utilized.

Once you have all that information, you can determine which server is talking to which client/other server.

Of course, a single scan is not enough. You need to do it regularly in order to get a complete picture.

0

NetFlow was designed to do exactly what you're looking for. If properly set up you can see all of the conversations on your network and discover each service in use. There are a wide variety of products ranging from cheap to enterprise grade, closed and open source. Some of the fancier products will derive dependent services (e.g. the front-end web server depends on the database, DNS, and LDAP servers.) and alert you when there are outages or performance issues.

To use it you'll have to set up one or more collection points on your backbone (either active on your switch, router, and/or firewall or passive via a SPAN port or tap). Each collection point will feed NetFlow data to a collector.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .