Home > Articles > Cisco Network Technology > General Networking > Cisco PIX: Advanced Features and Attack Guards

Cisco PIX: Advanced Features and Attack Guards

  • Sample Chapter is provided courtesy of Cisco Press.
  • Date: Dec 28, 2001.

Contents

  1. The Need for Advanced Protocol Handling
  2. Multimedia Support
  3. Attack Guards
  4. Summary
  5. Review Questions

Chapter Description

This sample chapter from Cisco Secure PIX Firewalls introduces the concepts and configuration elements of the Cisco Secure PIX Firewall features necessary to securely handle multichannel TCP applications. You will learn about advanced protocol handling, multimedia support, and attack guards.

From the Book

Cisco Secure PIX Firewalls

Cisco Secure PIX Firewalls

$35.00

With only a few exceptions, advanced protocol handling is accomplished via a mechanism called a fixup protocol. The fixup protocol command operates not as a true proxy but as an application aware agent. In most cases, the fixup protocol acts by monitoring the control channel of an application to prevent protocol violations and enable the PIX to respond dynamically to a protocol's legitimate need to open an inbound connection securely by making a temporary exception in the ASA. When the exception is no longer needed, the fixup protocol closes it. Each new version of the PIX OS brings new and improved protocol handling. It is important to note that the PIX can only perform these operations on the fixups that are part of the PIX OS running on your PIX. Fixups are not user-definable or user-programmable. Fixups allow you to enable or disable processing for the supported protocols and determine what ports (standard or non-standard) to operate on.

The Need for Advanced Protocol Handling

Nearly every enterprise uses the Internet for business transactions. For these enterprises to keep their internal networks secure from potential threats from the Internet, they must implement firewalls to separate their trusted internal networks from the untrusted Internet. Even though firewalls help protect an enterprise's internal networks from external threats, implementation challenges have arisen as well.

  • Some of the protocols and applications that enterprises used to communicate with outside resources prior to the installation of a firewall are now blocked by the firewall.

  • Many popular protocols and applications negotiate connections to dynamically assign source or destination ports or IP addresses. To further complicate matters, some applications embed source or destination IP addressing information above the network layer (Layer 3).

A good firewall must inspect packets above the network layer and perform the following operations as required by the protocol or application:

  • Securely open and close negotiated ports or IP addresses for legitimate client/server connections through the firewall.

  • Use Network Address Translation (NAT)-relevant instances of IP addresses inside a packet.

  • Use Port Address Translation (PAT)-relevant instances of ports inside a packet.

  • Inspect packets for signs of malicious application misuse.

Through the use of the Cisco Secure PIX Firewall's fixup protocol protocol commands, you can provide secure passage for these applications.

The sections that follow explain how the specific fixup protocol protocol commands for Standard and Passive File Transfer Protocol (FTP), rsh (Remote Shell), and SQL*Net operate and how to configure them.

Standard Mode FTP

Standard mode FTP (also called classic mode FTP) uses two channels for communication. When a client behind a firewall initiates an FTP connection from their host, it opens a standard TCP channel from one of its high-order ports (TCP source port >1023) to destination TCP port 21 on the outside server. This connection is referred to as the control channel. When the client requests data from the server, it tells the server to send the data to a given high-order port. The server acknowledges the request and initiates an inbound connection from its own port 20 to the high-order port that the client requested. This connection is referred to as the data channel (port 20 FTP-DATA).

In the past, it was difficult to allow this inbound connection through the firewall to the requested port on the client without permanently opening port 20 connections from outside servers to inside clients for outbound FTP connections. This creates a huge potential vulnerability by allowing any inbound traffic from any host on the Internet with a TCP source port of 20, regardless of the intent!

Example 9-1 and Figure 9-1 demonstrate the TCP three-way handshake and the establishment of the FTP control channel (TCP port 21). Notice that in the second section of the trace, the FTP-DATA channel is initiated by the server 198.10.2.51 (ftp.cisco.com) with a source port of 20 and a random high port of 1066 (selected by the client).

