<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article HTTP Tunneling and ACE in Data Center and Cloud Knowledge Base</title>
    <link>https://community.cisco.com/t5/data-center-and-cloud-knowledge-base/http-tunneling-and-ace/ta-p/3114986</link>
    <description>&lt;P&gt;&lt;LI-TOC indent="15" liststyle="disc" maxheadinglevel="2"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Introduction&lt;/H2&gt;&lt;P&gt;HTTP tunneling is a method in which non-legitimate data is sent using HTTP protocol. This is acheived using a client-server HTTP tunneling application, and is usually done to bypass the security provided by common firewalls, as firewalls usually allow HTTP traffic. A properly formatted HTTP packet is used which passes the standard HTTP checks and L4 firewalls. HTTP tunneling works with a host running the server side applciation. The outside user runs the client side applciation, which is used to send HTTP encapsulated communication to the server application. The server then interprets this information and opens the connection to the desired host, and this bypasses the security.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Real Servers and Server Farms&lt;/H2&gt;&lt;P&gt;To provide services to clients, you configure real servers (the actual physical servers) on the ACE. Real servers provide client services such as HTTP or XML content, hosting websites, FTP file uploads or downloads, redirection for web pages that have moved to another location, and so on. The ACE also allows you to configure backup servers in case a server is taken out of service for any reason.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Servers are organized into related groups called server farms. Servers within server farms often contain identical content (referred to as mirrored content) so that if one server becomes inoperative, another server can take its place immediately. Also, mirrored content allows several servers to share the load of increased demand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Blocking HTTP Tunnels&lt;/H2&gt;&lt;P&gt;Most standard firewalls cant block HTTP tunnels which are cleaverly disguised. Although firewalls do have HTTP inspection; it only checks for proper HTTP packet and header, which is there in HTTP tunnels. Several HTTP tunneling methods exist, like HTTP CONNECT, POST, GET, PUT, DELETE tunneling. To block this traffic requires a deeper packet inspection using custom regex. Custom regex is not possible in case of firewalls like PIX and FWSM&lt;/P&gt;&lt;P&gt;pixfirewall(config-cmap)# match request header ?&lt;/P&gt;&lt;P&gt;mpf-class-map mode commands/options:&lt;BR /&gt;&amp;nbsp; accept&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accept field&lt;BR /&gt;&amp;nbsp; accept-charset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accept-Charset field&lt;BR /&gt;&amp;nbsp; accept-encoding&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accept-Encoding field&lt;BR /&gt;&amp;nbsp; accept-language&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accept-Language field&lt;BR /&gt;&amp;nbsp; allow&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Allow field&lt;BR /&gt;&amp;nbsp; authorization&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Authorization field&lt;BR /&gt;…&lt;BR /&gt;pixfirewall(config-cmap)# match request header X-?&lt;BR /&gt;ERROR: % Unrecognized command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ACE/PIX/ASA come with a built-in “port-misuse” directive in HTTP inspection engine. But it doesn’t really help here. The engine looks for these fixed regexes:&lt;BR /&gt;FIRETHRO: "[/\\\\]cgi[-]bin[/\\\\]proxy"&lt;BR /&gt;HTTP_PORT: "[ \t]+photo[.]exectech[-]va[.]com"&lt;BR /&gt;UAGENT_GNUTELLA: "[Gg][Nn][Uu][Tt][Ee][Ll][Ll][Aa]"&lt;BR /&gt;YAHOO: "YMSG.*"&lt;BR /&gt;KAZAA: "[Xx][-][Kk][Aa][Zz][Aa][Aa].*“&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Configure ACE to block HTTP Tunneling&lt;/H2&gt;&lt;P&gt;Follow these steps to block HTTP tunneling using ACE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1)&lt;/STRONG&gt; Define a class-map that matches port 80:&lt;BR /&gt;switch/lab(config)# class-map match-any http&lt;BR /&gt;switch/lab(config-cmap)# match port tcp eq www&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;2)&lt;/STRONG&gt; Build header regexes: if we see both headers, match!&lt;BR /&gt;switch/lab(config)# class-map type http inspect match-all headers&lt;BR /&gt;switch/lab(config-cmap-http-insp)# match header X-Counter header-value .*&lt;BR /&gt;switch/lab(config-cmap-http-insp)# match header X-Session header-value .*&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;3)&lt;/STRONG&gt; Instruct ACE to drop packets that match the regex&lt;BR /&gt;switch/lab(config)# policy-map type inspect http all-match htpolicy&lt;BR /&gt;switch/lab(config-pmap-ins-http)# class headers&lt;BR /&gt;switch/lab(config-pmap-ins-http-c)# reset&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;4)&lt;/STRONG&gt; Apply the HTTP policy to port-80 traffic:&lt;BR /&gt;switch/lab(config)# policy-map multi-match nofirepass&lt;BR /&gt;switch/lab(config-pmap)# class http&lt;BR /&gt;switch/lab(config-pmap-c)# inspect http policy htpolicy url-logging&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;5)&lt;/STRONG&gt; Map the policy to the client-side interface:&lt;BR /&gt;switch/lab(config)# int vlan 20&lt;BR /&gt;switch/lab(config-if)# service-policy input nofirepass&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;SSL Tunneling&lt;/H2&gt;&lt;P&gt;Following is a sample configuration for SSL tunneling&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;parameter-map type http CASE_PARAM&lt;/P&gt;&lt;P&gt;&amp;nbsp; case-insensitive&lt;/P&gt;&lt;P&gt;&amp;nbsp; persistence-rebalance&lt;/P&gt;&lt;P&gt;&amp;nbsp; set header-maxparse-length 65535&lt;/P&gt;&lt;P&gt;&amp;nbsp; set content-maxparse-length 65535&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;class-map match-all CLEAR_TEXT_VIP&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2 match virtual-address 172.20.120.19 tcp eq www&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;policy-map multi-match JORGE-MULTIMATCH&lt;/P&gt;&lt;P&gt;&amp;nbsp; class CLEAR_TEXT_VIP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loadbalance vip inservice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loadbalance policy POLICY_TO_ENCRYPT_TRAFFIC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loadbalance vip icmp-reply active&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; appl-parameter http advanced-options CASE_PARAM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;policy-map type loadbalance first-match POLICY_TO_ENCRYPT_TRAFFIC&lt;/P&gt;&lt;P&gt;&amp;nbsp; class class-default&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; serverfarm ENCRYPTED-SERVERFARM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ssl-proxy client SSL-PROXY-JORGE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ssl-proxy service SSL-PROXY-JORGE&lt;/P&gt;&lt;P&gt;&amp;nbsp; key TAC-key&lt;/P&gt;&lt;P&gt;&amp;nbsp; cert TAC-cert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;serverfarm host ENCRYPTED-SERVERFARM&lt;/P&gt;&lt;P&gt;&amp;nbsp; rserver JORGE-SERVER 443&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inservice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Verify&lt;/H2&gt;&lt;P&gt;Check for the following ACE logs to verify if blocking is working fine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%ACE-6-302022: Built TCP connection 0x76 for vlan20:10.20.10.100/52431 (10.20.10.100/52431) to vlan100:10.10.10.101/80 (10.10.10.101/80)&lt;BR /&gt;%ACE-5-304001: User:10.20.10.100 Accessed URL 10.10.10.101:/cgi-bin/firepass-1.1.2a/fpserver/fpserver.cgi&lt;BR /&gt;%ACE-6-302023: Teardown TCP connection 0x76 for vlan20:10.20.10.100/52431 to vlan100:10.10.10.101/80 duration 0:00:00 bytes 508 &lt;STRONG&gt;Policy Close&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Aug 2017 12:15:15 GMT</pubDate>
    <dc:creator>Sandeep Singh</dc:creator>
    <dc:date>2017-08-29T12:15:15Z</dc:date>
    <item>
      <title>HTTP Tunneling and ACE</title>
      <link>https://community.cisco.com/t5/data-center-and-cloud-knowledge-base/http-tunneling-and-ace/ta-p/3114986</link>
      <description>&lt;P&gt;&lt;LI-TOC indent="15" liststyle="disc" maxheadinglevel="2"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Introduction&lt;/H2&gt;&lt;P&gt;HTTP tunneling is a method in which non-legitimate data is sent using HTTP protocol. This is acheived using a client-server HTTP tunneling application, and is usually done to bypass the security provided by common firewalls, as firewalls usually allow HTTP traffic. A properly formatted HTTP packet is used which passes the standard HTTP checks and L4 firewalls. HTTP tunneling works with a host running the server side applciation. The outside user runs the client side applciation, which is used to send HTTP encapsulated communication to the server application. The server then interprets this information and opens the connection to the desired host, and this bypasses the security.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Real Servers and Server Farms&lt;/H2&gt;&lt;P&gt;To provide services to clients, you configure real servers (the actual physical servers) on the ACE. Real servers provide client services such as HTTP or XML content, hosting websites, FTP file uploads or downloads, redirection for web pages that have moved to another location, and so on. The ACE also allows you to configure backup servers in case a server is taken out of service for any reason.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Servers are organized into related groups called server farms. Servers within server farms often contain identical content (referred to as mirrored content) so that if one server becomes inoperative, another server can take its place immediately. Also, mirrored content allows several servers to share the load of increased demand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Blocking HTTP Tunnels&lt;/H2&gt;&lt;P&gt;Most standard firewalls cant block HTTP tunnels which are cleaverly disguised. Although firewalls do have HTTP inspection; it only checks for proper HTTP packet and header, which is there in HTTP tunnels. Several HTTP tunneling methods exist, like HTTP CONNECT, POST, GET, PUT, DELETE tunneling. To block this traffic requires a deeper packet inspection using custom regex. Custom regex is not possible in case of firewalls like PIX and FWSM&lt;/P&gt;&lt;P&gt;pixfirewall(config-cmap)# match request header ?&lt;/P&gt;&lt;P&gt;mpf-class-map mode commands/options:&lt;BR /&gt;&amp;nbsp; accept&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accept field&lt;BR /&gt;&amp;nbsp; accept-charset&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accept-Charset field&lt;BR /&gt;&amp;nbsp; accept-encoding&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accept-Encoding field&lt;BR /&gt;&amp;nbsp; accept-language&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accept-Language field&lt;BR /&gt;&amp;nbsp; allow&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Allow field&lt;BR /&gt;&amp;nbsp; authorization&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Authorization field&lt;BR /&gt;…&lt;BR /&gt;pixfirewall(config-cmap)# match request header X-?&lt;BR /&gt;ERROR: % Unrecognized command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ACE/PIX/ASA come with a built-in “port-misuse” directive in HTTP inspection engine. But it doesn’t really help here. The engine looks for these fixed regexes:&lt;BR /&gt;FIRETHRO: "[/\\\\]cgi[-]bin[/\\\\]proxy"&lt;BR /&gt;HTTP_PORT: "[ \t]+photo[.]exectech[-]va[.]com"&lt;BR /&gt;UAGENT_GNUTELLA: "[Gg][Nn][Uu][Tt][Ee][Ll][Ll][Aa]"&lt;BR /&gt;YAHOO: "YMSG.*"&lt;BR /&gt;KAZAA: "[Xx][-][Kk][Aa][Zz][Aa][Aa].*“&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Configure ACE to block HTTP Tunneling&lt;/H2&gt;&lt;P&gt;Follow these steps to block HTTP tunneling using ACE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1)&lt;/STRONG&gt; Define a class-map that matches port 80:&lt;BR /&gt;switch/lab(config)# class-map match-any http&lt;BR /&gt;switch/lab(config-cmap)# match port tcp eq www&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;2)&lt;/STRONG&gt; Build header regexes: if we see both headers, match!&lt;BR /&gt;switch/lab(config)# class-map type http inspect match-all headers&lt;BR /&gt;switch/lab(config-cmap-http-insp)# match header X-Counter header-value .*&lt;BR /&gt;switch/lab(config-cmap-http-insp)# match header X-Session header-value .*&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;3)&lt;/STRONG&gt; Instruct ACE to drop packets that match the regex&lt;BR /&gt;switch/lab(config)# policy-map type inspect http all-match htpolicy&lt;BR /&gt;switch/lab(config-pmap-ins-http)# class headers&lt;BR /&gt;switch/lab(config-pmap-ins-http-c)# reset&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;4)&lt;/STRONG&gt; Apply the HTTP policy to port-80 traffic:&lt;BR /&gt;switch/lab(config)# policy-map multi-match nofirepass&lt;BR /&gt;switch/lab(config-pmap)# class http&lt;BR /&gt;switch/lab(config-pmap-c)# inspect http policy htpolicy url-logging&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;5)&lt;/STRONG&gt; Map the policy to the client-side interface:&lt;BR /&gt;switch/lab(config)# int vlan 20&lt;BR /&gt;switch/lab(config-if)# service-policy input nofirepass&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;SSL Tunneling&lt;/H2&gt;&lt;P&gt;Following is a sample configuration for SSL tunneling&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;parameter-map type http CASE_PARAM&lt;/P&gt;&lt;P&gt;&amp;nbsp; case-insensitive&lt;/P&gt;&lt;P&gt;&amp;nbsp; persistence-rebalance&lt;/P&gt;&lt;P&gt;&amp;nbsp; set header-maxparse-length 65535&lt;/P&gt;&lt;P&gt;&amp;nbsp; set content-maxparse-length 65535&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;class-map match-all CLEAR_TEXT_VIP&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2 match virtual-address 172.20.120.19 tcp eq www&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;policy-map multi-match JORGE-MULTIMATCH&lt;/P&gt;&lt;P&gt;&amp;nbsp; class CLEAR_TEXT_VIP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loadbalance vip inservice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loadbalance policy POLICY_TO_ENCRYPT_TRAFFIC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; loadbalance vip icmp-reply active&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; appl-parameter http advanced-options CASE_PARAM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;policy-map type loadbalance first-match POLICY_TO_ENCRYPT_TRAFFIC&lt;/P&gt;&lt;P&gt;&amp;nbsp; class class-default&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; serverfarm ENCRYPTED-SERVERFARM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ssl-proxy client SSL-PROXY-JORGE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ssl-proxy service SSL-PROXY-JORGE&lt;/P&gt;&lt;P&gt;&amp;nbsp; key TAC-key&lt;/P&gt;&lt;P&gt;&amp;nbsp; cert TAC-cert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;serverfarm host ENCRYPTED-SERVERFARM&lt;/P&gt;&lt;P&gt;&amp;nbsp; rserver JORGE-SERVER 443&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inservice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H2&gt;Verify&lt;/H2&gt;&lt;P&gt;Check for the following ACE logs to verify if blocking is working fine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%ACE-6-302022: Built TCP connection 0x76 for vlan20:10.20.10.100/52431 (10.20.10.100/52431) to vlan100:10.10.10.101/80 (10.10.10.101/80)&lt;BR /&gt;%ACE-5-304001: User:10.20.10.100 Accessed URL 10.10.10.101:/cgi-bin/firepass-1.1.2a/fpserver/fpserver.cgi&lt;BR /&gt;%ACE-6-302023: Teardown TCP connection 0x76 for vlan20:10.20.10.100/52431 to vlan100:10.10.10.101/80 duration 0:00:00 bytes 508 &lt;STRONG&gt;Policy Close&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 12:15:15 GMT</pubDate>
      <guid>https://community.cisco.com/t5/data-center-and-cloud-knowledge-base/http-tunneling-and-ace/ta-p/3114986</guid>
      <dc:creator>Sandeep Singh</dc:creator>
      <dc:date>2017-08-29T12:15:15Z</dc:date>
    </item>
  </channel>
</rss>

