Viewability of shared folders ?

B

Bob

1. Is there some way to set permissions so that shared folders are not
visible to USERS without (any) permissions to them when browsing the
network?

2. Is there some way to set permissions so that shared folders are not
visible to _anyone_ while browsing the network - i.e. you have to
know the name of the share to attempt to connect to it (a stealth
share) ?

Thanks,
 
M

Miha Pihler [MVP]

Hi Bob,

Yes. If you create a share with $ sign at the end of the name it will be a
"hidden" share.

e.g. My_Share$ would now be hidden and is only accessible if:
- user knows full path to the share (e.g. \\server\shares\My_Share$
- user has permissions to access the share

There are some well known hidden shares e.g. c$, admin$ and few others that
exist by default. You can gain access to these shares by going to

\\remote_computer_name\c$

but you also have to be local administrator to gain access to these default
shares.
 
B

Bob

Hi Bob,

Yes. If you create a share with $ sign at the end of the name it will be a
"hidden" share.

e.g. My_Share$ would now be hidden and is only accessible if:
- user knows full path to the share (e.g. \\server\shares\My_Share$
- user has permissions to access the share

There are some well known hidden shares e.g. c$, admin$ and few others that
exist by default. You can gain access to these shares by going to

\\remote_computer_name\c$

but you also have to be local administrator to gain access to these default
shares.

Thanks. That will do it for me.

Since you mentioned it, I noticed those drive$ shares on all the
drives... and if you try to remove them, you get a message "this drive
is being shared for administrative purposes and you can't remove it"
(or similar message). What is the point of them? Aren't they a big
security risk? I realize they are password protected - but a default,
known, non-removable share to a system drive a very bad thing... a
cracker program with can hit it with "administrator" and plugged
passwords until it gets in.

Is there someway to shut them off? Seems like a big hole.
 
M

Miha Pihler [MVP]

The only way you can access those drives by using administrative shares is
by knowing administrator password. So -- how is this a security risk? :) If
someone knows your administrator password then it can access your system any
way (with or without those shares)...
You can also protect the computer by using personal or dedicated firewall to
protect your trusted network from untrusted network (e.g. internet).

Yes, it is possible to remote these shares by editing registry. Still this
is not something that would be recommended since some services and e.g.
remote installations depend on these services.

E.g. if you want to install antivirus on all your computers remotely by
telling it where to install -- it will need this shares to connect to the
computer and do an installation.
 
M

Michael Bednarek

Thanks. That will do it for me.

Since you mentioned it, I noticed those drive$ shares on all the
drives... and if you try to remove them, you get a message "this drive
is being shared for administrative purposes and you can't remove it"
(or similar message). What is the point of them? Aren't they a big
security risk? I realize they are password protected - but a default,
known, non-removable share to a system drive a very bad thing... a
cracker program with can hit it with "administrator" and plugged
passwords until it gets in.

Is there someway to shut them off? Seems like a big hole.

It's only a hole for users with local administrator rights.

1) Make sure the Server service is not running - not practical on
servers, though.
2) Create DWORD AutoShareWks=0 at
HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters
and possibly as well DWORD AutoShareServer=0 at the same place.
3) Run "RMTSHARE \\machine\c$ /DEL" in the machine's startup script.
RMTSHARE.EXE is part of the NT Resource Kit; it's available at

<ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/RMTSHAR.EXE>
 
M

Miha Pihler [MVP]

You have to be aware that this will break many applications used in average
environments.

If someone can hack your administrator password -- it doesn't matter that
you removed these shares. He/She will be able to put them back (they will be
administrators and will have complete control over your computers).
 
B

Bob

It's only a hole for users with local administrator rights.

Unless I misunderstand it, it gives anyone who can hack the
administrator account full access to the boot drive via a worldwide
"known" share from anywhere on the local network - and possibly the
external network depending on firewall security - by default. That is
about as insecure as you can get and would not pass the first level of
a business security audit let alone a government security audit.
1) Make sure the Server service is not running - not practical on
servers, though.
2) Create DWORD AutoShareWks=0 at
HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters
and possibly as well DWORD AutoShareServer=0 at the same place.
3) Run "RMTSHARE \\machine\c$ /DEL" in the machine's startup script.
RMTSHARE.EXE is part of the NT Resource Kit; it's available at

<ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/RMTSHAR.EXE>

Thank you very much, I will do that.

Bob
 
S

Steven L Umbach

Sure if you use no firewall and blank passwords but extremely unlikely in a
network that takes the most basic security precautions. Event the cheapest
firewall will keep attackers from the internet from accessing your
administrative shares. To protect your internal network for the threat from
accessing administrator shares enforce password complexity and require
regular password changes which should require that passwords or pass phrases
be at least 15 characters in an environment that would need high security.
Beyond that you can further increase security by regularly reviewing audit
logs, managing the user right for access this computer from the network,
implementing the built in Windows Firewall with exceptions that reflect the
principle of least privilege, and using ipsec which is all built into the
operating system. If more security is needed use smart cards and require
that the user logon with smart cards.

