<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title> &#187; proxy</title>
	<atom:link href="http://travisaltman.com/category/proxy/feed/" rel="self" type="application/rss+xml" />
	<link>http://travisaltman.com</link>
	<description></description>
	<lastBuildDate>Sat, 24 Mar 2012 04:16:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Download latest Metasploit behind restrictive firewalls</title>
		<link>http://travisaltman.com/download-latest-metasploit-behind-restrictive-firewalls/</link>
		<comments>http://travisaltman.com/download-latest-metasploit-behind-restrictive-firewalls/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 16:05:12 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[proxy]]></category>
		<category><![CDATA[tunnel]]></category>

		<guid isPermaLink="false">http://travisaltman.com/?p=99</guid>
		<description><![CDATA[Sometimes when you want to grab the bleeding edge version of software you&#8217;ll need to utilize subversion (SVN). You can go and read Wikipedia&#8217;s take on SVN but basically SVN can be used to grab the latest snapshot of software. Grabbing Metasploit through SVN is the best way to get the latest exploits, payload, scanners, [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when you want to grab the bleeding edge version of software you&#8217;ll need to utilize subversion (SVN). You can go and read <a title="wikipedia's da shit, again" href="http://en.wikipedia.org/wiki/Subversion_(software)">Wikipedia&#8217;s take on SVN</a> but basically SVN can be used to grab the latest snapshot of software. Grabbing Metasploit through SVN is the best way to get the latest exploits, payload, scanners, and auxiliary components. If you were to grab Metasploit from it&#8217;s main page you would be missing a lot of that functionality, this is where SVN comes into play. Unfortunately I&#8217;m not able to grab the latest version of Metasploit because my organization has restrictive firewalls and proxies preventing me from using the SVN protocol. So the best way around this problem is to wrap the application, SVN in this case, inside of a tunneled proxy for transporting. The best implementation I&#8217;ve found for doing that is using SOCKS proxies.</p>
<p>The basic goal of this article is to explain to others how to tunnel an application in a SOCKS proxy that doesn&#8217;t support SOCKS proxies. A SOCKS proxy is another network protocol but what&#8217;s special about SOCKS is that it doesn&#8217;t rely on the underlying packet to do it&#8217;s routing. SOCKS handles the routing and basically just creates an envelope for whatever it&#8217;s &#8220;wrapping up&#8221;. SOCKS can work with lots of protocols (HTTP, FTP, SMTP, etc) and lots of applications (Firefox, Internet Explorer, OpenSSH, etc). One useful example of using a SOCKS proxy is tunneling HTTP traffic through an SSH tunnel. This can be accomplished because both Firefox and SSH have support for SOCKS proxies. Refer to my earlier article concerning <a title="Tunneling HTTP over SSH" href="http://travisaltman.com/tunneling-http-thru-ssh/" target="_blank">tunneling HTTP over SSH</a>. One application / protocol that SOCKS does not work with is SVN, so then how can you tunnel SVN. <a title="Da bomb" href="http://proxychains.sourceforge.net/" target="_blank">Proxychains</a> to the rescue.</p>
<p>Proxychains is the coolest thing since sliced bread. If an application doesn&#8217;t support SOCKS then Proxychains will make it support SOCKS. Proxychains basically SOCKSifies applications. The main reason to SOCKSify an application is so that you can tunnel it through SSH because SSH supports SOCKS. So how do you download Metasploit through restrictive firewalls? The answer is ProxyChains + SVN + SSH = latest Metasploit. So enough with the yip yapping how does all this work, below are instructions.</p>
<p><strong>Requirements</strong></p>
<ol>
<li>Internet facing listening SSH server</li>
<li>Linux client (client being your laptop or desktop) with SSH</li>
<li>Proxychains on client</li>
<li>SVN on client</li>
</ol>
<p>You may could perform all of these steps in Windoze but why would you? Besides all of my instructions will be Linux based. Once you&#8217;ve got Proxychains installed (see proxychains INSTALL file) the next thing to do is edit it&#8217;s config file proxychains.conf. In my situation all I had to modify were two lines. I first commented out the line that says dynamic_chain as seen below.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># The option below identifies how the ProxyList is treated.<br />
# only one option should be uncommented at time,<br />
# otherwise the last appearing option will be accepted<br />
#<br />
dynamic_chain<br />
#</div></div>
<p>Next we&#8217;ll tell proxychains to use our localhost as the proxy and which port to connect to. At the very bottom of your conf file you&#8217;ll need to add the following.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[ProxyList]<br />
# add proxy here ...<br />
# meanwile<br />
# defaults set to &quot;tor&quot;<br />
socks5 &nbsp;127.0.0.1 4545</div></div>
<p>I randomly chose port 4545. I usually choose a port higher than 1024 because you don&#8217;t need root privileges to use higher ports. Now your proxychains config file is set. Now let&#8217;s create the ssh tunnel.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ssh username@sshServerIPaddress &nbsp;-D 4545</div></div>
<p>In my case it would be</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ssh travis@74.208.13.81 &nbsp;-D 4545</div></div>
<p>The -D flag tells ssh to listen on your localhost (127.0.0.1) and forward that connection to your remote host, in my case 74.208.13.81. Now that you&#8217;ve got proxychains configured and your ssh tunnel is up and running you&#8217;re ready to go. We don&#8217;t need to configure SVN we just need to have the client installed. So now that you&#8217;ve got everything up and running simply issue the command below to download the latest Metasploit.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">proxychains svn co https://metasploit.com/svn/framework3/trunk/</div></div>
<p>What this final command will do is use proxychains to wrap the SVN protocol into your ssh tunnel thus allowing you to download the latest version of Metasploit behind a restrictive firewall, pretty nifty huh.</p>
<p>Keep in mind this will download metasploit into whatever directory you happen to be in. If for example you wanted to download metasploit into your home directory (e.g /home/travis) then issue the following command.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">proxychains svn co https://metasploit.com/svn/framework3/trunk/ &nbsp;/home/travis</div></div>
<p>Also keep in mind that in the above examples proxychains is assumed to be a recognized command and is set in your path. I installed proxychains in my /opt directory so I had to issue the proxychains command below.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/opt/proxychains-3.1/proxychains/proxychains svn co https://metasploit.com/svn/framework3/trunk/</div></div>
<p>Happy sploiting and downloading, hope this explanation helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/download-latest-metasploit-behind-restrictive-firewalls/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Intro Video Tutorial for Webscarab</title>
		<link>http://travisaltman.com/intro-video-tutorial-for-webscarab/</link>
		<comments>http://travisaltman.com/intro-video-tutorial-for-webscarab/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 03:57:20 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[proxy]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://travisaltman.com/intro-video-tutorial-for-webscarab/</guid>
		<description><![CDATA[I have finally gotten around to posting a video tutorial of Webscarab. This tutorial merely covers the basics on Webscarab and is a mirror reflection of my written tutorial, Webscarab Tutorial Part 1 (learning the basics). I plan on continuing this video series as I did with my written tutorials. I have always been a [...]]]></description>
			<content:encoded><![CDATA[<br /><img src="/wp-content/webscarabBasics.jpg" alt="media" /><br />
[See post to watch Flash video]
<p>I have finally gotten around to posting a video tutorial of Webscarab. This tutorial merely covers the basics on Webscarab and is a mirror reflection of my written tutorial, <a href="http://travisaltman.com/webscarab-tutorial-part-1-learning-the-basics/">Webscarab Tutorial Part 1 (learning the basics)</a>. I plan on continuing this video series as I did with my written tutorials. I have always been a fan of video tutorials because they cut right to the chase and show the exact steps how something is performed. I have always frequented the videos on <a href="http://www.irongeek.com/i.php?page=security/hackingillustrated">Iron Geek</a> and <a href="http://www.milw0rm.com/video/">Milw0rm</a> which have been great resources as well. Don&#8217;t forget to <strong>maximize the video</strong> in the bottom right hand corner of the player, otherwise the video is pointless because you wouldn&#8217;t be able to see anything.</p>
<p>The video seems to have some background noise from the audio recording, if anyone has a suggestion for making a better recording I&#8217;m all ears. I recorded the screen cast with <a href="http://www.irongeek.com/CamStudioOSS/camstudiosetup20.zip">CamStudio</a> but I also tried <a href="http://recordmydesktop.iovar.org/about.php">Record My Desktop</a> in Linux. I wanted to use Record My Desktop but it was even worse. It could have been my cheap <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16826106932">Logitech microphone</a> that was the root cause of the problem? Please post feedback and let me know if these videos are useful, your feedback will determine what content I post in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/intro-video-tutorial-for-webscarab/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	<enclosure url="/wp-content/webscarabBasics.flv" length="1" type="video/x-flv"/>
	</item>
		<item>
		<title>Webscarab Tutorial Part 3 (fuzzing)</title>
		<link>http://travisaltman.com/webscarab-tutorial-part-3-fuzzing/</link>
		<comments>http://travisaltman.com/webscarab-tutorial-part-3-fuzzing/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 15:30:45 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[SQL injection]]></category>

		<guid isPermaLink="false">http://travisaltman.com/webscarab-tutorial-part-3-fuzzing/</guid>
		<description><![CDATA[Part 2 covered the neat functionality of session ID analysis within Webscarab.  Now we&#8217;ll focus on another great function within Webscarab, fuzzing.  I define fuzzing as testing the input of an application by trying various parameters that the input may not expect.  These parameters don&#8217;t have to be random, in my opinion [...]]]></description>
			<content:encoded><![CDATA[<p>Part 2 covered the neat functionality of session ID analysis within Webscarab.  Now we&#8217;ll focus on another great function within Webscarab, fuzzing.  I define fuzzing as testing the input of an application by trying various parameters that the input may not expect.  These parameters don&#8217;t have to be random, in my opinion it&#8217;s best when you tailor your parameters depending on the application.  When fuzzing you typically want to inject &#8220;command &amp; control&#8221; parameters into the input to find the most serious vulnerability.  For example if a web application is expecting a social security number I may inject html parameters such as &#8221; &lt; / &gt; &#8221; to manipulate the look, feel, and operation of a web application.  I don&#8217;t want to delve a whole lot into fuzzing because there are books out there that talk about this one subject.  This tutorial is going to focus on using Webscarab to fuzz web applications and find vulnerabilities.  Hopefully by the end of this tutorial you will better understand the technical aspects of fuzzing as oppose to the concept of fuzzing, but more reading on fuzzing web applications may be required.</p>
<p><span id="more-50"></span></p>
<p>This tutorial will once again be targeting Foundstone&#8217;s Hacme Casino which intentionally has vulnerabilities built into the application.  Fuzzing can focus on different types of vulnerabilities and parameters within web applications (e.g. XSS, SQL injection, queries, directory paths, etc&#8230;), although this tutorial will focus on parameters vulnerable to SQL injection.  Foudstone&#8217;s documentation lets us know that the username input is vulnerable to SQL injection so we can try fuzzing it with Webscarab to find other possible injections.  First we&#8217;ll try and login with the username &#8216;test&#8217; and password &#8216;test&#8217;.  This can be seen in Figure 1.</p>
<p align="center"> <a href="http://travisaltman.com/wp-content/loginhacmecasinowithusernametest.png" title="Try logging into Hacme Casino"><img src="http://travisaltman.com/wp-content/loginhacmecasinowithusernametest.png" alt="Try logging into Hacme Casino" /></a></p>
<p align="center">Figure 1: Trying to login</p>
<p>This will not log us into the application but Webscarab will capture the login process in the summary tab.  Once this has happened find the login conversation in the summary tab.  After you have found the login conversation simply right click and select &#8220;Use as fuzz template&#8221;, this will send the parameters and headers associated with that request / conversation to the fuzzing tab.  Selection of the login request can be seen in Figure 2.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/rightclickuseasfuzztemplateforhacmecasinologin.png" title="Right click request to use as a fuzz template"><img src="http://travisaltman.com/wp-content/rightclickuseasfuzztemplateforhacmecasinologin.png" alt="Right click request to use as a fuzz template" /></a></p>
<p align="center">Figure 2: Send conversation to fuzz template</p>
<p align="left">Now navigate to the Fuzzer tab within Webscarab.  Here you&#8217;ll see all the parameters that are associated with that request / conversation.  You could add parameters to the request and see how the web application reacts to different paths, value, or types.  You could also delete parameters for simplicity and to also see how the application reacts with those parameters missing.  Once you have determined the parameters for fuzzing you&#8217;ll need to define a fuzz source.  So click on the &#8220;Sources&#8221; button beside &#8220;Start&#8221; and &#8220;Stop&#8221; within the Fuzzer tab.  Here you will choose a dictionary style text file that contains parameters you want to fuzz with.  I chose a SQL injection dictionary because we know the &#8220;username&#8221; field is vulnerable to SQL injections.  The selection of the SQL injection dictionary can be seen in Figure 3.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/pickingsqlinjectionfuzzsources.png" title="Choosing SQL injection dictionary as a fuzz source"><img src="http://travisaltman.com/wp-content/pickingsqlinjectionfuzzsources.png" alt="Choosing SQL injection dictionary as a fuzz source" /></a></p>
<p align="center">Figure 3: Choosing fuzz source</p>
<p align="left">In my SQL injection dictionary I have 66 items, but Webscarab does not have a limit.  There are lots of SQL injection dictionaries out there, some are even dedicated towards different platforms (e.g. MySQL, MS SQL Server, DB2, etc&#8230;).  I got most of my SQL attacks from Andres Andreu&#8217;s website <a href="http://www.neurofuzz.com/">Neurofuzz</a>, the dictionary I pulled from can be found <a href="http://www.neurofuzz.com/modules/software/wsfuzzer/All_attack.txt">here</a>.  In this tutorial we won&#8217;t be trying to fuzz for XSS vulnerabilities but <a href="http://ha.ckers.org/">ha.ckers.org</a> has a now infamous <a href="http://ha.ckers.org/xss.html">XSS dictionary</a> which is a great resource.  Once all dictionary sources are added go to the main Fuzzer tab and assign parameters a fuzz source.  This can be done via a drop down menu as seen in Figure 4.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/choosesqlinjectionfuzzsourcefromdropdownlist.png" title="Choosing fuzz source for each parameter"><img src="http://travisaltman.com/wp-content/choosesqlinjectionfuzzsourcefromdropdownlist.png" alt="Choosing fuzz source for each parameter" /></a></p>
<p align="center">Figure 4: Drop down menu containing fuzz source</p>
<p align="left">In order to prevent a parameter from being fuzzed simply leave the &#8220;Fuzz Source&#8221; field blank or delete the parameter altogether.  In this case the &#8220;user_login&#8221; is the only parameter that will reiterate through the SQLattack dictionary.  The next step is to click on &#8220;Start&#8221; and let Webscarab try all of your parameters within the dictionary.  This means the value &#8220;test&#8221; will be replaced with values inside the SQL injection attack dictionary and new request  is sent to the web server for every attack parameter inside your dictionary.  The fuzzer in action can be seen in Figure 5.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/runningfuzzerandwatchingrequests.png" title="Running the fuzzer"><img src="http://travisaltman.com/wp-content/runningfuzzerandwatchingrequests.png" alt="Running the fuzzer" /></a></p>
<p align="center">Figure 5: Running the fuzzer</p>
<p align="left">Notice the &#8220;Total Requests&#8221; and the &#8220;Current Request&#8221;, once the fuzzer has run through all of the parameters in the SQL injection dictionary both of these numbers will be 68.  Also notice the ID number 97 on the left hand side of the table, this is the first request of the fuzzing operation.  The last request will have an ID number of 164, it&#8217;s important to keep track of these request ID&#8217;s when reviewing results of the fuzzing operation.  I have found myself reviewing requests that weren&#8217;t fuzzed and accidentally identified requests as not being vulnerable when in fact they were.</p>
<p align="left">Once the fuzzer has made all of the requests a review of the results is needed to see if any of the attack parameters succeeded in a SQL injection.  I do this simply by going back to the summary tab and opening up the first conversation of the fuzzing process.  I then manually step through every conversation involved in the fuzzing operation and look for any &#8220;interesting differences&#8221; between responses.  The phrase interesting differences is in quotation marks because fuzzing and looking for SQL injections is not an exact science but knowing how an application normally deals with the input will be helpful in determining what should and should not be expected in a HTTP response.  Let&#8217;s take a look at some of our fuzzing conversations to get a better idea of discovering differences.  Have a look at the first fuzzing request, note the value of the &#8220;user_login&#8221; parameter in the request and the value of the &#8220;Location&#8221; in the response.  This can be seen in Figure 6.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/nosqlinjectionfuzzparameterconversation97markedup.png" title="First fuzzed conversation"><img src="http://travisaltman.com/wp-content/nosqlinjectionfuzzparameterconversation97markedup.png" alt="First fuzzed conversation" /></a></p>
<p align="center">Figure 6: First fuzzed conversation</p>
<p align="left">Here it&#8217;s seen that the first value in the attack dictionary was actually used for the username value, good to know Webscarab is functioning properly.  The top of Figure 6 shows that a POST request is sent to /account/login to check the credentials of the user, since the first SQL injection is not a valid user the response is to redirect back to the login screen.  Keep in mind when looking at these conversation screen shots that the top half of the figure is the request and the lower half is the response.  It can be deferred from this conversation that if an invalid username is inserted into the web application the response will be a redirect to the login screen.  So when looking through the other SQL injected conversations it would be a good idea to look for a redirect to another location or an error message.  It&#8217;s always a good idea to look for database error messages when trying to find SQL injection vulnerabilities within a web application.  Stepping through the other conversations I notice something different, this can be seen in Figure 7.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/sqlinjectionfuzzparameterconversation103withredtext.png" title="Successful SQL injection"><img src="http://travisaltman.com/wp-content/sqlinjectionfuzzparameterconversation103withredtext.png" alt="Successful SQL injection" /></a></p>
<p align="center">Figure 7: SQL injection changed redirect location</p>
<p align="left">Looks like on conversation 103 one of the SQL injections in the attack dictionary changed the location of the redirect to /lobby/games.  Let&#8217;s throw the injection value back into the web application and see what the response may be.  The request can be seen in Figure 8.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/sqlinjectiononusernamewithcommentsatendofinjection.png" title="SQL injection on Hacme Casino username"><img src="http://travisaltman.com/wp-content/sqlinjectiononusernamewithcommentsatendofinjection.png" alt="SQL injection on Hacme Casino username" /></a></p>
<p align="center">Figure 8: SQL injection request on Hacme Casino</p>
<p align="left">The response to this SQL injection can be seen below in Figure 9.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/aftersqlinjectionviawebinterface.png" title="Successful SQL injection"><img src="http://travisaltman.com/wp-content/aftersqlinjectionviawebinterface.png" alt="Successful SQL injection" /></a></p>
<p align="center">Figure 9: SQL injection response (Great success!)</p>
<p align="left">Looks like the SQL injection gave us access to Andy Aces&#8217; account.  This occurred because we added the phrase &#8220;or 1=1&#8243; (which is always true) to the end of the SQL query that authenticates the users to Hacme Casino.  The reason Andy Aces&#8217; account was hijacked is because his name is the first one in the database.  Guess having the last name Altman could be bad for me as well?  Looking through the other conversations there appears to be another SQL injection that worked as well, this can be seen in Figure 10.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/sqlinjectionfuzzparameterconversation117withredtext.png" title="Another successful SQL injection"><img src="http://travisaltman.com/wp-content/sqlinjectionfuzzparameterconversation117withredtext.png" alt="Another successful SQL injection" /></a></p>
<p align="center">Figure 10: Another successful SQL injection</p>
<p align="left">The hits just keep on coming.  This may seem to easy but there are plenty of web applications out in the wild that don&#8217;t validate input and let malicious users manipulate their application and backend databases.  SQL injections within a web application can be a serious vulnerability depending on the data held within the database.  Had this scenario been real a malicious user could have taken over Andy Aces&#8217; account and had his way inside the online casino.</p>
<p align="left">The fuzzing functionality of Webscarab makes web application vulnerability assessment a more automated process.  Manually entering all of those SQL injection attacks can take a very long time.  There is a downside to the dictionary approach though, your dictionary may not be as creative as a malicious user.  Some people believe that a fuzzer should generate random input and that you should try thousands of requests in order to properly test a web application.  Thousands of random requests could be better but stepping through those requests to determine validity can make for a long day.  Although if one were to take the random input approach Webscarab has a solution for stepping through those results, the Compare and Search functionality.  I may dive into the Compare and Search functionality at a later date, these functions can really speed up the process of web vulnerability assessment.  Also keep your eye open for a video tutorial of Webscarab coming soon, you could always subscribe to my feed for the latest and greatest.</p>
<p align="left">Once again I hope this tutorial was helpful in showing you the great features of Webscarab, as always your comments and feedback are welcomed.</p>
<p align="left">travis@home:~$ more references</p>
<p align="left"><a href="http://www.owasp.org/index.php/Fuzzing_with_WebScarab">Owasp Webscarab fuzzing tutorial</a></p>
<p align="left"><a href="http://dawes.za.net/rogan/webscarab/docs/">Rogan Dawes documentation for Webscarab</a></p>
<p align="left"><a href="http://www.foundstone.com/us/resources/proddesc/hacmecasino.htm">Foundstone Hacme Casino</a></p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/webscarab-tutorial-part-3-fuzzing/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Webscarab Tutorial Part 2 (sessiond ID analysis)</title>
		<link>http://travisaltman.com/webscarab-tutorial-part-2-sessiond-id-analysis/</link>
		<comments>http://travisaltman.com/webscarab-tutorial-part-2-sessiond-id-analysis/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 17:18:49 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://travisaltman.com/webscarab-tutorial-part-2-sessiond-id-analysis/</guid>
		<description><![CDATA[Part 1 of this series focused on the basics of using a HTTP proxy to assess a web application.  I encourage people to play around with HTTP proxies with a web application that they use frequently, it&#8217;s interesting to see what information is being passed between the client and server.  This communication can [...]]]></description>
			<content:encoded><![CDATA[<p>Part 1 of this series focused on the basics of using a HTTP proxy to assess a web application.  I encourage people to play around with HTTP proxies with a web application that they use frequently, it&#8217;s interesting to see what information is being passed between the client and server.  This communication can sometimes include your private information so it&#8217;s good to understand how that particular web application is handling your information.</p>
<p><span id="more-38"></span></p>
<p>Part 2 in this series is going to focus on session ID analysis.  If you are not familiar with session ID&#8217;s I&#8217;ll do a quick explanation.  HTTP is a stateless protocol, so it&#8217;s equivalent to walkie talkies or CB radios.  You&#8217;ll send a request and wait for a reply, you don&#8217;t have a constantly open communication line as you would with a phone.   So in order to emulate this open communication the HTTP protocol uses session ID&#8217;s, commonly known as cookies.  These cookies are simply agreements between you and the web application that you are who you claim to be.  Once you have exchanged your cookie with the website you can then talk back and forth as long as the cookie is tied to your communication.  So there&#8217;s the quick and dirty intro to session ID&#8217;s.  So the next logical question is how does this session ID process work or even better how should it work?  Let&#8217;s use a web mail application as an example:</p>
<ol>
<li>You login to your web mail account</li>
<li>Your web mail provider sends you a &#8220;<strong>random</strong>&#8221; cookie that is tied to your login session</li>
<li>Each time you click on a new message within your Inbox your cookie is sent along to validate who you claim to be, that way you&#8217;ll get your next message and not another person&#8217;s message.</li>
</ol>
<p>These are the basic steps.  The main thing to remember is that your login credentials are tied to the session ID / cookie.  So the key to keeping your conversations private is protecting the session ID and making it hard to guess.  Session ID&#8217;s are similar to passwords in that regard, you always want to keep them a secret and make them hard to guess.  When Webscarab analyzes the session ID it only focuses on if the session is easy or hard to guess (aka <strong>randomness</strong>).  So enough with the chit chat let&#8217;s see how Webscarab analyzes session ID&#8217;s.</p>
<p>Once again we&#8217;re going to be analyzing the Hacme Casino web application.  The login page for this application can be seen in Figure 1.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/hacmecasinologinpage.PNG" title="Hacme Casino Login Page"><img src="http://travisaltman.com/wp-content/hacmecasinologinpage.PNG" alt="Hacme Casino Login Page" /></a></p>
<p align="center">Figure 1: Hacme Casino login</p>
<p align="left">So with Webscarab already running in the background I&#8217;ll go ahead and login into Hacme Casino and click on a few links.  Navigating inside the application will generate requests and responses that we can later analyze.  Now the login process should generate a session ID but there could be other session ID&#8217;s generated within the application that you may want to analyze as well.  You could always keep an eye on the summary tab to see if you are capturing cookies.  There are other ways to maintain state within a web application but cookies are the most common.  When looking at the summary tab for the login process you can see that cookies are being set.  This can be seen in the first conversation in the bottom row on Figure 2.</p>
<p align="center"><a href="http://travisaltman.com/wp-content/summaryhacmeloginviawebscarab.PNG" title="Webscarab summary of Hacme Casino login process"><img src="http://travisaltman.com/wp-content/summaryhacmeloginviawebscarab.PNG" alt="Webscarab summary of Hacme Casino login process" /></a></p>
<p align="center">Figure 2: Login process for Hacme Casino</p>
<p align="left">So the conversation with the path /account/login is setting a cookie, also the top pane has a check mark indicating that the login URL is setting a cookie as well.  This is definitely a good target because we know the functionality of this session ID is to maintain my balance and gambling stats.  Some session ID&#8217;s can be tough to figure out and sometimes it seems like developers set cookies for no reason.  So now let&#8217;s walk through the steps to analyze the session ID associated with /account/login.</p>
<ol>
<li><strong>Log out of the current session.</strong>  I can&#8217;t stress this enough, the first time I was using this feature I bumbled around for a couple of hours trying to figure out why it wasn&#8217;t analyzing the sessions.  Further down in this article I&#8217;ll show you a screen shot of what it looks like when you try and analyze the session you are currently logged into.</li>
<li>Navigate to the Session ID Analysis tab &gt;&gt; Collection tab within Webscarab.  There you will see a drop down list labeled &#8220;Previous Requests&#8221;, here you can pick a conversation from your history of transactions within the web application to analyze.  We already know that we want to analyze the /account/login conversation because we saw that it was setting cookies.  If you were unsure which conversation used session ID&#8217;s you could click on the &#8220;Test&#8221; button to verify if session information existed.  Figure 3 shows a screen shot of me choosing the /account/login conversation for analysis.</li>
<p align="center"><a href="http://travisaltman.com/wp-content/sessionidcollectiontab.PNG" title="Choosing conversation with the Session ID &gt;&gt; Collection tab"><img src="http://travisaltman.com/wp-content/sessionidcollectiontab.PNG" alt="Choosing conversation with the Session ID &gt;&gt; Collection tab" /></a></p>
<p align="center">Figure 3: Choosing conversation in Collection tab</p>
<li>After you have chosen your conversation for analysis you will then click on the &#8220;Fetch&#8221; button to start collecting session ID&#8217;s from the web server.  The default number of session ID&#8217;s collected is set at 100 but you can choose more if you like.  My background is math and science so I&#8217;m of the opinion that you can never have to many data points.  Play with this number if you like, in my experience more samples will do a better job at producing trends and pointing out weaknesses in random number generation.  The law of diminishing returns will eventually kick in though.  So after you have clicked the &#8220;Fetch&#8221; button you will need to move over to the &#8220;Analysis&#8221; tab.  When you first click on the &#8220;Analysis&#8221; tab it may seem like nothing is happening, this is because you need to select your session ID from the &#8220;Session Identifier&#8221; drop down list.  This drop down list can be seen in Figure 4.</li>
<p align="center"> <a href="http://travisaltman.com/wp-content/sessionidanalysistab.PNG" title="Session ID analysis tab"><img src="http://travisaltman.com/wp-content/sessionidanalysistab.PNG" alt="Session ID analysis tab" /></a></p>
<p align="center">Figure 4: Choosing session in Analysis tab</p>
<blockquote></blockquote>
<p align="left">Once you have selected your session that you are analyzing the table should begin to populate with the number of samples that you chose in the Collection tab.  Webscarab takes the session ID&#8217;s found within the web application and converts them into numbers so that they can be easily parsed.  These numbers are then compared to one another for predictability.  Figure 5 below shows what happens when you try to analyze the current session, you&#8217;ll get zeros for both the Numeric value and the difference.  This is because the session ID / cookie stays the same.</p>
<blockquote></blockquote>
<p align="center"> <a href="http://travisaltman.com/wp-content/chosecurrentsessionforanalysis.PNG" title="Choosing session for analysis"><img src="http://travisaltman.com/wp-content/chosecurrentsessionforanalysis.PNG" alt="Choosing session for analysis" /></a></p>
<p align="center">Figure 5: Analyzing current session</p>
<p align="left">&nbsp;</p>
<li>The fourth and final step is neatest part of the session ID analysis functionality within Webscarab, the Visualization tab.  This tab creates a graph using the numbers from the Analysis tab.  This will give you a quick visual representation of how weak or strong the session ID&#8217;s are.  The graphical analysis of the Hacme Casino session ID&#8217;s can be seen below in Figure 6.</li>
</ol>
<p align="center"><a href="http://travisaltman.com/wp-content/cookiesovertimegraph.PNG" title="Cookies over time graph"><img src="http://travisaltman.com/wp-content/cookiesovertimegraph.PNG" alt="Cookies over time graph" /></a></p>
<p align="center">Figure 6: Cookies over time for Hacme Casino</p>
<blockquote>
<p align="left">It appears that the session ID&#8217;s created for Hacme Casino are random or at the very least not easy to guess.  Your average malicious user is going to see that the session ID&#8217;s are going to be difficult to guess, so they&#8217;ll move on and try another vector to get inside the web application.  A malicious user will be looking for easy access so they will be looking for session ID&#8217;s that are very easy to guess.  Figure 7 shows an application that implements session ID&#8217;s that are very easy to guess.</p>
</blockquote>
<p align="center"> <a href="http://travisaltman.com/wp-content/weakcookiesovertime.JPG" title="Weak cookies over time"><img src="http://travisaltman.com/wp-content/weakcookiesovertime.JPG" alt="Weak cookies over time" /></a></p>
<p align="center">Figure 7: Weak cookies over time</p>
<blockquote>
<p align="left">This graph was not generated using Foundstone&#8217;s Hacme Casino but had a malicious user seen this type of graph it would be very easy for them to guess a session ID and essentially hijack that person&#8217;s Hacme Casino account.  From the casino example you can see how dangerous weak session ID&#8217;s can be.  Session ID&#8217;s are the &#8220;key&#8221; to someone&#8217;s account information.  This is possible due to the stateless nature of HTTP.  So a malicious user could hijack your account without ever knowing your username or password.</p>
</blockquote>
<p align="left">This concludes Part 2 of the Webscarab tutorial.  If you have something to add or see an error please leave a comment or contact me.  Part 3 is going to focus on the fuzzing functionality within Webscarab.  Until then try the session ID functionality on a web application that you use often and see how weak or strong their session ID management is.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/webscarab-tutorial-part-2-sessiond-id-analysis/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Webscarab Tutorial Part 1 (learning the basics)</title>
		<link>http://travisaltman.com/webscarab-tutorial-part-1-learning-the-basics/</link>
		<comments>http://travisaltman.com/webscarab-tutorial-part-1-learning-the-basics/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 11:54:20 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://travisaltman.com/webscarab-tutorial-part-1-learning-the-basics/</guid>
		<description><![CDATA[This tutorial is designed to walk you through the basics of using a HTTP proxy. A HTTP proxy is very useful when it comes to web application vulnerability assessment. A proxy will allow you to record all of your transactions while using the web application producing a history of pages you have visited and links [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">This tutorial is designed to walk you through the basics of using a HTTP proxy.<span> </span>A HTTP proxy is very useful when it comes to web application vulnerability assessment.<span> </span>A proxy will allow you to record all of your transactions while using the web application producing a history of pages you have visited and links you have clicked.<span> </span>A proxy also allows you to see the HTTP request and responses, basically you&#8217;ll see what is being sent behind the scenes.<span> </span>This document will go into more detail about what a HTTP proxy can do as we step through some exercises on analyzing traffic from a web application.</p>
<p><span id="more-30"></span></p>
<p class="MsoNormal">This tutorial is going to focus on Webscarab, although there are other numerous useful tools on the market (e.g. Paros, Burp).<span> </span>The first thing we&#8217;ll need to do is obtain Webscarab, I like to use the version signed by Rogan Dawes, <span> </span>which can be found <a href="http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project">here</a>.<span> </span>Go to the downloads section and make sure you get the Java Web Start version signed by Rogan Dawes.<span> </span>The second thing we&#8217;ll need to do is start up Webscarab.<span> </span>By default Webscarab listens on port 8008 but this can be easily changed to any port.<span> </span>These settings can be seen in Figure 1.</p>
<p class="MsoNormal"><a title="Webscarab proxy port settings" href="http://travisaltman.com/wp-content/webscarabproxysettings.JPG"><img src="http://travisaltman.com/wp-content/webscarabproxysettings.JPG" alt="Webscarab proxy port settings" /></a></p>
<p class="MsoNormal"><span style="font-size: 12pt; font-family: 'Times New Roman';">Figure 1: Webscarab proxy settings</span></p>
<p class="MsoNormal">We&#8217;ll also need to configure our browser so that our communication is pointed through the proxy.  In recent versions of Firefox the path should be Tools &gt;&gt; Options &gt;&gt; Advanced Tab &gt;&gt; Network Tab &gt;&gt; Settings. Once there you&#8217;ll need to highlight &#8220;Manual proxy configuration&#8221;, then for &#8220;HTTP Proxy&#8221; type in &#8220;localhost&#8221; and for port use 8008.  You&#8217;ll also need to do this for the SSL proxy if the web application uses SSL. These settings can be seen in Figure 2.</p>
<p class="MsoNormal"><a title="Firefox proxy settings" href="http://travisaltman.com/wp-content/firefoxproxysettings.JPG"><img src="http://travisaltman.com/wp-content/firefoxproxysettings.JPG" alt="Firefox proxy settings" /></a></p>
<p class="MsoNormal">Figure 2: Firefox proxy settings</p>
<p class="MsoNormal">The path to change IE settings: Tools &gt;&gt; Internet Options &gt;&gt; Connections tab &gt;&gt; LAN settings.<span> </span>Here you&#8217;ll need to check the box that says &#8220;Use a proxy server for your LAN&#8221;, this can be seen in Figure 3.</p>
<p class="MsoNormal"><a title="Internet Explorer proxy settings" href="http://travisaltman.com/wp-content/ieproxysettings.JPG"><img src="http://travisaltman.com/wp-content/ieproxysettings.JPG" alt="Internet Explorer proxy settings" /></a></p>
<p class="MsoNormal">Figure 3: IE proxy settings</p>
<p class="MsoNormal">This tutorial is going to show how Webscarab can walk through and assess the Hacme Casino web application provided by Foundstone, Figure 4 shows the login page for this application.</p>
<p class="MsoNormal"><a title="Hacme Casino Login Page" href="http://travisaltman.com/wp-content/hacmecasinologinpage.PNG"><img src="http://travisaltman.com/wp-content/hacmecasinologinpage.PNG" alt="Hacme Casino Login Page" /></a></p>
<p class="MsoNormal">Figure 4: Hacme Casino login page</p>
<p class="MsoNormal">I have already created an account within the application with the username &#8220;hacker&#8221; and a password of &#8220;passwd&#8221;.  So with Webscarab already running in the background I am going to login to Hacme Casino.  If you are on the summary tab within Webscarab you will notice requests and responses filling up rows in the bottom pane.  Webscarab is logging all communication between you and the web server, this includes all images, CSS files, Javascript files, parameters, etc&#8230;  The top pane of the summary tab shows you a directory structure of your history through the web application.  This summary tab can be seen in Figure 5.</p>
<p><a title="Webscarab summary of Hacme Casino login process" href="http://travisaltman.com/wp-content/summaryhacmeloginviawebscarab.PNG"><img src="http://travisaltman.com/wp-content/summaryhacmeloginviawebscarab.PNG" alt="Webscarab summary of Hacme Casino login process" /></a></p>
<p>Figure 5: Webscarab summary tab</p>
<p>Now a summary of your history is neat but that only scratches the surface of Webscarab&#8217;s functionality.<span> </span>One of the best functions of a HTTP proxy is the ability to intercept requests on the fly or replay those requests at a later time.<span> </span>In order to intercept requests / responses make sure you have checked the &#8220;Intercept requests&#8221; / &#8220;Intercept responses&#8221; checkboxes in the Proxy &gt;&gt; Manual Edit tab.<span> </span>These settings can be seen in Figure 6.</p>
<p><a title="Webscarab intercept settings" href="http://travisaltman.com/wp-content/webscarabinterceptsettings.JPG"><img src="http://travisaltman.com/wp-content/webscarabinterceptsettings.JPG" alt="Webscarab intercept settings" /></a></p>
<p>Figure 6: Webscarab intercept settings</p>
<p>You may be wondering why you would want to intercept or repeat a HTTP request / response.<span> </span>The simple answer is to learn more about what a website is doing with your input (e.g. SSN, credit card, personal information).<span> </span>Application security folks, developers, or curious people may want to understand more about the web application they&#8217;re using.<span> </span>Intercepting a request / response will allow you to see and manipulate communication being sent back and forth.<span> </span>Application security analysts like to replay requests over and over again with different inputs to see what the application will allow as input.<span> </span>This will give security analysts an idea of how secure the application is.<span> </span>Had we intercepted the login process you would have seen the inputs for username and password being sent to the web server.<span> </span>A screen shot of this can be seen in Figure 7.</p>
<p><a title="Interception of Hacme Casino login credentials" href="http://travisaltman.com/wp-content/intercepthacmelogincredentials.PNG"><img src="http://travisaltman.com/wp-content/intercepthacmelogincredentials.PNG" alt="Interception of Hacme Casino login credentials" /></a></p>
<p>Figure 7: Interception of the login process for Hacme Casino</p>
<p>You can see in Figure 7 that Webscarab has intercepted both the username &#8220;hacker&#8221; and password &#8220;passwd&#8221;.<span> </span>A HTTP proxy is able to see the password even though each character was replaced by an asterisk within the application.<span> </span>At this point you could accept the request or manipulate the parameters.<span> </span>You could try to login as someone at this point even though you initially typed in a different username and password.<span> </span>With a HTTP proxy you could manipulate any request / response not just the login process.</p>
<p>This covers Part 1 of the tutorial on Webscarab.<span> </span>OWASP also has a great write up, called <a href="http://www.owasp.org/index.php/WebScarab_Getting_Started">Getting Started</a>, going over basically what I have covered here.<span> </span>So if you ever wanted to know more about a web application Webscarab is a great tool that can help you learn more.<span> </span>In Part 2 of this series we&#8217;ll analyze how an application maintains state by using the &#8220;SessionID Analysis&#8221; functionality of Webscarab.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/webscarab-tutorial-part-1-learning-the-basics/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
	</channel>
</rss>

