Hi
I have a question, and I strongly believe people here can explain this.
When is a port considered to be closed?
a) If OS is specifically configured to block it.
b) When no service is running on the port.
Pl. put your thoughts.
Anban
Printable View
Hi
I have a question, and I strongly believe people here can explain this.
When is a port considered to be closed?
a) If OS is specifically configured to block it.
b) When no service is running on the port.
Pl. put your thoughts.
Anban
B
The end...
Not always true, TheSpecialist. What about inetd? Telnet, for example, doesn't run on port 23 until someone attempts to connect to your system on port 23. Then (assuming inetd is running) inetd checks the /etc/services file to see which port you have telnet configured on, and starts the service on that port. There isn't anything running on port 23 until someone attempts a connection on that port, right?
Perhaps I'm just splitting hairs.
Anyway, anban, to declare a port completely closed, I would turn off inetd, comment out any services you're not using in the /etc/services file on that port, and call it a day.
I think the word 'closed' is a bit poorly chosen. It's not a door that you can open and close all the time. A port just has different states. Either it is disconnected, it is listening or it is connected. That should be better definitions to use with ports, in my opinion...
If an OS is blocking a port, it is blocked, basically. The OS basically connects to it so no other form of communication can be done with it it.
And what kind of state is listening? Simple. For all communications you will need two sides to take part in it. One side that 'opens' the port and then starts to listen for incoming messages and the other side that 'links' to this open port to start the communications. As long as one side is connected to a port, it can't do much with it except listening until something makes a connection with it. You could call this 'open' because when a connection is made, the port will be closed for other processes for the duration of this communication...
Don't get too confused about definitions of words. There tend to be plenty of different definitions for these kinds of things. Just understand the logic behind it, which is more important when you need to use it.
port is considered closed when client sends a SYN and receives a FIN or a RST in response.
port is considered blocked when client sends a SYN and receives no response.
Hmmm. I suddenly realise that there might be a bit of confusion about the kind of port we're talking about here. Obviously not about those where ships get in and out. :D
But do we talk about a serial port here? Parallel port? USB port? Ir a TCP/IP port? Space port?
You can also drink port, apparantly. It's a bit disambiguous. :D But a good description of computer ports is available at http://en.wikipedia.org/wiki/Port_%28computing%29 if you're interested.
But basically, a port can be closed because the port master doesn't allow any ships to enter or leave, or a port is closed because a ship sunk in it and is blocking the entrance. (In which case you can also call it blocked.) :D It's all about traffic anyways...
Generally closed ports will send an rst/ack in response to unwanted tcp traffic, not a fin. And icmp port unreachable is sent for udp.
Blocked will generally drop the traffic or have an icmp response from the local router...something along the lines of admin prohibited..
I'm surprised, no one went into too much detail about filtered ports. :o
No one really asked about port filtering afaik.
I allways thought of filtered as what cacosapo calles blocked (when client sends a SYN and receives no response)