4

I've been taught that by appending a dollar sign to a share name, Windows would make it invisible to clients. And indeed, on Windows you can't see shares ending in a dollar sign; you have to type the name manually.

Browsing a list of shared folders on my Linux desktop though, I can see all shares just fine - hidden or not hidden. All shares like C$ and ADMIN$ are there together with the visible ones.

I thought Windows' SMB server simply didn't give out those names to anyone by design, how come Linux can view them?

To view the list of shares I did log in, might that have anything to do with it? Some special usergroup that enables you to view all shares?

Luc
  • 294
  • 3
  • 18
  • 2
    I think it's more that Windows SMB *clients* don't show shares ending in a dollar-sign, but Samba has no such reservations. – nickgrim Sep 10 '12 at 11:59
  • 1
    When I asked the same question a few years ago I was told this was a bug in a old windows implementation. Later it got fixed by declaring it a feature. Regardless of this anecdote, the shared are visible on the net. There are just some programs which choose not to show them. – Hennes Sep 10 '12 at 12:01
  • What Hennes said... and hidden shares are no substitute for proper permissions; I don't bother with them anymore as they're easily enumerated by any tool. – gravyface Sep 10 '12 at 12:07
  • 1
    @gravyface hidden shares are often used to keep the list of shares visible to an end user lean. Since some administrator's approaches included creating a share for each user's home directory, it did fit quite well for that particular purpose. – the-wabbit Sep 10 '12 at 12:30
  • @syneticon-dj Oh, that would explain. Many people use it for security though, so that's bad... There should be a simple option in explorer to show hidden shares (like show hidden folders), to make sysadmins realize it's not really secure (like nickgrim said, it apparently is implemented in the client only). – Luc Sep 10 '12 at 12:44

2 Answers2

6

As already stated in the comments, the dollar sign trailing the share name is just interpreted by the client so the share is removed from views. Ultimately, the share will be part of the result set of the NetShareEnum API call. You also can use the net view \\computername /all command to list all shares (including hidden ones) on from Windows Vista / Server 2008.

The kind of privileges needed might depend on the server's version and configuration. Windows Server 2003 and earlier allowed share enumeration using NULL session (so no authentication needed to be provided at all) by default. Windows Server 2008 changes this, "everybody" can enumerate all shares - which would require authentication using any valid user (including the Guest user, if enabled).

the-wabbit
  • 40,737
  • 13
  • 111
  • 174
  • As an added bonus this gets even more complicated with DFS in an environment as DFS also has the ability to do user-based folder hiding. – Brent Pabst Sep 10 '12 at 12:35
-1

http://www.samba.org/samba/docs/using_samba/ch08.html

The question is always why does Samba not do as it should. Windows will all its problems and faults, has always been consistent with this so called freature. As to why well that is a long story.

Andy
  • 1
  • Could you point to a specific part in the page you linked? I don't understand what you mean to refer to, and the document is quite large. – Luc Sep 10 '12 at 12:48
  • Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Scott Pack Sep 25 '12 at 19:35