Example 9-1 Sniffer Trace Illustrating Classic Mode FTP

#Setup connection to destination port 21 for control channel

[10.10.2.51] [198.133.219.27] TCP: D=21 S=1065 SYN SEQ=1763920874 LEN=0

[198.133.219.27] [10.10.2.51] TCP: D=1065 S=21 SYN ACK=1763920875 SEQ=2208726475 LEN=0

[10.10.2.51] [198.133.219.27] TCP: D=21 S=1065 ACK=2208726476

 

#FTP server negotiates FTP-DATA channel with TCP source port 20

 

[10.10.2.51] [198.133.219.27] FTP: C PORT=1065 LIST

[198.133.219.27] [10.10.2.51] TCP: D=1066 S=20 SYN SEQ=2209373687 LEN=0

[10.10.2.51] [198.133.219.27] TCP: D=20 S=1066 SYN ACK=2209373688 SEQ=1765279364 LEN=0

[198.133.219.27] [10.10.2.51] TCP: D=1065 S=21 ACK=1763920967

[198.133.219.27] [10.10.2.51] TCP: D=1066 S=20 ACK=1765279365

[198.133.219.27] [10.10.2.51] FTP: R PORT=1065 150 ASCII mode data connection for /bin/ls.

[198.133.219.27] [10.10.2.51] FTP: R PORT=1066 Text Data


Figure 9-1 Standard Mode FTP Client/Server Transactions

The Cisco Secure PIX Firewall uses the fixup protocol ftp command to securely enable the exception required by the FTP-DATA connection. The Cisco Secure PIX Firewall handles FTP in the following manner for outbound and inbound connections:

  • Outbound Connections—When the client requests data, the PIX Firewall opens a temporary inbound conduit to allow the data channel from the server. This conduit is torn down immediately after the data is sent.

  • Inbound Connections—If a conduit exists allowing inbound connections to an FTP server, and if all outbound TCP traffic is implicitly allowed, no special handling is required because the server initiates the data channel from the inside.

    If a conduit exists allowing inbound FTP control connections to an FTP server, and if all outbound TCP traffic is not implicitly allowed, the PIX Firewall opens a temporary conduit for the data channel from the server. This conduit is torn down after the data is sent.

Passive Mode FTP

Passive mode FTP also uses two channels for communications. The control channel works the same as in a standard FTP connection, but the data channel setup works differently. When requesting data from the server, the client asks the server if it accepts PASV connections. If the server accepts PASV connections, it sends the client a high-order port number to use for the data channel. The client then initiates the data connection from its own high-order port to the port that the server sent.

Because the client initiates both the command and data connections, early firewalls could easily support this without exposing inside clients to attack. Figure 9-2 shows transactions between the client and server with passive mode FTP. Most web browsers use passive mode FTP by default.

Figure 9-2 Passive Mode FTP Client/Server Transactions

For passive mode FTP traffic, the PIX Firewall behaves in the following manner for outbound and inbound PASV connections:

  • Outbound PASV Connections—If all outbound TCP traffic is implicitly allowed, no special handling is required because the client initiates both the command and data channels from the inside.

    If all outbound TCP traffic is not implicitly allowed, the PIX Firewall opens a temporary conduit for the data channel from the client. This conduit is torn down after the data is sent.

  • Inbound PASV Connections—If a conduit exists allowing inbound FTP control connections to a PFTP server, the PIX Firewall opens a temporary inbound conduit for the data channel initiated by the client. This conduit is torn down after the data is sent.

fixup protocol FTP Command

The syntax of the fixup protocol ftp command is as follows:

where port[-port] is the single port or port range that the PIX Firewall will inspect for FTP connections.

