what port or ports are used for File sharing in windows?

21

4

I want to know on the windows operating system, what is the port number for the file sharing service?For example as you know the port number for HTTP service is 80. So I need to know the port number of file sharing protocol?

Mohammad Reza Rezwani

Posted 2014-06-06T19:58:39.740

Reputation: 613

What file sharing service? Are you referring to SMB? First identify the protocol, then see this chart: http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

– MaQleod – 2014-06-06T20:23:07.803

3

Official article that might be of interest: Port Assignments for Commonly-Used Services

– and31415 – 2014-06-06T22:24:49.827

Answers

22

I've seen all of these..file sharing related

UDP-137, UDP-138, TCP-139,TCP-445

And possibly TCP port 135, though that may be something to do with something called "RPC". [1]

on an windows 7 machine all of those are listening. Some are related to NETBIOS so you can do start...\\compname

This site http://ntsecurity.nu/papers/port445/

If the server has NBT enabled, it listens on UDP ports 137, 138, and on TCP ports 139, 445. If it has NBT disabled, it listens on TCP port 445 only.

And this site http://www.petri.co.il/whats_port_445_in_w2k_xp_2003.htm mentions

"In Windows 2000/XP/2003, Microsoft added the possibility to run SMB directly over TCP/IP, without the extra layer of NetBT. For this they use TCP port 445. "

So in 2K,XP,2003...and I suppose Win 7,8, it is possible to run file sharing on only port 445 But you'd be doing start...\\ip rather than start..\\compname

[1] http://www.danielmiessler.com/writing/windowsfilesharing/

barlop

Posted 2014-06-06T19:58:39.740

Reputation: 18 677

1

@MaQleod http://en.wikipedia.org/wiki/Server_Message_Block SMB protocol, that page mentions those ports I listed.. and about authentication.

– barlop – 2014-06-06T20:28:12.640

It covers some of the possibilities, but not all. Windows is capable of NFS, SMB, FTP, SSH/SCP and many other file sharing protocols and authentication for these services can require more than just AD, such as LDAP or NIS. SMB/AD/Krb certainly is the most common use case, but OP never really clarified. – MaQleod – 2014-06-08T00:52:17.893

@MaQleod The term "file sharing" is pretty well known to users of windows, and doesn't mean FTP or SSH. It's an option in Windows called "File Sharing". There are a multitude of expressions associated with it, such as turn file sharing on, or enable file sharing or make sure the firewall is allowing file sharing through. Maybe SMB is an even more technical term, but "windows file sharing" or "file sharing in windows", is specific assuming they are using their terminology correctly. It doesn't look like Win7 has a built in SSH server. – barlop – 2014-06-08T01:50:21.527

@MaQleod He wasn't asking about every protocol, even non-native, that windows can possibly run, that allows sharing of files. and "file sharing" is what windows calls SMB. I'm not even sure whether/where windows calls "file sharing" SMB though indeed it is SMB. But 'file sharing' is thus a very correct term for it. – barlop – 2014-06-08T01:51:12.393

-1

If file transfer is via FTP - TCP/21, in case of SFTP - TCP/22

User M

Posted 2014-06-06T19:58:39.740

Reputation: 1

1in this case, it literally refers to "windows file sharing, aka smb/cifs – Journeyman Geek – 2018-02-24T01:09:50.590