Home > Articles > Security > Network Security

  • Print
  • + Share This
This chapter is from the book

3.2 Exploits

An exploit allows an attacker to take advantage of known weaknesses in operating systems or applications to gain access to a server. Exploits can be performed in many ways, however, it is becoming increasingly common for an exploit to be written into a software application that can be easily pointed at any server.

NOTE

Exploits as programs make it very easy for script kiddies to wreak havoc, but they also separate true attackers from the script kiddies. One developer, having set up a honeypot on a FreeBSD system, went into a well-known script kiddie chat room and told them about a "vulnerable" Microsoft Windows IIS server he had discovered. Seconds after his announcements the honeypot server began getting attacks designed to exploit vulnerabilities in the Microsoft Windows server. Not one person bothered to verify whether it was really a Microsoft Windows server.

Before an exploit can be run, it is important to know what operating system is running on the network device. Some exploits work on some systems, but not others. There are many tools to do this, but since nmap has built-in operating system fingerprinting capabilities, it is often easiest to use:

[root@test root]# nmap -O www.datacenterwire.com
Starting nmap V. 2.99RC2 ( www.insecure.org/nmap/ )
Interesting ports on (66.150.201.102):
(The 1587 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
53/tcp open domain
80/tcp open http
81/tcp open hosts2-ns
110/tcp open pop-3
443/tcp open https
587/tcp open submission
886/tcp filtered unknown
3306/tcp open mysql
5432/tcp open postgres
10000/tcp open snet-sensor-mgmt
32787/tcp filtered sometimes-rpc27
Remote operating system guess: FreeBSD 4.5-RELEASE (or -STABLE) (X86)
Uptime 72.083 days (since Fri May 17 17:15:58 2002)

Nmap run completed -- 1 IP address (1 host up) scanned in 685 seconds

The attacker now knows that the site is running FreeBSD, Version 4.5, on an Intel processor. With that knowledge the attacker can:

  • Attempt to exploit known vulnerabilities in the operating system.

  • Try to access the server through security holes in the applications running on the server.

  • FreeBSD is a fairly secure operating system. Rather than try to crack the operating system directly it is usually easier to exploit security holes in applications running on the server.

In June 2002 a serious security flaw was found in the Apache web server, used by more than 18 million websites around the world. This security hole caught many people off guard, and given the large install base, it will be a while before the majority of Apache web servers will be upgraded. A good attacker knows this, and will check to see if the server is vulnerable.

Fortunately, there are numerous tools that can be used to test for application weaknesses. Network administrators use scanning tools to find security holes within their own network. Unfortunately, there is nothing preventing an attacker from putting these tools to the same use.

A common application used for tasks like this is Nessus (www.nessus.org). Nessus is designed specifically for remote security scanning; that is, it is built to emulate the actions of an attacker attempting to break into a network. The developers of Nessus maintain a database of known vulnerabilities. Administrators—or attackers—can use this database to find known security holes in various servers on the network. Administrators can patch the holes; attackers can exploit them.

In this case, the attacker already knows that he or she wants to try an Apache exploit, so there is no need to use Nessus, because there are programs that will simply check for Apache vulnerabilities. A fairly common tool is the Retina Apache Chunked Scanner, developed by eEye Digital Security (www.eeye.com).

Simply enter the IP address, or range of IP addresses to be scanned, and it will check for the vulnerabilities. Figure 3.2 shows that the server is not vulnerable to this particular attack.

Figure 2Figure 3.2 The Retina Apache Chunked Scanner checks for a specific Apache vulnerability. Other tools will check for a wider range of vulnerabilities.


This server is not vulnerable to the Apache exploit, so what is the next step? That depends on the attacker. If the attacker is specifically targeting this server, he or she will attempt to find another way in. If the attacker is simply looking for a server to attack, and does not have many tools with which to launch the attack, then he or she will probably move on to another server that is vulnerable, as in Figure 3.3.

It is not uncommon for an attacker, especially a script kiddie, to have a limited arsenal of weapons with which to launch an attack. This is especially true if the attacker does not understand how the attack works, and is relying on tools developed by someone who does. This type of attacker is not going to try a systematic approach to a server attack; instead, the attacker will move on to a less secure server.

Figure 3.3 shows a server vulnerable to the Apache Chunk exploit. Once the attacker finds a server that is vulnerable, the next step is to exploit it. Again, this can be done by understanding the weakness and developing a program to take advantage of it. Alternatively, if a script exists to do this for the attacker, that script can be used.

Figure 3Figure 3.3 This server is most likely vulnerable to the Apache Chunk exploit. The next step would be to attempt to exploit the server.


NOTE

The Apache Chunk exploit is a bug in the way Apache deals with files being uploaded when the server is unable to determine the file size.

In this case, the code to take advantage of the Apache Chunk exploit is available in a compiled format from the Packet Storm security website (packet-storm.decepticons.org/filedesc/apache-nosejob.zip.html). Download the code, target the server (as in Figure 3.4), and an attacker can gain root access to the remote web server.

Figure 4Figure 3.4 Using the program to launch an attack against a website and exploit a security hole in the Apache web server

Often it takes very little skill to break into a server, especially a web server. It is simply a matter of knowing the tools needed for the job and implementing them.

3.2.1 Rootkits

When an attacker gains access to a server, the first goal is to cover his or her tracks. Installing a rootkit often does this. A rootkit has two purposes: to cover the tracks of the attacker and to gather information about the server and its users.

Rootkits usually kill logging services and monitor the keystrokes of system users looking for passwords and other useful information. A rootkit will contain several programs that hide the activity of the attacker.

A good example of a rootkit is Tuxkit, developed by Tuxtendo (www.tux-tendo.nl). Tuxkit has all of the classic features that make a rootkit useful for an attacker: easy to install, leaves a backdoor on the system, covers the tracks of the user, and replaces system files with compromised binaries that are used to gather server intelligence. Tuxkit consists of several files and an installation script:

-rw------- 1 1209 1209 502884 Dec 4 2001 bin.tgz
-rw------- 1 1209 1209 406 Dec 4 2001 cfg.tgz
-rw------- 1 1209 1209 16213 Dec 4 2001 lib.tgz
-rw------- 1 1209 1209 3684 Dec 4 2001 README
-rw------- 1 1209 1209 461892 Jan 5 2002 sshd.tgz
-rw------- 1 1209 1209 1644819 Dec 4 2001 tools.tgz
-rwx------ 1 1209 1209 9489 May 15 14:59 tuxkit

For ease of use the installation script, Tuxkit, requires that only a single variable be changed:

#!/bin/sh
# Tuxtendo Linux Rootkit v1.0 By Argv[]

# Your e-mail address
EMAIL="allan@allan.org"

# You don't need to edit anything below this

All an attacker has to do is execute the install script. The attacker's tracks are covered and Tuxkit begins to gather information. It also sends a nice e-mail to the attacker with the IP address and backdoor information to the server:

ssh 192.168.0.40 -l root -p 4000 # test.allan.org password: R0s3ann3 psyBNC: 4001 

This allows Tuxkit to be used in an automated fashion: Load a large netblock into a security scanner, looking for exploitable servers; when a server is successfully compromised, install Tuxkit. The e-mail is sent to the attacker, who may be able to take control of several dozen servers in a few hours.

On a well-secured network, a rootkit should not go unnoticed very long. If unusual traffic is generated from a server, or an administrator notices that syslog is disabled, this should set off alarms. In addition, many administrators run chk-rootkit (www.chkrootkit.org/) to check for rootkit installations. Not only does chkrootkit look for specific rootkits, it also looks for modified files and alerts administrators that they have been modified. On a system infected with Tuxkit:

[root@test chkrootkit-pre-0.36]# ./chkrootkit
ROOTDIR is ´/'
Checking ´amd'... not found
Checking ´basename'... not infected
Checking ´biff'... not found
Checking ´chfn'... not infected
Checking ´chsh'... not infected
Checking ´cron'... not infected
Checking ´date'... not infected
Checking ´du'... INFECTED
Checking ´dirname'... not infected
Checking ´echo'... not infected
Checking ´egrep'... not infected
Checking ´env'... not infected
Checking ´find'... INFECTED
Checking ´fingerd'... not infected
Checking ´gpm'... not infected
Checking ´grep'... not infected
Checking ´hdparm'... not infected

While relatively easy to spot, rootkits are popular because, like some of their companion exploits, they can be quickly installed and manage many tasks that some attackers do not have the skills to perform.

  • + Share This
  • 🔖 Save To Your Account

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020