Note that "hiding" a share only hides it from My Network Places and not from
command line tools. Hiding shares often gives users a false sense of
security. An attacker does not need the hidden admin shares to attack a
poorly secured computer via the network. By far a bigger threat to networks
is computers that are not physically secured, untrained employees, and
social engineering attacks. --- Steve
 
M

Miha Pihler [MVP]

Hi Steve :)

With Windows XP and default installation (Workgroup) it is actually safer to
have blank password then weak one. If you have blank password it will not
allow remote logon to any share :)
 
M

Miha Pihler [MVP]

Check my original replies to this thread... but in general all remote
installations (e.g. remote installation of antivirus), remote management,
(tolls like MBSA, .) etc will fail if you disable administrative shares...
 
B

Bob

Sure if you use no firewall and blank passwords but extremely unlikely in a
network that takes the most basic security precautions. Event the cheapest
firewall will keep attackers from the internet from accessing your
administrative shares.

Security needs to be constructed in rings. Entrance to the outer ring
should not provide a route to the inner ring. Firewalls are important,
but how many firewalls and firewall OS's have had security holes
discovered in them - including some of the best known and most popular
products ? Talk to a network security guy who is willing to be honest
and see what they say behind closed doors.

Also, most attacks are conducted by having internal users expose a
hole in a firewall from the back side. Lord knows there are enough of
those in Windows alone. As soon as that happens, there can be a big
hole in your firewall because there can be a "legitimate" request made
from inside the firewall.
To protect your internal network for the threat from
accessing administrator shares enforce password complexity and require
regular password changes which should require that passwords or pass phrases
be at least 15 characters in an environment that would need high security.

Agreed, but not unhackable. We should require physical access to a
secured location to start hacking the root drive of a secure machine -
not access across the network from any place behind the firewall.
Beyond that you can further increase security by regularly reviewing audit
logs, managing the user right for access this computer from the network,
implementing the built in Windows Firewall with exceptions that reflect the
principle of least privilege, and using ipsec which is all built into the
operating system. If more security is needed use smart cards and require
that the user logon with smart cards.

I agree with all that. But, good security is built using rings. We
build a ring, then we ask the question "OK, what if someone gets
access inside this ring?". At that point we look to have other levels
of security to protect the next ring. A worldwide known _default_
share to the root drive is about the biggest violation of ring
security I can think of.
Note that "hiding" a share only hides it from My Network Places and not from
command line tools. Hiding shares often gives users a false sense of
security. An attacker does not need the hidden admin shares to attack a
poorly secured computer via the network. By far a bigger threat to networks
is computers that are not physically secured, untrained employees, and
social engineering attacks. --- Steve

Agreed. I was thinking of removing those admin shares, not hiding
them. Hiding is just a step to keep amateurs out. Like they say "house
door locks keep honest people out". Same idea.

You are also right
about physical security - give me physical access to your machine and
you'd better have BIOS passwords... and if it's a serious security
situation, physical locks and measures that prevent me from simply
taking the hardware with me. But, providing me access to something as
important as the root drive in the default setup just seems foolish.

It seems very odd that MS has made such a show of restricting remote
admin of the web server (admittedly, a huge hole with their previously
moronic (alleged) security scheme for the web server and their
continuing tight integration of the web server with other system
facilities) while allowing this bigger hole to continue to exist.
 
B

Bob

You have to be aware that this will break many applications used in average
environments.

What applications use the driveLetter$ shares?
If someone can hack your administrator password -- it doesn't matter that
you removed these shares. He/She will be able to put them back (they will be
administrators and will have complete control over your computers).

Unless the can log on locally (physical access) or run remote
administration, I am unclear as to how they would put them back from a
remote location (?)
 
S

Steven L Umbach

It sounds like we are mostly in agreement - using defense in depth. My
point is by doing such you can greatly reduce the risk of using
administrative shares which many find useful and necessary in some cases
such as for domain controllers. Each admin/user needs to weigh the risk
versus benefit of using a feature that could be a potential security issue.
Security is all about risk management. I tend to believe that most
vulnerabilities can be mitigated effectively and that many times attacks
could be prevented if admins had taken necessary steps such as applying
patches on a timely basis and not using default settings for devices such as
default passwords for firewalls/switches and other devices and configuring
the network with the principle of least privilege being a priority and
understanding that securing a network is an ongoing activity that requires
monitoring and timely following up on vulnerabilities for anything when
found and not just waiting for the next security audit. --- Steve
 
S

Steven L Umbach

Hah! Good point Mike. Of course it might be a problem with other users
trying to logon to your computer as you at the keyboard. --- Steve
 
S

Steven L Umbach

Among other things you can not use a lot of mmc snapins like for Group
Policy to edit the GP of a network computer. I am not sure offhand but MBSA
scans of the network may also fail.

You could put the shares back a number of ways if you have SMB connectivity
to the computer such as using Computer Management /shared folders though
that would not survive a reboot, remotely accessing the registry to edit it
using regedit on your computer, or copying a .reg file to a share on the
remote computer and using the AT command to schedule it to run to edit the
registry on the remote computer. --- Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top