21.03.2013 Views

Problem - Kevin Tafuro

Problem - Kevin Tafuro

Problem - Kevin Tafuro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The function signal_was_caught( ) is used to check each of the signal flags and print<br />

an appropriate message if one of the signals was received. It is, in fact, possible that<br />

more than one signal could have been received, so all the flags are checked. Immediately<br />

after the call to fread( ), we call signal_was_caught( ) to do the signal tests and<br />

immediately break out of our loop and exit if any one of the signals was received.<br />

See Also<br />

• “Delivering Signals for Fun and Profit” by Michal Zalewski: http://www.netsys.<br />

com/library/papers/signals.txt<br />

• Advanced Programming in the Unix Environment by W. Richard Stevens (Addison<br />

Wesley)<br />

• Recipe 13.11<br />

13.6 Protecting against Shatter Attacks on<br />

Windows<br />

<strong>Problem</strong><br />

You are developing software that will run on Windows, and you want to protect<br />

your program against shatter attacks.<br />

Solution<br />

In December 2002, Microsoft issued security bulletin MS02-071 (http://www.<br />

microsoft.com/technet/treeview/?url=/technet/security/bulletin/MS02-071.asp), along<br />

with a patch for Windows NT 4.0, Windows 2000, and Windows XP that addresses<br />

the issue described in this recipe. Use that patch to prevent shatter attacks.<br />

In addition, services running with elevated privileges should never use any of the<br />

Windows user interface APIs. In particular, windows (even invisible ones) and message<br />

loops should be avoided.<br />

The primary consequence of the shatter attack is local elevation of privileges, which<br />

means that it is only an issue on versions of Windows that have privileges. In other<br />

words, Windows 95, Windows 98, and Windows ME are not affected.<br />

Discussion<br />

In August 2002, Chris Paget released a white paper (http://security.tombom.co.uk/<br />

shatter.html) describing a form of attack against event-driven systems that he termed<br />

a shatter attack. In particular, Paget’s paper targeted Microsoft’s Win32 API. Paget<br />

was not the first to discover the vulnerabilities he described in his paper, but his<br />

716 | Chapter 13: Other Topics<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!