By default, the fixup protocol ftp 21 command is enabled and the PIX Firewall inspects port 21 connections for FTP control traffic. If you have FTP servers using ports other than port 21, you need to use the fixup protocol ftp port-number command to have the PIX Firewall inspect these non-standard ports for FTP traffic. The strict option causes fixup protocol ftp to require that every FTP request be acknowledged before a new command is allowed and prevents web browsers from embedding commands in FTP requests. Any FTP packets containing embedded commands are dropped. Example 9-2 demonstrates the use of the fixup protocol ftp command and its no form to both configure and remove standard and non-standard ports for FTP.

Example 9-2 Configuring and Removing Standard and Non-standard Ports for FTP

pixfirewall#(config) fixup protocol ftp 2121

pixfirewall#(config) fixup protocol ftp 2001

pixfirewall#(config) no fixup protocol ftp 2121

pixfirewall#(config) no fixup protocol ftp 2001


The fixup protocol ftp command enables the PIX Firewall to perform the following operations for FTP traffic on the indicated port:

  • Perform NAT or PAT in packet payload.

  • Dynamically create conduits for FTP data connections.

  • Log FTP commands (when syslog is enabled and the logging level is debug).

Use the no form of the command as indicated in Example 9-2 to disable the inspection of traffic on the indicated port for FTP connections. If the fixup protocol ftp command is not enabled for a given port, then

  • Outbound standard FTP will not work properly on that port.

  • Outbound passive FTP will work properly on that port as long as outbound traffic is not explicitly disallowed.

  • Inbound standard FTP will work properly on that port if a conduit to the inside server exists.

  • Inbound passive FTP will not work properly on that port.

Using the clear fixup protocol ftp command without any arguments causes the PIX Firewall to clear all previous fixup protocol ftp assignments and set port 21 back as the default.

Remote Shell (rsh)

The rsh daemon running on a UNIX or Windows host provides remote execution facilities with authentication based on privileged port numbers from trusted hosts. Typically, the daemon checks the requesting client's source IP address and source port. The source port should be in the range of 512–1023; otherwise the service should abort the connection.

A second connection is then created from the rsh daemon to the specified port on the client's machine for standard error output.

The rsh daemon then validates the host/client name by checking the /etc/hosts.equiv and ~/.rhosts files. If the check fails, the connection is aborted and a diagnostic message is returned.

CAUTION

Many reconnaissance tools look for misconfigured rsh services as a first step to gain unauthorized access to your hosts. Because there are Windows ports of rsh available, this should no longer be considered a UNIX-only vulnerability. The safest approach to rsh is to prohibit inbound rsh connections from outside your network.

Figure 9-3 shows transactions between the client and server for rsh.

The fixup protocol rsh command enables the PIX Firewall to secure rsh requests in the following manner:

  • Outbound connections—When standard error messages are sent from the server, the PIX Firewall opens a temporary inbound conduit for this channel. This conduit is torn down once it is no longer needed.

  • Inbound connections—If a conduit exists allowing inbound connections to an rsh server, and if all outbound TCP traffic is implicitly allowed, no special handling is required because the server initiates the standard error channel from the inside.

    If a conduit exists allowing inbound connections to an rsh server, and if all outbound TCP traffic is not implicitly allowed, the PIX Firewall opens a temporary conduit for the standard error channel from the server. This conduit is torn down after the messages are sent.

Figure 9-3 rsh Client/Server Transactions

fixup protocol rsh Command

The syntax of the fixup protocol rsh command is as follows:

where port[-port] is the single port or port range that the PIX Firewall will inspect for rsh connections.

By default, the PIX Firewall inspects port 514 connections for rsh traffic. If you have rsh servers using ports other than port 514, use the fixup protocol rsh command as shown in Example 9-3 to instruct the PIX Firewall to inspect these other ports for rsh traffic.

Example 9-3 Configuring and Removing Standard and Non-Standard Ports for RSH

pixfirewall#(config) fixup protocol rsh 514

pixfirewall#(config) fixup protocol rsh 5141

pixfirewall#(config) no fixup protocol rsh 514

pixfirewall#(config) no fixup protocol rsh 5141


