19.04.2013 Views

2KKUU7ita

2KKUU7ita

2KKUU7ita

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.

Chapter 12: Linux<br />

Hacks using the .rhosts and hosts.equiv files<br />

If hackers can capture a user ID and password by using a network analyzer or<br />

can crash an application and gain root access via a buffer overflow, one thing<br />

they look for is what users are trusted by the local system. That’s why it’s<br />

critical to assess these files yourself. The /etc/hosts.equiv and .rhosts<br />

files list this information.<br />

.rhosts<br />

The $home/.rhosts files in Linux specify which remote users can access<br />

the Berkeley Software Distribution (BSD) r-commands (such as rsh, rcp, and<br />

rlogin) on the local system without a password. This file is in a specific user’s<br />

(including root) home directory, such as /home/jsmith. An .rhosts file<br />

may look like this:<br />

tribe scott<br />

tribe eddie<br />

This file allows users Scott and Eddie on the remote-system tribe to log in<br />

to the local host with the same privileges as the local user. If a plus sign (+)<br />

is entered in the remote-host and user fields, any user from any host could<br />

log in to the local system. The hacker can add entries into this file by using<br />

either of these tricks:<br />

✓ Manually manipulating the file<br />

✓ Running a script that exploits an unsecured Common Gateway Interface<br />

(CGI) script on a web-server application that’s running on the system<br />

This configuration file is a prime target for a malicious attack. On most Linux<br />

systems I’ve tested, these files aren’t enabled by default. However, a user<br />

can create one in his or her home directory on the system — intentionally or<br />

accidentally — which can create a major security hole on the system.<br />

hosts.equiv<br />

The /etc/hosts.equiv file won’t give away root access information, but it<br />

does specify which accounts on the system can access services on the local<br />

host. For example, if tribe were listed in this file, all users on the tribe system<br />

would be allowed access. As with the .rhosts file, external hackers can read<br />

this file and then spoof their IP address and hostname to gain unauthorized<br />

access to the local system. Hackers can also use the names located in the<br />

.rhosts and hosts.equiv files to look for names of other computers to<br />

attack.<br />

239

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

Saved successfully!

Ooh no, something went wrong!