How do I see which ports are open? [duplicate]


To list open ports use the netstat command.

For example:

$ sudo netstat -tulpn | grep LISTEN tcp 0 0* LISTEN 5452/dnsmasq tcp 0 0* LISTEN 1037/cupsd tcp6 0 0 ::1:631 :::* LISTEN 1037/cupsd

In the above example three services are bound to the loopback address.

IPv4 services bound to the loopback address "" are only available on the local machine. The equivalent loopback address for IPv6 is "::1". The IPv4 address "" means "any IP address", which would mean that other machines could potentially connect to any of the locally configured network interfaces on the specific port.

Another method is to use the lsof command:

$ sudo lsof -nP -i | grep LISTEN cupsd 1037 root 9u IPv6 11276 0t0 TCP [::1]:631 (LISTEN) cupsd 1037 root 10u IPv4 11277 0t0 TCP (LISTEN) dnsmasq 5452 nobody 5u IPv4...
0 0

This question already has an answer here:

I have a port scanner script that scans ports and tells you if they are open or closed. Is there a way I can see the IP addresses that the ports are communicating with? The script:

from threading import Thread import socket host = str(input('host > ')) from_port = int(input('start scan from port > ')) to_port = int(input('finish scan to port > ')) counting_open = [] counting_close = [] threads = [] def scan(port): s = socket.socket() result = s.connect_ex((str(host),port)) print(('checking ports > '+(str(port)))) if result == 0: counting_open.append(port) print((str(port))+' -> is open') peer = s.getpeername() print(peer) s.close() else: counting_close.append(port) #print((str(port))+' -> is closed') s.close() for i in range(from_port, to_port+1): t = Thread(target=scan, args=(i,)) threads.append(t) t.start() [x.join() for x in threads] print(counting_open)

EDIT: Just to be...

0 0



Last Updated August 02, 2017 17:01 PM

How do I see which processes have open TCP/IP ports in Mac OS X?

Answers 5

This should be possible in a terminal window using the Netstat command.

And if you like the GUI way more:

With Mac OS X 10.5, the /Applications/Utilities folder contains a network utility called: Network Utility, see tab Netstat for these stats presented in a gui application, along with Ping, Lookup, Traceroute, Whois, Finger and Port Scan.

February 18, 2010 09:54 AM

One alternative is the use of the lsof utility; specifically, lsof -i 4tcp will list all processes with some sort of TCP IPv4 network sockets open. The manpage of lsof will provide you with detailed information on how to use the utility and how to interpret the output.

February 18, 2010 11:00 AM

The following code example lists all running TCP servers on your local OSX machine:

netstat -a...
0 0

A TCP connection is uniquely identified by two(IP address, TCP port)tuples (one for each endpoint). So by definition, one can'tmovea port or IP address of a connection but just open a different one.

If the server binds to port 28081 all accepted connections will have this port on the server side (although they most likely will have varying port numbers on the client side).

For example, if two processes from the same client machine will connect to the same server, theIP addressandTCP porton the server side will be the same for both connections. On the client side however, they will have two different port numbers allowing the operating system on both sides to uniquely identify which process and file descriptor the received TCP packets should be assigned to.

Yes, it stays on that port, though some protocols (FTP) might open a second connection on another port. Dont think of a port as a physical path or plug, like a USB port that can only have one thing...

0 0
Originally posted by SETI_CruncherXy

@2 June 2003 - 21:23

IP Portnumber Application
389 : TCP MSN NetMeeting
522 : TCP MSN NetMeeting
1024 : UDP MSN NetMeeting (ports 1024 - 65535)
1503 : TCP MSN NetMeeting (ports 1503 - 1564)
1720 : TCP MSN NetMeeting
1731 : TCP MSN NetMeeting
1838 : TCP MSN Messenger (Gamevoice)
1863 : TCP/UDP MSN Messenger
2300 : TCP MSN Gaming Zone DX (ports 2300-2400)
2880 : TCP MSN Gaming Zone (ports 2880-29000). Caution: all ports open will become a security problem!
5190 : UDP MSN Messenger
6667 : TCP MSN Gaming Zone
6890 : TCP MSN Messenger Filetransfer (ports 6891 - 6900)
6901 : TCP/UDP MSN Messenger (Voice Telephony)
47624 : TCP MSN Gaming Zone DX

