A new book on writing code to exploit security flaws in software is raising eyebrows in the technical community. The book publishes "zero day," or previously unknown, techniques for exploiting vulnerable systems, including those running Microsoft Windows.
The Shellcoder's Handbook: Discovering and Exploiting Security Holes, by Jack Koziol, David Litchfield, Dave Aitel, Chris Anley, Sinan Eren, Neel Mehta, and Riley Hassell, is an advanced guide to writing software exploits. The book is intended as a resource for network administrators who are interested in closing security holes. However, the book also contains working examples of code for exploiting vulnerable systems and previously unpublished techniques for launching attacks such as heap overflows and kernel attacks, according to two of the book's authors.
Shellcode is a term that describes small pieces of computer code that launch operating system shells, or command interfaces such as the common C:\ command line interface on Microsoft DOS. Shellcode is often a component of attacks in which malicious hackers use software exploits to get control of vulnerable systems.
The book is being published by John Wiley & Sons; it is scheduled to be released on March 22, 2004. It contains chapters on a variety of attack types, including stack overflows, heap overflows, and format string bugs. The authors discuss everything from writing Windows shellcode to exploiting security holes in Hewlett-Packard's Tru64 operating system, according to a description of the book published on the Wiley Web site.
Also contained in the guide are fully functional examples of software exploits, according to coauthor Dave Aitel, founder of Immunity of New York City, a security consulting company.
"The book is trying to teach you how to write exploits, so of course there are exploits," he says.
Aitel contributed chapters on heap overflows and Windows exploits, as well a technique for finding flaws in network communications protocols called fuzzing, he says.
The information contained in the new book is essential to administrators who want to secure the computer systems under their management, he says.
"It's hard to get context on a [software] vulnerability if you don't know how to exploit it. People who know how to write exploits make better strategic decisions," he says.
Coauthor Chris Anley agrees and says The Shellcoder's Handbook is not a cookbook for hackers.
"This isn't a collection of exploits. It's a book that tells you how to find the bugs and understand what the impact of the bugs is," says Anley, a director at Next Generation Security Software in Surrey, UK.
"We wanted to make a book that describes from basic through advanced level what exploits can do," he says.
The book is structured like a primer. Early chapters focus on basic concepts like stack overflows and use examples written for the open-source Linux platform. Later chapters focus on more complicated problems and obscure operating systems such as Sun Microsystems' Solaris and HP's Tru64, Anley says.
The book pulls together information that could be obtained from security discussion groups on the Internet or from a university-level network security administration course, say Anley and fellow coauthor David Litchfield, also of Next Generation Security Software.
However, The Shellcoder's Handbook also delves into more arcane exploit-writing topics that are not commonly discussed, such as format string bugs, which address vulnerabilities in the way some programs written in the C programming language output data. And a chapter titled "Alternative Payload Strategies" discusses ways in which an exploit writer can subtly manipulate a compromised machine other than to produce a shell prompt, such as extracting data from a database or tampering with cryptographic services, Anley says.
The Shellcoder's Handbook and other books like it stir up controversy within the information technology security community about whether researchers should publicly disclose holes in software products, says Alan Paller, director of research at The SANS Institute.
Authors who publish software exploits walk a fine line between informing the public and lowering the bar for malicious hackers, he says.
"You don't want to make writing an exploit as easy as fixing a car," Paller says.
However, Paller believes that IT professionals who defend networks from attack benefit more from books like The Shellcoder's Handbook than do attackers.
"In the security world there's lots of advice, and a lot of it doesn't make much sense. So if you understand why you have to do certain things and can connect the defense back to an actual attack, that helps," he says.
