Stephen James
Payoff
As organizations continue to link their internal networks to the Internet, system managers and administrators are becoming increasingly aware of the need to secure their systems. The self-hack audit (SHA) is an approach that uses hacker methods to identify and eliminate security weaknesses in a network before they are discovered by a hacker. This article describes the most common hacker techniques that have allowed unauthorized persons to gain access to computer resources and provides steps for network administrators to improve network security.
Introduction
In today’s electronic environment, the threat of being hacked is no longer an unlikely incident, occurring in a few unfortunate organizations. New reports of hacker incidents and compromised systems appear almost daily. As organizations continue to link their internal networks to the Internet, system managers and administrators are becoming increasingly aware of the need to secure their systems. Implementing basic password controls is no longer adequate to guard against unauthorized access to data. Organizations are now looking for more up-to-date techniques to assess and secure their systems. The most popular and practical technique emerging is the self-hack audit (SHA). The SHA is an approach that uses hacker methods to identify and eliminate security weaknesses in a network before they are discovered by a hacker.
This article provides a methodology for the SHA and presents a number of popular hacker techniques that have allowed hackers to penetrate various systems in the past. Each description is followed by a number of suggested system administration steps or precautions that should be followed to help prevent such attacks. Although some of the issues discussed are specific to UNIX systems, the concepts can be applied to all systems in general.
Objectives of the Self-Hack Audit
The basic objective of the SHA is to identify all potential control weaknesses that may allow unauthorized persons to gain access to the system. The network administrator must be familiar and use all known hacker techniques for overcoming system security. Depending on the nature of the audit, the objective may be either to extend a user’s current levels of access (which may be no access)or to destroy (i.e., sabotage) the system.
Overview of the Self-Hack Audit Methodology
To perform a useful SHA, the different types of hackers must be identified and understood. The stereotype of a hacker as a brilliant computer science graduate sitting in a laboratory in a remote part of the world is a dangerous misconception. Although such hackers exist, the majority of security breaches are performed by staff members of the breached organization. Hackers can be categorized into four types:
· Persons within an organization who are authorized to access the system. An example
may be a legitimate staff member in the Accounting department who has access to
Accounts Payable application menu functions.
· Persons within an organization who are not authorized to access the system. These individuals may include personnel such as the cleaning staff.
· Persons outside an organization who are authorized to access the system. An example may be a remote system support person from the organization’s software vendor.
· Persons outside an organization who are not authorized to access the system. An
example is an Internet user in an overseas country who has no connection with the
organization.
The objective of the SHA is to use any conceivable method to compromise system security. Each of the four hacker types must be considered to assess fully all potential security exposures.
Popular Hacker Techniques
The following sections describe the techniques most commonly used by hackers to gain access to various corporate systems. Each section discusses the hacker technique and proposes basic controls that can be implemented to help mitigate these risks. The network administrator should attempt each of these techniques and should tailor the procedures to suit the organization’s specific environment.
Accessing the Log-in Prompt
One method of gaining illegal access to a computer system is through the Log-in prompt. This situation may occur when the hacker is physically within the facility or is attempting to access the system through a dial-in connection.
Physical Access.
An important step in securing corporate information systems is to ensure that physical access to computer resources is adequately restricted. Any internal or external person who gains physical access to a terminal is given the opportunity to attempt to sign on at the log-in prompt.
To reduce the potential for unauthorized system access by way of a terminal within the organization’s facility, the network administrator should ensure that:
· Terminals are located in physically secure environments.
· Appropriate access control devices are installed on all doors and windows that may be used to access areas where computer hardware is located.
· Personal computers that are connected to networks are password-protected if they are
located in unrestricted areas. A hacker trying to access the system would be required to
guess a legitimate password before gaining access through the log-in prompt.
· Users do not write their passwords on or near their work areas.
Dial-in Access.
Another method of accessing the log-in prompt is to dial in to the host. Many “daemon dialers” are readily available on the Internet. These programs, when given a range of numbers to dial, can identify valid modem numbers. Once a hacker discovers an organization’s modem number, he or she can dial in and, in most cases, immediately gain access to the log-in prompt.
To minimize the potential for security violations by way of dial-in network access, the network administrator should ensure that:
· Adequate controls are in place for dial-in sessions, such as switching off the modem
when not in use, using a call-back facility, or requiring an extra level of authentication,
such as a one-time password, for dial-in sessions.
· The organization’s logo and name are removed from the log-in screen so that the hacker does not know which system has been accessed.
· A warning message alerts unauthorized persons that access to the system is an offense and that their activities may be logged. This is a legal requirement in some countries.
Obtaining Passwords
Once the hacker has gained access to an organization’s log-in prompt, he or she can attempt to sign on to the system. This procedure requires a valid user ID and password combination.
Brute Force Attacks.
Brute force attacks involve manual or automated attempts to guess valid passwords. A simple password guessing program can be written in approximately 60 lines of C code or 40 lines of PERL. Many password guessing programs are available on the Internet. Most hackers have a “password hit list,” which is a collection of default passwords automatically assigned to various system accounts whenever they are installed. For example, the default password for the guest account in most UNIX systems is “guest.”
To protect the network from unauthorized access, the network administrator should ensure that:
· All user accounts are password protected.
· Password values are appropriately selected to avoid guessing.
· Default passwords are changed once the system is installed.
· Failed log-in attempts are logged and followed up appropriately.
· User accounts are locked out after a predefined number of sign-on failures.
· Users are forced to select passwords that are difficult to guess.
· Users are forced to change their passwords periodically throughout the year.
· Unused user accounts are disabled.
· Users are educated and reminded regularly about the importance of proper password management and selection.
Password Cracking.
Most UNIX sites store encrypted passwords together with corresponding user accounts in a file called /etc/passwd. Should a hacker gain access to this file, he or she can simply run a password cracking program such as Crack. Crack works by encrypting a standard dictionary with the same encryption algorithm used by UNIX systems (called crypt). It then compares each encrypted dictionary word against the entries in the password file until it finds a match. Crack is freely available via an anonymous File Transfer Protocol from ftp.cert.org at/pub/tools/crack.
To combat the hacker’s use of password-cracking software, the network administrator should ensure that:
· Encrypted passwords are stored in a shadow password file and that the file is adequately protected.
· All “weak” passwords are identified by running Crack against the password file.
· Software such as Npasswd or Passwd+ is used to force users to select passwords that are difficult to guess.
· Users do not write their passwords on or near their work environments.
·Only the minimum number of users have access to the command line to minimize the risk of copying the /etc/passwdfile.
Keystroke Logging.
It takes less than 30 seconds to type in a short script to capture sign-on sessions. A hacker can use a diskette to install a keystroke-logging program onto a workstation. Once this Trojan Horse is installed, it works in the background and captures every sign-on session, based on trigger key words. The hacker can read the captured keystrokes from a remote location and gain access to the system. This technique is very simple and almost always goes unnoticed.
To prevent a hacker’s access to the system by way of a keystroke-logging program, the network administrator should ensure that:
· Privileged accounts (e.g., root) require one-time passwords.
· The host file system and individual users’ workstations are periodically scanned for Trojan Horses that could include keystroke-logging programs.
· Adequate physical access restrictions to computer hardware are in place to prevent persons from loading Trojan Horses.
Packet Sniffing.
The Internet offers a wide range of network monitoring tools, including network analyzers and “packet sniffers.” These tools work by capturing packets of data as they are transmitted along a communications segment. Once a hacker gains physical access to a PC connected to a LAN and loads this software, he or she is able to monitor data as it is transferred between locations. Alternatively, the hacker can attach a laptop to a network port in the office and capture data packets.
Remembering that network traffic often is not encrypted, there is a high chance that the hacker will capture valid user account and password combinations, especially between the hours of 8:00 a.m. and 9:00 a.m. Tcpdump is a tool for UNIX systems used to monitor network traffic and is freely available via an anonymous FTP from ftp.ee.lbl.gov at tcpdump2.2.1.tar.z.
To reduce the possibility of account and password leaks through packet sniffers, the network administrator should ensure that:
· Communications lines are segmented as much as practical.
· Sign-on sessions and other sensitive data are transmitted in an encrypted format by using software such as Kerberos.
· Privileged accounts (e.g., root) sign on using one-time passwords.
· Physical access to communications lines and computer hardware is restricted.
Social Engineering.
Hackers often select a user account that has not been used for a period of time (typically about two weeks) and ensure that it belongs to a user whom the administrator is not likely to recognize by voice. Hackers typically target accounts that belong to interstate users or users in another building. Once they have chosen a target, they assume a user’s identity and call the administrator or the help desk, explaining that they have forgotten their passwords. In most cases, the administrator or help desk will reset passwords for the hackers over the telephone.
In an effort to keep the network safe from this type of infiltration, the network administrator should ensure that:
· All staff are regularly reminded and educated about the importance of data security and about proper password management.
· The organization has documented and controlled procedures for resetting passwords over the telephone.
· Staff do not fall prey to social engineering attacks. Staff members must be aware of the
possibility that a hacker may misrepresent himself or herself as a member of the
information systems department and ask for a password.
General Access Methods
Hackers use a variety of methods to gain access to a host system from another system.
Internet Protocol Address Spoofing.
In a typical network, a host allows other “trusted” hosts to communicate with it without requiring authentication (i.e., without requiring a user account and password combination). Hosts are identified as trusted by configuring files such as the .rhost and /etc/hosts.equiv files. Any host other than those defined as trusted must provide authentication before it is allowed to establish communication links.
Internet protocol (IP) spoofing involves an untrusted host connecting to the network and pretending to be a trusted host. This access is achieved by the hacker changing its IP number to that of a trusted host. In other words, the intruding host fools the host on the local network into not challenging it for authentication.
To avoid this type of security violation, the network administrator should ensure that:
· Firewalls and routers are appropriately configured so that they reject IP spoofing attacks.
·Only appropriate hosts are defined as trusted within /etc/hosts.equiv, and file permissions over this file are adequate.
·Only appropriate hosts are defined within users’ /.rhost files. If practical, these files should be removed.
Unattended Terminals.
It is quite common to find user terminals left signed on and unattended for extended periods of time, such as during lunch time. Assuming that the hacker can gain physical access to users’ work areas (or assuming that the hacker is an insider), this situation is a perfect opportunity for a hacker to compromise the system’s security. A hacker may use an unattended terminal to process unauthorized transactions, insert a Trojan Horse, download a destructive virus, modify the user’s .rhost file, or change the user’s password so that the hacker can sign on later.
The network administrator can minimize the threat from access through unattended terminals by ensuring that:
· User sessions are automatically timed out after a predefined period of inactivity, or password protected screen savers are invoked.
· Users are regularly educated and reminded about the importance of signing off their sessions whenever they expect to leave their work areas unattended.
· Adequate controls are in place to prevent unauthorized persons from gaining physical access to users’ work areas.
Writeable Set User ID Files.
UNIX allows executable files to be granted root privileges by making file permissions set user ID (SUID) root. Hackers often search through the file system to identify all SUID files and to determine whether they are writeable. Should they be writeable, the hacker can insert a simple line of code within the SUID program so that the next time it is executed, it will write to the /etc/passwd file and this will enable the hacker to gain root privileges. The following UNIX command will search for SUID root files throughout the entire file system: find / -user root -perm -4000 -print
The network administrator can reduce the possibility of illegal access through SUID files by ensuring that:
· Only the minimum number of programs are assigned SUID file permissions.
· Programs that are SUID are not writeable by users other than root.
· Executables defined within the system cron tables (especially the root cron table) are not writeable by users other than root because they are effectively SUID root.
Computer Emergency Response Team Advisories.
The Computer Emergency Response Team (CERT)issues advisories whenever a new security exposure has been identified. These exposures often allow unauthorized users to gain root access to systems. Hackers always keep abreast of the latest CERT advisories to identify newly found bugs in system software. CERT can be accessed via an anonymous FTP at info.cert.org.
|
The network administrator should ensure that: |
|
|
· |
All CERT advisories have been reviewed and acted on in a controlled and timely manner. |
|
· |
Checksums are used to ensure the integrity of CERT patches before they are implemented. |
|
|
Hacker Bulletin Boards. The Internet has a large number of hacker bulletin boards and forums that act as an |
invaluable source of system security information. The most popular hacker bulletin board is the “2600” discussion group. Hackers from around the world exchange security information relating to various systems and often publish security sensitive information relating to specific organizations or hacker techniques relating to specific programs.
The network administrator should ensure that the organization’s data security officer regularly reviews hacker bulletin boards to identify new techniques and information that may be relevant to the organization’s system environment.
Internet Software.
The Internet offers a large number of useful tools, such as SATAN, COPS, and ISS, which can assist data security officers and administrators in securing computer resources. These tools scan corporate systems to identify security exposures. However, these tools are also available to hackers and can assist them in penetrating systems.
To identify and resolve potential security problems, the network administrator should ensure that:
· The latest version of each security program is obtained and run in a regular manner. Each identified exposure should be promptly resolved.
· The system is subject to regular security audits by both the data security officer and independent external consultants.
Conclusion
Hacker activity is a real and ongoing threat that will continue to increase as businesses connect their internal corporate networks to the Internet. This article has described the most common hacker techniques that have allowed unauthorized persons to gain access to computer resources. The self-hack audit is becoming an increasingly critical technique for identifying security weaknesses that, if not detected and resolved in a timely manner, could allow hackers to penetrate the corporate system. System administrators and data security officers should keep abreast of the latest hacker techniques by regularly reading all CERT publications and hacker bulletin boards.
Author Biographies
Stephen James
Stephen James is one of Australia’s leading computer security experts, specializing in UNIX and Internet security as well as hacker studies. He is a senior consultant with Price Waterhouse (Sydney).
