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.

240<br />

Part IV: Hacking Operating Systems<br />

Figure 12-10:<br />

The rexec<br />

file showing<br />

the disable<br />

option.<br />

Countermeasures against .rhosts<br />

and hosts.equiv file attacks<br />

Use both of the following countermeasures to prevent hacker attacks against<br />

the .rhosts and hosts.equiv files in your Linux system.<br />

Disabling commands<br />

A good way to prevent abuse of these files is to disable the BSD r-commands.<br />

This can be done in two ways:<br />

✓ Comment out the lines starting with shell, login, and exec in inetd.<br />

conf.<br />

✓ Edit the rexec, rlogin, and rsh files located in the /etc/xinetd.d<br />

directory. Open each file in a text editor and change disable=no to<br />

disable=yes, as shown in Figure 12-10.<br />

In Red Hat Enterprise Linux, you can disable the BSD r-commands with the<br />

setup program:<br />

1. Enter setup at a command prompt.<br />

2. Choose System Services from the menu.<br />

3. Remove the asterisks next to each of the r-services.<br />

Blocking access<br />

A couple of countermeasures can block rogue access of the .rhosts and<br />

hosts.equiv files:

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

Saved successfully!

Ooh no, something went wrong!