On last.fm: Check Out Mark Ronson's Music

Disable NetBIOS and SMB to protect public Web servers

Tags: TCP/IP, Web servers, Servers, NETWORKING, small and medium business, Michael Mullins CCNA, MCP, NetBIOS, server, server message block, Web server, TCP, network, Security Solutions Newsletter

  • Save
  • Print
  • Digg This
  • 14

Takeaway: As the connection between your internal network and the rest of the world, public Web servers always deserve an extra measure of protection. In this edition of Security Solutions, Mike Mullins tells you one way to lock down these servers.

Serving data to users outside of an internal network, public Web servers are typically the first point of contact for an external attack. In addition, internal networking ports are the most revealing and most often attacked ports on a server. That's why you need to make sure you've disabled the services that are specifically for intranets.

The two biggest culprits that you need to worry about are the Server Message Block (SMB) protocol and NetBIOS over TCP/IP. Both services can reveal a wealth of security information and are reoccurring vectors for hacks and attacks. They're unnecessary for the operation of a public Web server, and you should take steps to shut down both services on these servers.

Disable NetBIOS

NetBIOS was once a useful protocol developed for nonroutable LANs. In this case, it acts as a session-layer protocol transported over TCP/IP to provide name resolution to a computer and shared folders. NetBIOS uses these ports:

  • UDP 137: NetBIOS name service
  • UDP 138: NetBIOS datagram service
  • TCP 139: NetBIOS session service

Since external users—or hackers—don't need access to shared internal folders, you should turn off this protocol. To disable NetBIOS over TCP/IP, follow these steps:

  1. Got to Start | Control Panel, and double-click the System applet.
  2. On the Hardware tab, click the Device Manager button.
  3. Select Show Hidden Devices from the View menu.
  4. Expand Non-Plug And Play Drivers.
  5. Right-click NetBios Over Tcpip, and select Disable.
  6. Close all dialog boxes and applets.

This disables the Nbt.sys driver, which stops NetBIOS from listening to or initiating sessions over TCP 139. While SMB normally uses this port for communication, it will now switch to TCP 445—also known as the Common Internet File System (CIFS) port. That's why you need to disable SMB next.

Uninstall SMB

SMB uses TCP 139 or TCP 445—depending on which port is available. There's one way to disable SMB on a non-domain controller. However, I recommend completely uninstalling this service to prevent some well-meaning individual (or program) from re-enabling the service.

To uninstall SMB, follow these steps:

  1. Go to Start | Control Panel, and double-click the Network Connections applet.
  2. Right-click Local Area Connection (i.e., the Internet-facing connection), and select Properties.
  3. Select Client For Microsoft Networks, and click the Uninstall button.
  4. After the uninstall finishes, select File And Printer Sharing For Microsoft Networks, and click the Uninstall button.
  5. Close all dialog boxes and applets.

Understand the ramifications

You've now disabled both SMB and NetBIOS. If an attacker manages to compromise your Web server, he or she won't be able to use NetBIOS or SMB to further explore and exploit your network.

Of course, security measures are often a balancing act of functionality and security. In this case, disabling these services takes away your ability to remotely manage Web servers through Active Directory's Computer Management console. However, you can still connect to and manage these servers through the Remote Desktop Client.

Final thoughts

While it's a common practice to block these ports at security boundaries, nothing beats disabling them on the machines themselves. Remember, as the connection between your internal network and the rest of the world, Web servers always deserve an extra measure of protection.

Miss a column?

Check out the Security Solutions Archive, and catch up on the most recent editions of Mike Mullins' column.

Worried about security issues? Who isn't? Automatically sign up for our free Security Solutions newsletter, delivered each Friday, and get hands-on advice for locking down your systems.

Mike Mullins has served as an assistant network administrator and a network security administrator for the U.S. Secret Service and the Defense Information Systems Agency. He is currently the director of operations for the Southern Theater Network Operations and Security Center.

  • Save
  • Print
  • Digg This
  • 14

Print/View all Posts Comments on this article

Why? Afraid of Linux users?dawgit  | 04/28/06
telnet alive, but not wellj-jireh  | 04/28/06
Why would one be?Tony K  | 04/28/06
Hmmm, might be coming from a different point of viewmaldain  | 05/08/06
A better option than disabling NetBios & smbJaqui  | 04/28/06
Question?rickk@...  | 04/28/06
Canada is a minor us state I'm afraidql.sinclair  | 05/08/06
Now....dawgit  | 05/08/06
BBQX-Factor  | 05/08/06
A fountain of mis-informationTheChemist  | 09/18/06
No-one Is So Stupid As To...dotxen  | 05/08/06
Not so fast...dawgit  | 05/08/06
ActuallyTony K  | 05/08/06
Want fries with that?djini  | 05/08/06
Which is one of the problemsTank252ca  | 05/08/06
Re: Which is one of the problems?djini  | 05/08/06
No, that's not the problem...Tony K  | 05/08/06
Dittorickk@...  | 05/08/06
you're rightdawgit  | 05/08/06
Actually, we only went to ...Too Old For IT  | 05/08/06
now that soundsdawgit  | 05/08/06
Anonymous FTPfshahzad@...  | 05/08/06
? That doesn't sound gooddawgit  | 05/08/06
re: ?That doen't sound goodfshahzad@...  | 05/08/06
Thanks (????)dawgit  | 05/08/06
Why would you want to do that anyway?alan.campbell@...  | 05/08/06
BecauseTony K  | 05/08/06
Bone Headdmowers@...  | 05/08/06
Exchange, Corporate Web Apps Etcjonf@...  | 05/08/06
Get a REAL job???dawgit  | 05/08/06
Functionality and security, indeedschwana  | 05/08/06
Doesn't Workdavids@...  | 05/08/06
AssumptionsKiltie  | 05/09/06
Of course we assumeTony K  | 05/09/06
Not a home userVBJackson  | 05/12/06
You are living in 1998!!fshahzad@...  | 05/09/06
In support of Cliff here...dawgit  | 05/09/06
20%?Tony K  | 05/09/06
Exactly Where ?:|dawgit  | 05/09/06

What do you think?

Article Categories

Security
Security Solutions, IT Locksmith
Networking and Communications
E-mail Administration NetNote, Cisco Routers and Switches
CIO and IT Management
Project Management, CIO Issues, Strategies that Scale
Desktops, Laptops & OS
Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
Data Management
Oracle, SQL Server
Servers
Windows NT, Linux NetNote, Windows Server 2003
Career Development
Geek Trivia
Software/Web Development
Web Development Zone, Visual Basic, .NET
advertisement
Click Here