Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers

ArticlesDéjà Vu All Over Again


November 1997 / Features / Déjà Vu All Over Again

Windows NT security is under fire. It's not just that there are holes, but that they are holes that other OSes patched years ago.

Peter Mudge and Yobie Benjamin

Do you have a strange feeling? The feeling that you've been somewhere or done something before? It's déjà vu, and we're developing a serious case of it as we hunt down bugs in Windows NT. It's not strange that there are bugs in it. We certainly have not come across any OS or piece of software that is bug-free.

The peculiar feeling come s from the fact that the bugs we're seeing are the same security hole s that were fixed many years ago in older OSes.

Why hasn't anybody noticed until recently? The Internet is largely a network of Unix computers, so hackers aimed their sights on the thousands of Sun, Hewlett-Packard, and IBM servers on it. NT was largely ignored. Microsoft's marketing juggernaut changed that. The hacker community targeted NT security starting in the fall of 1996, and the rash of security breaches has been relentless ever since.

The shame of it is that none of these threats are new to the security world. Why does an OS only five years old (compared to Unix's 25-year history) have these problems? NT may be another example of the veracity of Santayana's statement that "those who cannot remember the past are condemned to repeat it."

Let's look at NT's security by highlighting some of the breaches, how they work, and what you can do about them.

Denial of Service Attacks

Denial of Service attacks, commonly referred to as DoS, make a machine unusable. They range from shutting services off to blue screen of death (BSOD) attacks to devoting resources to one process and thus depriving other tasks of any sort of sizable time slice. In general, DoS attacks do not require user names or passwords. Instead, they work by combining the inherent weaknesses of TCP/IP and the OS. Let's take a look at four examples: WinNuke, Domain Name System (DNS), Internet Information Server (IIS) 1.0, and Microsoft remote procedure call (RPC).

WinNuke is particularly troublesome. Most of the NT boxes out on the Internet are still vulnerable to this attack. We don't know just who came up with the first example of WinNuke or found the initial problem. Our apologies for not being able to give credit where it is due.The scenario goes something like this.

A cracker makes a TCP connection to a machine running Windows 95 or NT. As soon as the connection is made, and before any regular data is sent, the cracker transfers a message over the connection with the Out of Band (OOB) flag set. This flag normally signals an application that some information needs to get through right away and cannot wait in the regular data stream to be processed. The paradox here is that there is no data in the regular stream.

In an unpatched or under-patched NT machine, your screen turns a nice shade of blue. You must reboot to clear this problem.

The moral of this example? TCP stacks are not the easiest things in the world to write. Users continue to find bugs in most vendors' implementations. The one stack that is probably closest to being bulletproof is BSD Unix. What's more, the source code for this more robust and quicker stack is free. The only catch is that the license states you must mention that parts of your product were derived from Berkeley code if you use it.

NT also had problems with DNS. DNS is responsible for mapping numbers such as 10.23.143.12 to names such as foo.bar.com. It is in mu ch need of an overhaul, but it's entrenched in how the Internet works.

The Canadian company Secure Networks found a problem in Microsoft's implementation of DNS. The standard operation for a DNS server is to field queries and send responses or send queries and field their associated responses. What happens when you send a response to a nonexistent query? The DNS server dies, most likely as a result of trying to reference a fictitious ID number in the DNS packet.

IIS 1.0 had a similar problem. All someone with malicious intent or sloppy fingers had to do was request a URL in the form of http://www.someiismachine.com/../../../.., and the Web server would stop running. An easier way of doing this was simply to telnet to port 80 of the target machine and type "GET ../.." Why did the server die? Probably, this is a case of requesting a file handle, getting a NULL pointer in response, and trying to dereference the NULL pointer.

Finally, and not because we are running out of DoS attacks on NT, but because we don't want to write exclusively on ways to make your NT network unusable, we have the problem of how a program should respond to unexpected or erroneous input. There are three possible responses to this question: Ignore the input, report the error and terminate gracefully, or act in an undefined manner (the program dies from a segmentation fault or a bus error, munges its stack frame, or sits there spinning its wheels in an endless loop).

We believe most people would prefer either of the first two responses to the third. Unfortunately, however, the last one is what happened to most Microsoft services that listened on the network.

Windows NT 4.0 Service Pack 3 fixed the port 80 OOB attack, but crackers struck again. By connecting to port 135 of an NT machine and letting your 2-year-old bang away at the keyboard for a second, you would leave the program previously listening on that port spinning its wheels and pegging the CPU use at 99 percent. Microsoft plu gged the port 135 hole in one of the 14 patches to Service Pack 3, but there are probably more TCP/IP bugs remaining than we'd care to think about.

Noncaptive Environments

In many situations, it is necessary to give someone or something limited access to your system. It is not necessary for everyone who connects to your FTP or Web server to have access to your main C or D drives. In the case of HTTP servers, all that people will usually need is the document root.

For example, if your Web tree lives in c:\users\web\html and your main page is c:\users\web\html\index.htm, users should be able to request http://your.site.com/index.htm. Thus, \users\web\html looks like \ to the foreign entity. The same holds true for FTP servers, file sharing, and the like.

In the Unix world, administrators found that you had to double-check to be sure that restricted environments were really restricted. Administrators found this out the hard way and fixed it over time. Now it's Microsoft's turn to learn for itself. It's also possible that Unix vendors had an easier time of it, because the Unix source code they released actually helped hackers find and plug security holes.

In some versions of Microsoft's Web server, FTP server, and file sharing, it was possible to believe you were sitting at \, attempt to go up a level anyway, and magically find yourself outside your restricted environment. Although Microsoft has since patched the flaw, the idea that it could introduce the flaw years after the Unix community identified the problem is troubling.

Privilege Escalation Attacks

ActiveX and Java have provided a wellspring of privilege escalation attack opportunities . Some of the most interesting attacks involve the construction of hostile Java, ActiveX, or plain old C++ Trojan horses.

In theory, Authenticode gives a level of protection against Trojan horses. ActiveX controls are signed by certificate authorities and must identify their creators before they run. You get to decide if the creator should be trusted. Regardless of Microsoft's threats of litigation, however, unscrupulous crackers will still find people to sign their ActiveX controls.

In the ActiveX/Authenticode security model, once a source is trusted, it is always trusted. For example, users who go to Microsoft's Web site are sent a flood of ActiveX controls without warning, because the controls came from a trusted source -- Microsoft. What if a rogue Microsoft employee decided to modify registry settings, plant backdoors for later use, or deposit logic bombs? An example of a rogue ActiveX control, called Internet_Exposure, can be found at http://www.network-security.com/nt/internet-exposure .

In addition to the Trojan horse examples, a slick program entitled geta dmin was recently released by Konstantin Sobolev, who wrote it in Russia, according to one security expert. This program found functions the NT kernel was providing that would let nonprivileged processes attach to memory areas that they should not be allowed to touch and modify the contents.

The result? A tool that would let an ordinary account convince the system it was just debugging something and place the account in the Administrator group of an NT domain. The next time you logged in, you had full rights to the system. This avenue seems ripe for exploration as Microsoft pulls more and more of the services that used to live in user space into kernel space. Any bug or lack of validity checking in userland gets much worse if it continues to exist in kernel space. As expected, getadmin has been ported into an ActiveX control and an application that a Trojan horse can deliver.

At press time, Microsoft has issued two patches for getadmin, the second of which was headed for NT 4.0 Service Pack 4, but each works only in certain cases. Neither will work if you have any software developers on your system, because they need to be given permission to attach to processes for debugging purposes.

Weak Passwords/Authentication

A while back, a white paper on insecurities and potential flaws in Microsoft's CIFS specification (its replacement for NFS and how all systems will share files across networks in the future) was posted on the Internet. The paper, which was by hobbit@avian.org and available at http://www.avian.org , pointed out many areas for concern and gave readers enough information and source examples to create their own "probing kit" to check things out for themselves.

One interesting note in the paper was that logging of attempts to connect to file shares was done via the NetBIOS name, not the IP address. Thus, it was trivial to explicitly tell the machine what to log by handing in the NetBIOS information. Walking into work and seeing your logs filled with connection attempts from "HAHAHAHAH" might tell you that you were under attack, but it gives you little information to work with other than a taunting ramble.

In addition to logging, NT provides account lockout "slowdown" solutions to programmatic dictionary or sequential password attacks over the network. In account lockout, the administrator specifies how many invalid attempts it takes before an account is locked out and how long the lockout period lasts. Great, except you can't lock out the Administrator account. If someone renames the Administrator account to try to hide it and leaves a dummy account in its place, you can tell as soon as your automated attack scripts start failing in rapid succession as opposed to slowly and programmatically.

The slowdown solution makes NT introduce a delay between each attempt to authenticate . Ostensibly, this would make it unfeasible for an attacker to launch an entire dictionary at an account over the net -- it would take too long. If you have 1000 words you want to try and the slowdown period lets you try only one word every 2 seconds, it will take 33 minutes to go through them. The problem here is that the slowdown solution works only per connection. To bypass it, simply open 10 connections with different words from the list. Now it will take you only 3 minutes (these numbers are used just as an example).

For more information on this, see http://www.avian.org, http://www.secnet.com, and http://www.L0pht.com for the vulnerability-in-CIFS white paper, the NAT10 auditing tool, and L0phtcrack, respectively.

The encryption implementation in NT 4.0 has left passwords vulnerable to attack (see the sidebar "Password Protection at a Price"). Microsoft recommends abandoning LAN Manager-style passwords. NT-style passwords can be up to 128 characters in length. These passwords are case-sensitive. NT converts them to Unicode and then runs them through Rivest-Shamir-Adleman's (RSA) MD4 message digest function. The resulting 16-byte value is the NT hash. The only time hackers should be able to retrieve a LAN Manager password and not the NT MD4 version is if the MD4 version is originally longer than 14 characters. But ironically enough, NT's UserManager application won't let you type in a password greater than 14 characte rs.

Caught Unaware?

Microsoft officials we spoke to downplay these problems and characterize NT as "a very solid and secure OS." According to Enzo Schiano, group product manager for NT Server, "if you compare NT to Unix, we probably have a very, very comprehensive security infrastructure."

But much of Microsoft's advice on its Web site smacks of the obvious: Precautions include reminding users not to pick easily guessable passwords. The Syskey patch to NT 4.0 prevents anyone from reading hash values out of the NT registry. The hacker community is now calling Microsoft's bluff by exposing more holes every day.

Unfortunately, the cracker community is exploiting the revealed vulnerabilities for criminal purposes, and patches such as Syskey hamper administrators, not the crackers. To help administrators test the strength of their encryption, a future version of L0phtcrack will include an NT-based sniffer kit, for reading hash values over the NT server's network.

You can't just blame users who don't adopt or enforce security policies rigorously. DoS attacks, noncaptive environment attacks, and privilege escalation attacks will continue, even through the implementation of Kerberos security in NT 5.0. Eventually, users will complain enough that Microsoft will turn its full attention to the problem. The seriousness of the situation may even cause Microsoft to turn to Unix methods and technologies developed over the years to patch the holes. NT is a robust OS, but only compared to other Microsoft OSes. It can prosper only if it becomes something more.


NT Security Threats: A Family Tree

illustration_link (26 Kbytes)

Exploiting NT's roots in LAN Manager and TCP/IP, many hackers have been able to launch four kinds of attacks on the OS in recent months.


Anatomy of a Windows NT Server Break-In

illustration_link (22 Kbytes)

Exploiting holes in NT security, hackers can even cause mischief behind many firewalls.


Peter Mudge is the chief security architect of LHI Technologies, and Yobie Benjamin is the chief knowledge officer of Cambridge Management Labs, a division of Cambridge Technology Partners, Inc. They spend much research time in the areas of Java, ActiveX, Unix, Windows NT, security, cryptography, and the Internet. You can reach them c/o editors@bix.com.

Up to the Features section contentsGo to previous article: Go to next article: NT Watchdogs for Hire
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network