Choose the well-known port for NetBIOS Session Service in legacy SMB/CIFS.
Which port is appropriate?
NetBIOS Session Service uses TCP 139; direct-hosted modern SMB commonly uses TCP 445.
Detailed explanation
TCP 139Correct. TCP 139 is NetBIOS Session Service.
Correct. TCP 139 is NetBIOS Session Service.
UDP 123Incorrect. UDP 123 is NTP.
Incorrect. UDP 123 is NTP.
TCP 143Incorrect. TCP 143 is IMAP.
Incorrect. TCP 143 is IMAP.
UDP 162Incorrect. UDP 162 is SNMP traps.
Incorrect. UDP 162 is SNMP traps.
Try it yourself
An example you can run in a temporary verification environment.
python3 -c "import socket; print(socket.getservbyname('netbios-ssn','tcp'))"Expected result
139Key points
- NetBIOS session 139/tcp
- SMB context
- Distinguish TCP 445
Notes
- Environment: Python 3 socket service database
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.