those are the main ports used by msn

there is a small utility out there called port pro that allows you to "see" what ports are beings used at any given time in real time..

if i can remember its...

0 0

You can use the


command to quickly see all the used and listening ports on your computer. Note it is not a complete substitute for a port scanning tool. If you'd like to have your computer remotely scanned for vulnerable open ports use our

Security Scan


To see a list of listening ports, open Command Prompt and type:

C:\> netstat -ano |find /i "listening"

You can change "listening" to "established" to see what ports your computer actually communicates on at the moment.

It is very useful to also use the -o switch with the netstat command to get a list of all the owning process ID associated with each connection. You can then use those process ids (PIDs) to find out the name of the processes associated with open/listening ports in the Windows Task Manager (the "Details" tab lists process ids).

C:\> netstat -ao |find /i "listening"

To see all open, closing, established and listening ports, simply use:


0 0

This is kind of a long story, but I'll try to keep it as brief as possible; Sometime several months ago, outta the blue my GTA 5 online became very laggy. More specifically, other people see me lag all over the place, but I see everyone else just fine. For example; If a friend of mine gets in my car, and I take off, after a few seconds, he sees me come to complete stop on his screen, or just crash into a wall and stop there, while on my screen, I'm flying down a highway. I love playing GTA online, and it's very upsetting that I haven't been able to enjoy it for the better part of 6+ months due to every other player seeing me lag/teleporting/rubberbanding.

So in light of this, I contacted Rockstar support to try and resolve the issue. I went back in forth with them for 4+ weeks and made NO PROGRESS! I was told to make sure that a certain set of ports were open before playing GTA online, but I am terrible with internet/networking, and software of any kind in general, so I...

0 0

ow do I find open ports on Linux or FreeBSD Unix server?

There are different commands on both Linux and UNIX server to see what TCP/UDP ports are listening or open on your server. You can use netstat command, which prints network connections, routing tables, interface statistics, masquerade connections, and multicast memberships, etc. Another (and suggested) option is to use the lsof command, which lists open files, and ports on Linux, FreeBSD, Solaris and other Unixish systems.

netstat command to find open ports

The syntax is:
# netstat --listen
# netstat -l
Sample outputs from my Debian 8.x Linux server:

Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost:953 *:* LISTEN tcp 0 0 localhost:6010 *:* LISTEN tcp 0 0 localhost:4700 *:* LISTEN tcp 0 0 *:nfs *:* LISTEN ...
0 0

I've got a strange problem with some code I inherited from another programmer who's left the company, and need some guidance on how to even begin to solve it.

The problem is this - on a semi-regular basis, we are finding that duplicate USB virtual comm ports are being created. For example, on my PC, when I view the Ports in Device Manager, and select "View Hidden Devices", I have two entries for the same device - one on COM6, and one on COM8.

Unfortunately, we cannot reliably re-create the problem. We suspect it may happen when someone quickly disconnects and reconnects the USB cable when our software is running, but that needs to be confirmed.

As far as I can tell, the code was written assuming that no one would ever unplug a cable. I see no logic whatsoever to detect this condition after the SW is started. And it fails when you re-plug the cable - silently generating read and write errors even after the cable is plugged back in. You have to restart the...

0 0

My canned response:

When you have questions, comments, requests for update, etc on a ticket you have already open, please do not open a new ticket to do so. Opening a new ticket just bloats the ticket queue and makes it harder for us to help you.
Instead, please either

1. Reply to the last email you received from helpdesk regarding that ticket

