NetBIOS and SMB-Based Vulnerabilities
NBT is the default network protocol in most built-in Windows NT network functions. This protocol consists of both the NetBIOS (the upper half) and the TCP/IP protocols (the lower half). NetBIOS serves as an abstraction layer in this arrangement. The NetBIOS protocol is used to communicate a considerable amount of information about the status of machines within the network, in particular the nature of processes and sessions running at this layer. Accordingly, this protocol can allow users and processes to query NetBIOS for information helpful in attacking Windows NT hosts and domains. Users with access to a Windows command line can, for example, initiate a node status query to discover information about other machines on the network. The data in the following example shows a data dump from a packet analyzer on a network in which an external user initiated a "wildcard query" (using the nbtstat -a command). Note that this query contains a string of 30 zeros followed by 2 zeros, the format used in NetBIOS names. The external user (possibly an attacker) is requesting that the target host dump its NetBIOS name table, a very dangerous request indeed.
"Flags""Frame", "Delta Time", "Destination", "Source", "Protocol", "Summary" "M", 1, 0, " [90.128.192.131] ","[141.192.128.233] ","DNS","C ID=15 OP=QUERY NAME=*<00000000000000000000000000000000><00>" " ", 2, 1., 5121, "[90.128.192.131] ","[141.192.128.233] ","DNS","C ID=16 OP=QUERY NAME=*<00000000000000000000000000000000><00>" " ", 3, 1., 5108, "[90.128.192.131] ","[141.192.128.233] ","DNS","C ID=17 OP=QUERY NAME=*<00000000000000000000000000000000><00>"
In addition, certain commands can allow unauthorized persons to attempt access to administrative shares (default shares set up for the convenience of administrators who must remotely access the systems they administer). Attackers must, however, guess the password of one administrator to successfully do so.
Protocol Analysis in Windows NT Networking
Monitoring network traffic in the Windows NT network environment is extremely important, both in troubleshooting and in discovering possible network-based attacks. You can, for example, use a packet-capture device to determine whether users have initiated NetBIOS status queries (as previously shown in Figure 3.9). Windows NT has a built-in packet-capture program, the Network Monitor (NM), that comes in two varieties. The simpler version comes with NT Server; it captures only the packets bound for the particular machine on which NM is installed. To install this version, open the Network Control Panel. Click on the Services tab at the top. Click Add. Scroll through the names of services that appear until you reach Network Monitor Tools and Agent, RefSeOK. There is also a Network Monitor Agent service. It is used by the Systems Management Server (SMS) version of Network Monitor to remotely capture data. Because of risks due to the potential for unauthorized access, it should not be installed unless there is a particular reason. Now reboot the server. Once NM is running, you need to go from Start to Programs to Administrative Tools to Network Monitor to see this output.
Another, more powerful version of NM comes with Microsoft's (SMS), a system administration tool that you can purchase. The SMS version can connect to remote computers running the Network Monitor Agent and capture data from there. This latter version is more useful for system administration purposes because it allows packet capture for a potentially wide range of hosts. It also unfortunately poses even greater possible security-related hazards because it allows anyone who obtains unauthorized access to it to view network traffic for potentially many machines on the network. Installing this version is more or less parallel to installing the simpler version except for several steps. You must, for example, find the right path in the SMS Distribution Kit. First locate the top-level SMS directory within this kit, then go down one level to the NMEXT subdirectory, then to your platform (Alpha or i386). Now invoke SETUP.EXE (path: SMS_TOP_DIRECTORY\NMEXT\I386\SETUP.EXE. Next start the Network Monitor Agent by clicking on Network, Services, Network Monitor Agent, Start, OK. Now reboot the SMS server. After installation, you can find Network Monitor Tools in Network Analysis Tools and the Network Monitor Agent in your system's Control Panel. You must also install the Network Monitor Agent on all computers for which you want to obtain packet dumps. You must then start the capture capability for each of these computers from Network Monitor's Capture menu. Finding the specific capture file for each computer may not be trivial. Choose the Find All Names option from the Capture menu to set the computer name that goes with each particular IP and MAC address. To read the logs for the first time, you may also have to experiment a bit by selecting a variety of different names from the Capture menu until you discover the particular log for each system that runs the Network Monitor Agent.
Regardless of which version of NM you choose to run, several critical security considerations apply. Having NM packet dumps fall into the wrong hands enables a perpetrator to potentially obtain passwords (some or all of which may be clear text) and data transmitted across the network. Clear text passwords traversing any network pose a high level of security risk because anyone who captures them can use them to illegally log on to systems. You should, therefore, ensure that permissions on your SMS console allow access of any kind only to SMS administrators.
Note that you need to do more than just run a program or suite of programs to capture network traffic. Remember, too, that NM is only one of many available options for dumping packets. Other alternatives include NetXRay by Network General, Surveyer by Shomiti, LANDecoder by Triticom, Observer by Network Instruments, EtherPeek by AG Group, and many others.
NetBIOS Solutions
Although piecemeal solutions that control against certain types of unauthorized access exist, no effective, comprehensive solutions for controlling NetBIOS vulnerabilities currently exist. Consider one solution—disabling the bindings between the TCP/IP and NetBIOS layers of networking. To disable these bindings, bring up the Control Panel, double-click on Network, and then click on the Bindings tab. The screen shown in Figure 3.9 displays. To disable NetBIOS over TCP/IP, click the plus sign next to NetBIOS Interface, select WINS Client (TCP/IP), and then click the Disable button. This effectively eliminates the possibility of a long-range attack that exploits weaknesses in NetBIOS, but again at a cost. Disabling these bindings interferes with services such as share access in wide area networking because the NetBIOS protocol (which is not a particularly good wide area protocol) depends on the underlying TCP and IP layers (both of which are well suited for wide area transmissions) in wide area networking.
Consider a second solution, the Policy Editor, a tool in the Windows NT 4.0 Resource Kit that disables all Administrative Shares.
Consider yet another solution: disabling the administrative shares.12 To disable these shares on a server, set the following Registry value:
Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\LanmanServer\Parameters
Value: AutoShareServer
Type: REG_DWORD
Data: 1 (default) to create these shares, 0 to disable them.
On workstations, the procedure is the same, but the eegistry value is named AutoShareWks instead.
Disabling these shares, however, is in general not advisable because doing so is likely to cause severe disruption or at least inconvenience in system administration activities. Several commercial backup utilities, for example, require remote access to systems via Administrative Shares as they back-up systems. In short, no genuinely suitable solutions for most environments currently exist. Until Microsoft discontinues basing its implementation of Windows NT networking on the NetBIOS API (something that Windows 2000 does), security-related concerns with NetBIOS-related vulnerabilities will continue to be a source of worry.
Problems with SMB/CIFS
Microsoft calls its implementation of SMB the Common Internet File System. The following are some of the most serious types of SMB/CIFS related vulnerabilities and the ways these vulnerabilities could be exploited:
-
A perpetrator may repeatedly attempt to gain access to a share even though denied access—the perpetrator may get share access anyway! Flooding a server with share requests can cause it to become so overloaded that it fails to process some of them normally.
-
An attacker may break out of the share constraints that exist to gain access to the whole volume, even though the share attaches to a lower point than the root of the volume. This attack, commonly called a "dotdot" attack, requires that the perpetrator repeatedly use the command line (to enter cd.., then cd.., and so forth, repeatedly) after a TID connect is in place to gain access to a higher point in the file system than the TID specifies. SMB/CIFS-based connection mechanisms may ignore the TID if users repeatedly attempt to gain access to another point in the file system.
-
Someone may exploit differences in naming conventions among compatible operating systems to attempt to gain access to files for which access is not allowed.13 The trick here is initiating an SMB degradation attack in which the client is an older release of Windows or runs a malicious routine that convinces the server that the client understands only a very primitive SMB dialect. The server assumes that the client understands only the 8.3 file naming convention. An attacker must now own one or more file(s) within the same directory or subdirectory that holds a file to which the attacker desires unauthorized access. The attacker may be able to use a command line to access a file that begins with the same 8 characters and has the last 3 character extension as the file to which the attacker has access, even though the file to which the attacker has access and the target file do not have the same name when the extended (256-character5 character) naming convention is used. For example, the target file's name could be MARKETING.XCL and the file owned by the attacker could be MARKETINXXX.XCL. The particular file that the attacker tor access is now a matter of chance; the attacker may now be considered the owner of the target file because of confusion over the naming convention used!
-
A perpetrator can replay the SMB/CIFS connection creation sequence from a bogus client. If the attacker can do this soon after this sequence is captured through use of a packet-capture device or program, the target server may not be able to detect whether this sequence is from a legitimate client.14
-
Someone may forge SMB/CIFS request packets. The server will create a TCP session because it does not check the identity of the client.
-
An attacker may gain access to shares that currently exist or that have existed recently (even though the share is to another user ID). The relatively primitive conventions involved in CIFS-based networking allow someone to break in to an existing connection and take it over.
-
Someone can access resources as an anonymous user through a null session, as exemplified by the mechanisms used by a program called Red Button. Red Button sets up a null session to a designated host, and then exploits the fact that the anonymous user is by default a member of the Everyone group on the target host to read certain key values from the Registry on that machine.
-
Someone can send an incorrect IP address but correct computer name to allow rogue hosts to access resources on CIFS servers. Remember, these servers do not check the IP address of clients before creating a session for the client.
-
A malicious user may attempt to abuse weaknesses in the CIFS implementation of the SMB protocol to cause denial-of-service. A fairly recent vulnerability of this type results from the way Windows NT Server 4.0 processes SMB logon requests. A perpetrator who does not even have an account on a target system can send an authentication request with SMB packets that contain illegal values. The victim host that receives these packets processes the authentication request anyway, but the illegal data corrupt memory in the kernel. One of two errors typically results:
STOP 0x0000000A
or
STOP 0x00000050
The server now will either reboot or hang displaying the notorious Blue Screen of Death. Microsoft has developed and distributed a patch for this bug; the patch is incorporated into Service Pack 4 (but not 3). This vulnerability illustrates only one of a wide range of vulnerabilities of this nature.
How Serious Are SMB Vulnerabilities?
At the time this chapter is being written, the exposures resulting from Windows NT's implementation of SMB in many respects constitute the most serious type of Windows NT security-related vulnerability. The basic problem is that many Windows NT network mechanisms and protocols incorporate too many legacy negotiation and connection methods. The fact that the client for the most part drives the level of security in SMB connectivity is also a serious concern. The resulting exposures potentially allow unauthorized users to remotely obtain copies of critical objects, including the SAM database, proprietary applications, business-critical data, and the like, stored on any Windows NT Server. The sheer potential for denial-of-service is, however, probably the most serious concern in many operational environments.
Chapters 6 and 7 discuss solutions for SMB- and NetBIOS-based vulnerabilities. Many of these solutions involve adopting fundamental network security measures.
Future Solutions
The next release of Windows NT (Windows 2000) incorporates Kerberos, a powerful tool that controls against unauthorized access through use of encryption. Kerberos in and of itself may, however, not solve the entire threat of unauthorized file access using SMB-based exploitation methods because Kerberos does not provide protection at the level of underlying protocols. Chapter 10, "Workstation Security," explores this and related topics in greater detail.
-
When Windows NT boots, it automatically creates certain "administrative" shares. These are so named because they are only available to administrators and are used for administrative purposes. Administrative shares are created for the %systemroot% directory, as well as for all hard drives.
-
A Solution for this problem is to disable 8.3 naming by making a Registry change described in Chapter 6.