How to use port on Client / Server
When does Windows 2000 / XP / 2003 use port 445, and when does it use 139?
For a simple explanation I use the two terms "client" to refer Computer to access network resources such as drives and shared files, followed by "server" Computer with available resources shared by the Client. . And to make it easier to visualize, remember the phrase NetBIOS over TCP / IP, simply NetBT.
If the client has NetBT enabled, it will always try to connect to the server at both port 139 and 445 simultaneously. If it receives a response from port 445, it sends a RST response to port 139, and continues the SMB communication session with only port 445. If it does not receive a response from port 445, it will continue to communicate SMB. only with port 139, if you get feedback from this port. If no response is received from the above ports, the connection intended to initialize will end (failed).
If the client has NetBT disabled, it will always connect to the server at port 445. If the server answers on port 445, the connection will be established and maintained on this port. If no response is received the connection ends. This is the case we mentioned when the server runs old operating systems such as Windows NT 4.0, for example.
If the server has NetBT enabled, it will listen on UDP ports 137, 138, and on TCP ports 139, 445. If NetBT is disabled, the server only listens on TCP port 445.
Ho Viet Ha - Owner Network Information Security Vietnam, Inc.
http://nis.com.vn
Email: networksecurity@Nis.com.vn