2. Use the helpdesk portal to access your open tickets:
a. Go to
b. If prompted, login using the same username and password you use to get into your email (or, in the corporate office/culinary center/depots, the same username and password you use to login to your computer)
c. Click “Open Tickets” at the top of the page. Here you will find 2 lists. One list is open tickets that you have opened. The other is a list of open tickets that you have been CCed on.
d. Find the relevant ticket and click on it. Here you can view all the comments so far, and if you wish to...

0 0

When you open a register on your computer, it will request the next invoice number from our servers and put this aside. When a sale is completed, the computer will use this reserved invoice number.

Reciept numbers can be duplicated here when the sale is not completed on this machine and the same register is opened on a different computer. This computer will also request the next invoice number from our servers and receive the same invoice number as the first computer if it is not used in a sale.

If you then complete the sale on this second computer and go back to the first machine at any time in the future, it will have saved this now duplicated invoice number.

Why does it save the next receipt number locally? It saves and reserves the receipt number like this in case Vend drops offline and it can't check in with the server to find the latest receipt sequence.

Lets look at an example situation where this duplicate can...

0 0

Love it or hate it, the Photos app is a tool Apple includes in the stock installation of macOS on every Mac. It’s a way to view and manage your photos and videos on your desktop, and the app even makes importing photos from iCloud or your iOS devices very simple.

Unfortunately, bugs and user error can sometimes leave you with photo duplicates in your Photo Library, and if you’re one to take a whole lot of photographs, then you might not even realize you have duplicates. These duplicates easily eat up valuable space on your Mac’s storage drive, so in this tutorial, we’ll be showing you how to quickly and easily examine your Photo Library for duplicate photos and remove the duplicates.

How do duplicate photos happen?

Duplicate photos can occur from a variety of reasons, whether it’s an importing bug that causes duplicates of your photos to occur without your intervention, or you simply forget you have the photos on your computer already before...

0 0

Configuring Ports and Interfaces

This chapter describes the controller’s physical ports and interfaces and provides instructions for configuring them. It contains these sections:

Overview of Ports and Interfaces

Three concepts are key to understanding how controllers connect to a wireless network: ports, interfaces, and WLANs.


A port is a physical entity that is used for connections on the controller platform. Controllers have two types of ports: distribution system ports and a service port. Figure 3-1 through Figure 3-4 show the ports available on each controller.

Note The controller in a Cisco Integrated Services Router and the controllers on the Cisco WiSM do not have external physical ports. They connect to the network through ports on the router or switch.

Figure 3-1 Ports on the Cisco 2100 Series Wireless LAN Controllers

Figure 3-2 Ports on the Cisco 4400 Series Wireless LAN Controllers


0 0

Configuring Ethernet Switch Ports

This chapter gives an overview of configuration tasks for the Gigabit Ethernet (GE) switch on the Cisco 800M Series ISR.

This chapter contains the following sections:

Configuring VLANs

A VLAN is a switched network that is logically segmented by function, project team, or application, without regard to the physical locations of the users. VLANs have the same attributes as physical LANs, but you can group end stations even if they are not physically located on the same LAN segment. Any switch port can belong to a VLAN, and unicast, broadcast, and multicast packets are forwarded and flooded only to end stations in the VLAN. Each VLAN is considered a logical network, and packets destined for stations that do not belong to the VLAN must be forwarded through a router. A VLAN is a switched network that is logically segmented by function, project team, or application, without regard to the physical locations of the...

0 0

A translation to


is available.

I've just gone through the experience of trying to configure CUPS, the Common Unix Printing System. It has proved a textbook lesson in why nontechnical people run screaming from Unix. This is all the more frustrating because the developers of CUPS have obviously tried hard to produce an accessible system — but the best intentions and effort have led to a system which despite its superficial pseudo-friendliness is so undiscoverable that it might as well have been written in ancient Sanskrit.

GUI tools and voluminous manuals are not enough. You have to think about what the actual user experiences when he or she sits down to do actual stuff, and you have to think about it from the user's point of view. The CUPS people, despite good intentions, have utterly failed at this. I'm going to anatomize this failure in detail, because there are lessons here that other open-source projects would do well to heed. The point of this essay...

0 0