just to build on unSpawn's answer,
Yes due to the design of TCP/IP any connectivity can take place between any client ports to any server ports, that are in a passive open state.
However it's up to the receiving port to parse and authenticate the connection correctly.
For example: If you simply connected to a Netbios service on port 137 with something like a telnet client, Then the following would take place:
You Telnet to the NT server on port 137.
Telnetd is on the Application layer of the OSI.
The App layer talks to the Session layer to establish a connection to the Transport layer and Network layer and data-link layer.
A packet is then sent to the Server requesting a Virtual circuit to be opened, with a SYS flag and a seq id number.
The server then replies with a SYS / Ack flag and it's own seq id number, virtual circuit is now open. "a socket".
The Telnetd service is now in direct contact with the NT servers Netbios service at the Application level on the server.
You input some more text into telnet, the Netbios service receives this data and parses it. It doesn't conform to the netbios RFC, so it sends a FIN packet or RST flag depending on the nature of the request, requesting the virtual circuit to be closed. etc etc Your client responds with FIN / ack and circuit is closed.
The Telnet app show you a connection reset by peer message.
/Raz
|