19.04.2013 Views

2KKUU7ita

2KKUU7ita

2KKUU7ita

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 12: Linux<br />

Manual testing<br />

The following commands can identify and print to the screen SetUID and<br />

SetGID programs:<br />

✓ Programs that are configured for SetUID:<br />

find / -perm -4000 –print<br />

✓ Programs that are configured for SetGID:<br />

find / -perm -2000 –print<br />

✓ Files that are readable by anyone in the world:<br />

find / -perm -2 -type f –print<br />

✓ Hidden files:<br />

find / -name “.*”<br />

You probably have hundreds of files in each of these categories, so don’t be<br />

alarmed. When you discover files with these attributes set, you need to make<br />

sure that they are actually supposed to have those attributes by researching<br />

in your documentation or on the Internet, or by comparing them to a known<br />

secure system or data backup.<br />

Keep an eye on your systems to detect any new SetUID or SetGID files that<br />

suddenly appear.<br />

Automatic testing<br />

You can use an automated file-modification auditing program to alert you<br />

when these types of changes are made. This is what I recommend — it’s a lot<br />

easier on an ongoing basis:<br />

✓ A change-detection application, such as Tripwire, can help you keep<br />

track of what changed and when.<br />

✓ A file-monitoring program, such as COPS (point your web browser to<br />

ftp://ftp.cerias.purdue.edu/pub/tools/unix/scanners/<br />

cops), finds files that have changed in status (such as a new SetUID or<br />

removed SetGID).<br />

Finding Buffer Overflow Vulnerabilities<br />

RPC and other vulnerable daemons are common targets for buffer-overflow<br />

attacks. Buffer-overflow attacks are often how the hacker can get in to modify<br />

system files, read database files, and more.<br />

243

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

Saved successfully!

Ooh no, something went wrong!