The fixup protocol rsh command enables the PIX Firewall to dynamically create conduits for rsh standard error connections for rsh traffic on the indicated port.

Use the no form of the command to disable the inspection of traffic on the indicated port for rsh connections.

If the fixup protocol rsh command is not enabled for a given port, then

  • Outbound rsh will not work properly on that port.

  • Inbound rsh will work properly on that port if a conduit to the inside server exists.

Using the clear fixup protocol rsh command without any arguments causes the PIX Firewall to clear all previous fixup protocol rsh assignments and set port 514 back as the default.

SQL*Net

SQL*Net is used to query remote SQL databases. Although the protocol was written by Oracle for Oracle databases, it works equally well to query the SQL databases of other vendors. The main issue to consider when securing SQL*Net is that while it only uses one TCP port for communications, that port can be redirected to a different port and, even more commonly, to a different secondary server altogether. When a client starts an SQL*Net connection, it opens a standard TCP channel from one of its high-order ports to port 1521 on the server. The server then proceeds to redirect the client to a different port or IP address. The client tears down the initial TCP connection and establishes the second connection using the redirected port.

NOTE

While the default port inspected by the fixup protocol sqlnet command is 1521, Oracle registered TCP and UDP port 66 with IANA (Internet Assigned Numbers Authority). You may be required to add fixup protocol 66 to your configuration to support your particular implementation. Please see the following web page for details: http://www.iana.org/cgi-bin/usr-port-number.pl

Figure 9-4 illustrates transactions between the client and the server for SQL*Net connections.

Figure 9-4 SQL*Net Client/Server Transactions

For SQL*Net traffic, the PIX Firewall behaves in the following manner:

  • Outbound connections—If all outbound TCP traffic is implicitly allowed, no special handling is required because the client initiates all TCP connections from the inside.

    If all outbound TCP traffic is not implicitly allowed, the PIX Firewall opens a conduit for the redirected channel between the server and the client.

  • Inbound connections—If a conduit exists allowing inbound SQL*Net connections to an SQL*Net server, the PIX Firewall opens an inbound conduit for the redirected channel.

fixup protocol sqlnet Command

The syntax of the fixup protocol sqlnet command is as follows:

fixup protocol sqlnet port [-port ]
no fixup protocol sqlnet port [-port ]
clear fixup protocol sqlnet

where port[-port] is a single port or port range that the PIX Firewall will inspect for SQL*Net connections.

By default, the PIX Firewall inspects port 1521 connections for SQL*Net traffic. If you have SQL*Net servers using ports other than port 1521, use the fixup protocol sqlnet command as illustrated in Example 9-4 to instruct the PIX Firewall to inspect these other ports for SQL*Net traffic.

Example 9-4 Adding and Removing Standard and Non-standard Ports for SQL*NET

pixfirewall#(config) fixup protocol sqlnet 1521

pixfirewall#(config) fixup protocol sqlnet 66

pixfirewall#(config) no fixup protocol sqlnet 1521

pixfirewall#(config) no fixup protocol sqlnet 66


The fixup protocol sqlnet command causes the PIX Firewall to do the following for SQL*Net traffic on the indicated port:

  • Perform NAT in packet payload.

  • Dynamically create conduits for SQL*Net redirected connections.

Use the no form of the command to disable the inspection of traffic on the indicated port for SQL*Net connections. If the fixup protocol sqlnet command is not enabled for a given port, then the following will occur:

  • Outbound SQL*Net will work properly on that port as long as outbound traffic is not explicitly disallowed.

  • Inbound passive SQL*Net will not work properly on that port.

Using the clear fixup protocol sqlnet command without any arguments causes the PIX Firewall to clear all previous fixup protocol sqlnet assignments and set port 1521 back as the default.

2. Multimedia Support | Next Section

Cisco Press Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Cisco Press 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 Cisco Press 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@ciscopress.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 Cisco Press. 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.ciscopress.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