<?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></title>
	<atom:link href="http://travisaltman.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://travisaltman.com</link>
	<description></description>
	<lastBuildDate>Sun, 25 Jul 2010 19:55:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python script to check for vulnerable printers</title>
		<link>http://travisaltman.com/python-script-to-check-for-vulnerable-printers/</link>
		<comments>http://travisaltman.com/python-script-to-check-for-vulnerable-printers/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 03:14:30 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[web security]]></category>

		<guid isPermaLink="false">http://travisaltman.com/?p=295</guid>
		<description><![CDATA[People often overlook printers when it comes to information security. Truth is that a ton of useful information can be found in printers. Employees will often scan sensitive documents such as social security cards, loan information, birth certificates, etc. I&#8217;ve also seen important organizational information on printers such as internal memos between higher up executives. [...]]]></description>
			<content:encoded><![CDATA[<p>People often overlook printers when it comes to information security. Truth is that a ton of useful information can be found in printers. Employees will often scan sensitive documents such as social security cards, loan information, birth certificates, etc. I&#8217;ve also seen important organizational information on printers such as internal memos between higher up executives. The documents I&#8217;ve seen in the past were never meant to be shared but a default printer will more than happily share your sensitive information. Almost any new commercial printer will come with a ton of features to store and retrieve any documentation that flows through the printer (copy, scan, and print jobs). Almost all of these new printers also give you a web interface to retrieve that documentation, an example of a <a href="http://www.buyastrostuff.com/ftp/Rays/5100/Web-Interface.jpg" target="_blank">printer&#8217;s web interface can be seen here</a>. When I&#8217;m performing a <a href="http://en.wikipedia.org/wiki/Penetration_test" target="_blank">penetration test</a> I always go for the web interface of a printer, the web interface is where I can grab all the sensitive information. These printers usually get unboxed and plugged into the network without much configuration from the default state, this means that the web interface is wide open with default usernames and passwords. Usually admin access to these printers will give you more access and it&#8217;s this admin access that I check for.</p>
<p>When you&#8217;ve only got a limited amount of time during a penetration test you want to get the best bang for your buck so I created a python script that will go and check for default usernames and passwords on certain models of printers. Below is the python script.</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">urllib2</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><br />
<br />
target = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span>1<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><br />
eachIPinList = target.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span> target.<span style="color: black;">close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
output = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #dc143c;">string</span> <span style="color: #ff7700;font-weight:bold;">in</span> eachIPinList:<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">try</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Trying '</span> + <span style="color: #dc143c;">string</span>.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; theurl = <span style="color: #483d8b;">'http://'</span> + <span style="color: #dc143c;">string</span>.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">'/index.html'</span><br />
&nbsp; &nbsp; username = <span style="color: #483d8b;">'root'</span><br />
&nbsp; &nbsp; password = <span style="color: #483d8b;">''</span><br />
<br />
&nbsp; &nbsp; passman = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">HTTPPasswordMgrWithDefaultRealm</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; passman.<span style="color: black;">add_password</span><span style="color: black;">&#40;</span><span style="color: #008000;">None</span>, theurl, username, password<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; authhandler =  <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">HTTPBasicAuthHandler</span><span style="color: black;">&#40;</span>passman<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; opener = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">build_opener</span><span style="color: black;">&#40;</span>authhandler<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">install_opener</span><span style="color: black;">&#40;</span>opener<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; pagehandle =  <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">urlopen</span><span style="color: black;">&#40;</span>theurl<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> pagehandle.<span style="color: black;">getcode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == 200:<br />
&nbsp; &nbsp; &nbsp; output.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">string</span><span style="color: black;">&#41;</span><br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">except</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">pass</span></div></div>
<p>Usage:  at the command line type the following</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">python nameOfScript.py IPlist.txt output.txt</div></div>
<p>So this script takes two arguments, 1) A list of IP&#8217;s you&#8217;ll want to test against, 2) Name of an output file where successful attempts are logged. If you&#8217;re having troubles running the script read my <a href="http://travisaltman.com/password-dictionary-generator/" target="_blank">other post about running a python script</a>. The output.txt will contain a list of IP&#8217;s that the script was able to log into. There are three variables that you&#8217;ll have to modify for your particular printer model that you are trying to scan for on your network, they are listed below.</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">theurl = <span style="color: #483d8b;">'http://'</span> + <span style="color: #dc143c;">string</span>.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> &nbsp;+ <span style="color: #483d8b;">'/index.html'</span><br />
username = <span style="color: #483d8b;">'root'</span><br />
password = <span style="color: #483d8b;">''</span></div></div>
<p>Username and password variables should be obvious, simply put in the default username and password of the printer on your network. The only thing you&#8217;ll have to change in &#8216;theurl&#8217; variable is the last quoted string. In my case it was &#8216;/index.html&#8217;, in your case it could be &#8216;/auth/login.html&#8217;. Variable &#8216;theurl&#8217; builds the http request used to log into your printer&#8217;s web interface. A full example is 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">http://192.168.1.5/index.html</div></div>
<p>This script is doing nothing more than trying to log into the web interface of a printer, that&#8217;s it. So the script is not limited to printers, it can be used against any web application that takes a username and password. Although this script can be used against any web application there is a limitation.  This script authenticates to the printer using Basic Access Authentication. There are three main ways to authenticate to a web application.</p>
<ol>
<li>HTTP Basic Access Authentication</li>
<li>HTTP Digest Access Authentication</li>
<li>HTML Form-based Authentication</li>
</ol>
<p>So this script will not work if your web application (printer in this case) is using the second or third option. How would you know which one your printer or web application is using? Turns out OWASP has a nice write up on <a href="http://www.owasp.org/index.php/Testing_for_Brute_Force_%28OWASP-AT-004%29#Black_Box_testing_and_example" target="_blank">how to test which type of authentication</a> your web application is using. Turns out that no one really uses one and two because they are not as secure as HTML Form-based Authentication wrapped inside SSL. Of course some printers use Basic Authentication because they are poorly built. Basic Authentication actually passes your username and password essentially in <a href="http://en.wikipedia.org/wiki/Plaintext" target="_blank">plaintext</a>, the only way it tries to hide your username and password is by <a href="http://en.wikipedia.org/wiki/Base64" target="_blank">base64</a> encoding them which is easily transformed back into plaintext. I don&#8217;t want to get lost in the weeds to much but just knowing that your printer is using Basic Authentication is bad enough. Even if you set a strong username and password anyone <a href="http://en.wikipedia.org/wiki/Packet_analyzer" target="_blank">sniffing network traffic </a>would be able to determine your credentials.</p>
<p>I kicked this script over to <a href="http://davehuggins.com/blog/" target="_blank">Dave Huggins</a> who has tons of experience developing Python applications and he quickly improved upon it by adding the functionality of IP ranges instead of a file. His enhancements can be seen below.</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">def</span> IPRange<span style="color: black;">&#40;</span>octets, func=<span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> func == <span style="color: #483d8b;">&quot;&quot;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> func<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">pass</span><br />
<br />
&nbsp; octets = <span style="color: black;">&#40;</span>octets.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'.'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; ranges = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
&nbsp; loop = 0<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> octet <span style="color: #ff7700;font-weight:bold;">in</span> octets:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> octet.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'-'</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= -<span style="color: #ff4500;">1</span>:<br />
&nbsp; &nbsp; &nbsp; spot = octet.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'-'</span><span style="color: black;">&#41;</span> + 1<br />
&nbsp; &nbsp; &nbsp; octets<span style="color: black;">&#91;</span>loop<span style="color: black;">&#93;</span> = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>octet<span style="color: black;">&#91;</span>:octet.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'-'</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; ranges.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span>octet<span style="color: black;">&#91;</span>spot:<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> + 1<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; octets<span style="color: black;">&#91;</span>loop<span style="color: black;">&#93;</span> = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>octet<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; ranges.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span>octet<span style="color: black;">&#41;</span> + <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; loop += <span style="color: #ff4500;">1</span><br />
&nbsp; CurrentAddress = <span style="color: #483d8b;">&quot;&quot;</span><br />
&nbsp; loop = 0<br />
&nbsp; output = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> one <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>octets<span style="color: black;">&#91;</span>0<span style="color: black;">&#93;</span>, ranges<span style="color: black;">&#91;</span>0<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> two <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>octets<span style="color: black;">&#91;</span>1<span style="color: black;">&#93;</span>, ranges<span style="color: black;">&#91;</span>1<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> three <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>octets<span style="color: black;">&#91;</span>2<span style="color: black;">&#93;</span>, ranges<span style="color: black;">&#91;</span>2<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> four <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>octets<span style="color: black;">&#91;</span>3<span style="color: black;">&#93;</span>, ranges<span style="color: black;">&#91;</span>3<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> item <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#40;</span>one, two, three, four<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CurrentAddress += <span style="color: #008000;">str</span> \<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>one, two, three, four<span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>loop<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">&quot;.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loop += <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CurrentAddress = CurrentAddress<span style="color: black;">&#91;</span>:-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; output.<span style="color: black;">append</span><span style="color: black;">&#40;</span>func<span style="color: black;">&#40;</span>CurrentAddress<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CurrentAddress = <span style="color: #483d8b;">&quot;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loop = 0<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> output<br />
<br />
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>, <span style="color: #dc143c;">sys</span>, <span style="color: #dc143c;">urllib2</span><br />
<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> defaultPrinter<span style="color: black;">&#40;</span>ipAddress<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">try</span>:<br />
&nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Trying '</span> + ipAddress<br />
&nbsp; &nbsp; &nbsp; theurl = <span style="color: #483d8b;">'http://'</span> + ipAddress + <span style="color: #483d8b;">'/indexConf.html'</span><br />
&nbsp; &nbsp; &nbsp; username = <span style="color: #483d8b;">'root'</span><br />
&nbsp; &nbsp; &nbsp; password = <span style="color: #483d8b;">''</span><br />
<br />
&nbsp; &nbsp; &nbsp; passman = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">HTTPPasswordMgrWithDefaultRealm</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; passman.<span style="color: black;">add_password</span><span style="color: black;">&#40;</span><span style="color: #008000;">None</span>, theurl, username, password<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; authhandler =  <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">HTTPBasicAuthHandler</span><span style="color: black;">&#40;</span>passman<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; opener = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">build_opener</span><span style="color: black;">&#40;</span>authhandler<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">install_opener</span><span style="color: black;">&#40;</span>opener<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; pagehandle =  <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">urlopen</span><span style="color: black;">&#40;</span>theurl<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> pagehandle.<span style="color: black;">getcode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> == 200:<br />
&nbsp; &nbsp; &nbsp; &nbsp; output.<span style="color: black;">write</span><span style="color: black;">&#40;</span>ipAddress<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">except</span>:<br />
&nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">pass</span><br />
<br />
&nbsp; output = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span><br />
&nbsp; IPRange<span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>, defaultPrinter<span style="color: black;">&#41;</span></div></div>
<p>Happy printer hunting.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/python-script-to-check-for-vulnerable-printers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Malware analysis tool, Capture-Bat</title>
		<link>http://travisaltman.com/malware-analysis-tool-capture-bat/</link>
		<comments>http://travisaltman.com/malware-analysis-tool-capture-bat/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 12:25:08 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://travisaltman.com/?p=247</guid>
		<description><![CDATA[The main purpose of this write up is to create a tutorial for running,  installing, and analyzing results of Capture-Bat. I didn&#8217;t really want  to name this article &#8220;Capture-Bat tutorial&#8221; because not everyone is  familiar with the tool and what its used for. When it comes to analyzing malware there are a [...]]]></description>
			<content:encoded><![CDATA[<p>The main purpose of this write up is to create a tutorial for running,  installing, and analyzing results of Capture-Bat. I didn&#8217;t really want  to name this article &#8220;Capture-Bat tutorial&#8221; because not everyone is  familiar with the tool and what its used for. When it comes to analyzing malware there are a handful of tools that every analyst should have, Capture-Bat is one of those tools. Capture-Bat will monitor changes malware makes to your system so that you can effectively determine what the malware is attempting to do. Capture-Bat does a great job of eliminating noise and ignoring &#8220;regular&#8221; windows events. It is a behavioral analysis tool which means that it does not analyze the malware itself, it only monitors changes the malware makes to the windows system. In this article I hope to highlight the best way to use the tool and what options I always use when running the tool. <a href="https://www.honeynet.org/node/315" target="_blank">Capture-Bat is a free tool which can be grabbed here</a>. I&#8217;ll get into all the details later but whenever I run this tool I execute the following command right before I execute the malware.</p>
<div class="codecolorer-container dos blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\Program Files\Capture\CaptureBAT.exe -c -n -l c:\temp\output.txt</div></div>
<p>Below are what the options mean.</p>
<div class="codecolorer-container dos blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-c   capture any deleted or modified files<br />
<br />
-n   capture network activity<br />
<br />
-l   save output to a specified location <span style="color: #66cc66;">&#40;</span>lowercase L<span style="color: #66cc66;">&#41;</span></div></div>
<p>Let&#8217;s walk through an example using the zipped up <a href="http://travisaltman.com/malware/40033d8063564d1b3e4b41f1d5c9a31f.zip" target="_self">malware located here</a> (password is &#8220;malware&#8221;). For the inexperienced keep in mind you&#8217;ll need to run this malware in a virtual machine environment that is not connected to a network. Now that you&#8217;ve downloaded the malware open up two command prompts in windows (Start &gt; Programs &gt; Accessories &gt; Command prompt). In the first command prompt you&#8217;ll need to start up Capture-Bat with the command above. Once you run this command you should see the following.</p>
<div class="codecolorer-container dos blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\Program Files\Capture&amp;gt;CaptureBAT.exe -c -n -l c:\temp\output.txt<br />
Option: Collecting modified files<br />
Option: Capturing network packets<br />
Option: Logging system events to c:\temp\output.txt<br />
Loaded kernel driver: CaptureProcessMonitor<br />
Loaded kernel driver: CaptureRegistryMonitor<br />
Loaded filter driver: CaptureFileMonitor<br />
Creating network dumper<br />
Loading network packet dumper<br />
network adapter found: 192.168.94.130<br />
---------------------------------------------------------</div></div>
<p>My output is going to c:\temp, you may have to create this directory before running the command. It looks like Capture-Bat is just sitting there but it&#8217;s actually monitoring changes to your system. It&#8217;s important to only run the malware while Capture-Bat is monitoring your system, if you launch another application it will muddy your output and you may not be able to tell it&#8217;s the malware making changes to your system or a benign application. Now that Capture-Bat is monitoring let&#8217;s go ahead run our malware. I&#8217;m a fan of running exe&#8217;s from the command line because you may get a more verbose output, so execute the command below to launch the malware.</p>
<div class="codecolorer-container dos blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe</div></div>
<p>After you execute the malware let Capture-Bat sit there and monitor events for about 30 seconds to one minute, after that time period simply go into the command prompt running Capture-Bat and type &#8220;control + c&#8221; to kill the Capture-Bat process. Next step is to open up our output.txt to see what the malware has done to the system, my output is below.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&quot;12/4/2010 11:30:36.81&quot;,&quot;process&quot;,&quot;created&quot;,&quot;C:\WINDOWS\system32\cmd.exe&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;<br />
&quot;12/4/2010 11:30:37.222&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;C:\WINDOWS\system32\spoolsvc.exe&quot;<br />
&quot;12/4/2010 11:30:37.222&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;C:\WINDOWS\system32\spoolsvc.exe&quot;<br />
&quot;12/4/2010 11:30:37.222&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;C:\WINDOWS\system32\spoolsvc.exe&quot;<br />
&quot;12/4/2010 11:30:37.222&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;C:\temp\zcbgjy.bat&quot;<br />
&quot;12/4/2010 11:30:37.300&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\ProxyBypass&quot;<br />
&quot;12/4/2010 11:30:37.300&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\IntranetName&quot;<br />
&quot;12/4/2010 11:30:37.300&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\UNCAsIntranet&quot;<br />
&quot;12/4/2010 11:30:37.300&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\ProxyBypass&quot;<br />
&quot;12/4/2010 11:30:37.300&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\IntranetName&quot;<br />
&quot;12/4/2010 11:30:37.300&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\UNCAsIntranet&quot;<br />
&quot;12/4/2010 11:30:37.300&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Cache&quot;<br />
&quot;12/4/2010 11:30:37.300&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Cookies&quot;<br />
&quot;12/4/2010 11:30:37.347&quot;,&quot;process&quot;,&quot;created&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;C:\WINDOWS\system32\cmd.exe&quot;<br />
&quot;12/4/2010 11:30:37.378&quot;,&quot;process&quot;,&quot;created&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;C:\WINDOWS\system32\spoolsvc.exe&quot;<br />
&quot;12/4/2010 11:30:37.331&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{3f04edc3-85c6-11de-af20-806d6172696f}\BaseClass&quot;<br />
&quot;12/4/2010 11:30:37.347&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{cb7e6034-4640-11df-b8d9-806d6172696f}\BaseClass&quot;<br />
&quot;12/4/2010 11:30:37.347&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\{3f04edc0-85c6-11de-af20-806d6172696f}\BaseClass&quot;<br />
&quot;12/4/2010 11:30:37.347&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;System&quot;,&quot;C:\WINDOWS\system32\spoolsvc.exe&quot;<br />
&quot;12/4/2010 11:30:37.362&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;System&quot;,&quot;C:\WINDOWS\system32\spoolsvc.exe&quot;<br />
&quot;12/4/2010 11:30:37.362&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;System&quot;,&quot;C:\WINDOWS\system32\spoolsvc.exe&quot;<br />
&quot;12/4/2010 11:30:37.597&quot;,&quot;process&quot;,&quot;terminated&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;,&quot;C:\WINDOWS\system32\cmd.exe&quot;<br />
&quot;12/4/2010 11:30:37.581&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;C:\WINDOWS\system32\cmd.exe&quot;,&quot;C:\Program Files\Capture\logs\deleted_files\C\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;<br />
&quot;12/4/2010 11:30:37.581&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;C:\WINDOWS\system32\cmd.exe&quot;,&quot;C:\Program Files\Capture\logs\deleted_files\C\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;<br />
&quot;12/4/2010 11:30:37.581&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;C:\WINDOWS\system32\cmd.exe&quot;,&quot;C:\Program Files\Capture\logs\deleted_files\C\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;<br />
&quot;12/4/2010 11:30:37.581&quot;,&quot;file&quot;,&quot;Delete&quot;,&quot;C:\WINDOWS\system32\cmd.exe&quot;,&quot;C:\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;<br />
&quot;12/4/2010 11:30:37.581&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;C:\WINDOWS\system32\cmd.exe&quot;,&quot;C:\Program Files\Capture\logs\deleted_files\C\temp\zcbgjy.bat&quot;<br />
&quot;12/4/2010 11:30:37.597&quot;,&quot;file&quot;,&quot;Delete&quot;,&quot;C:\WINDOWS\system32\cmd.exe&quot;,&quot;C:\temp\zcbgjy.bat&quot;<br />
&quot;12/4/2010 11:30:38.362&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;System&quot;,&quot;C:\Program Files\Capture\logs\deleted_files\C\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;<br />
&quot;12/4/2010 11:30:38.472&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;System&quot;,&quot;C:\Program Files\Capture\logs\deleted_files\C\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;<br />
&quot;12/4/2010 11:30:38.487&quot;,&quot;registry&quot;,&quot;SetValueKey&quot;,&quot;C:\WINDOWS\system32\spoolsvc.exe&quot;,&quot;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Spooler SubSystem App&quot;<br />
&quot;12/4/2010 11:30:39.472&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;System&quot;,&quot;C:\Program Files\Capture\logs\deleted_files\C\temp\40033d8063564d1b3e4b41f1d5c9a31f.exe&quot;<br />
&quot;12/4/2010 11:30:39.472&quot;,&quot;file&quot;,&quot;Write&quot;,&quot;System&quot;,&quot;C:\Program Files\Capture\logs\deleted_files\C\temp\zcbgjy.bat&quot;</div></td></tr></tbody></table></div>
<p>The first line is simply us executing the malware. Lines 2 &#8211; 4 is where the malware creates a file, an exe in this case, named spoolsvc.exe. Spoolsvc.exe doesn&#8217;t already exist on windows systems but spoolsv.exe does so the malware author is trying to be tricky in creating an exe that is very similar to what already exists on the system. It&#8217;s very important to note that spoolsvc.exe is not executed here but simply created, had it been executed you would have seen &#8220;process&#8221;,&#8221;created&#8221; as is seen in line one. Spoolsvc.exe is eventually executed on line 15. Line five is where a &#8220;.bat&#8221; file is created, for those that don&#8217;t know &#8220;.bat&#8221; files are windows batch scripts which contain a series of commands to be executed. Capture-Bat ends of saving this batch script which we will take a look at later. Lines 6 &#8211; 13 is where the malware is setting registry values. It appears that lines 6 &#8211; 11 are ensuring the &#8220;Local Intranet&#8221; has certain settings (see IE setting screen shot below) in internet explorer, this will allow internal connections to have a lower security setting than external connections.</p>
<p><a href="http://travisaltman.com/wp-content/intranetSettings.png"><img class="alignnone size-full wp-image-275" title="intranetSettings" src="http://travisaltman.com/wp-content/intranetSettings.png" alt="" width="381" height="197" /></a></p>
<p>My virtual machine is setup in a default and vulnerable setup, my  registry values for lines 6 &#8211; 11 didn&#8217;t change after the malware was  executed. Also I intentionally changed these settings before the malware executed but the malware failed to modify the registry so go figure. <a href="http://home.mcafee.com/VirusInfo/VirusProfile.aspx?key=143656#none" target="_blank">McAfee states</a> that these settings are used to bypass firewalls? More information about internet explorer security settings and <a href="http://support.microsoft.com/default.aspx?kbid=182569" target="_blank">registry values can be found here</a>. Also good information <a href="http://support.microsoft.com/kb/174360" target="_blank">here about IE security zones</a>. Lines 12 and 13 are modifying where temporary internet files and cookies are stored, in my case I didn&#8217;t notice a difference between before and after. Also I modified the default location where temporary internet files are located, the malware failed to change this location after execution so go figure once again. I haven&#8217;t contacted the developers of Capture-Bat but &#8220;SetValueKey&#8221; could also be used to query the registry? Either way the values stayed the same for me, it could have been that the malware authors wanted the registry settings for cache and cookies in a default state? Lines 14 &#8211; 15 are having cmd.exe execute the malware spoolsvc.exe. Lines 16 &#8211; 18 are setting a value in the registry. Once again these values did not change for me after the malware was executed and it appears that the value for BaseClass the value of &#8220;Driver&#8221; is default? I haven&#8217;t yet figured out why this piece of malware sets the value of BaseClass to driver but I have seen other malware perform these same actions. In lines 19 &#8211; 30 the malware and Capture-Bat delete and create certain files and processes so hopefully that output is clear to you. It gets interesting again on line 31. <a href="http://support.microsoft.com/kb/314866" target="_blank">HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\</a> is the location of exe&#8217;s set to run when a user logs into the system. It is very common to see malware modify these registry values to have itself execute once the user logs into the system. In this case it only modified the Spooler SubSystem App value but it&#8217;s <a href="http://www.sophos.com/security/analyses/viruses-and-spyware/w32poebotj.html" target="_blank">common to see it modify other values</a> in that location. The last two lines of the output are Capture-Bat saving deleted files. So that&#8217;s a basic analysis of this malware. I only let the malware run for about 30 seconds so it may actually perform more actions than my output.</p>
<p>You may be wondering why the funny name for this particular piece of malware, 40033d8063564d1b3e4b41f1d5c9a31f.exe. The experienced will recognize the name as a MD5 hash, MD5 hashing is commonly used to uniquely identify malware or any exe for that matter. I will also <a href="http://www.google.com/search?q=40033d8063564d1b3e4b41f1d5c9a31f&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.gentoo:en-US:unofficial&amp;client=firefox-a" target="_blank">google search the MD5 hash</a> of the malware to see if anyone else has run across it. Turns out others have and <a href="http://anubis.iseclab.org/?action=result&amp;task_id=1a430cc5715aaa6d4e9cf2b0e7d5b7013&amp;format=html" target="_blank">Anubis has a good analysis</a> of this malware as well. Anubis reports some of the same activities as we see in our output. You can also perform a hash search over at <a href="http://www.virustotal.com/buscaHash.html" target="_blank">virus total</a>, looks like other anti-virus vendors have signatures for this malware. For the uninformed virus total will query about 40 anti-virus vendors to see which ones have seen it before. I love malware analysis sites like Anubis and Virus Total but nothing beats performing analysis on a local system. For example we were able to capture the deleted batch script that the malware executed, below is the output of that batch script.</p>
<div class="codecolorer-container dos blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #33cc33;">@</span><a href="http://www.ss64.com/nt/echo.html"><span style="color: #b1b100; font-weight: bold;">echo</span></a> off<br />
:<span style="color: #b100b1; font-weight: bold;">deleteagain</span><br />
<a href="http://www.ss64.com/nt/del.html"><span style="color: #b1b100; font-weight: bold;">del</span></a> /A:H /F 40033d8063564d1b3e4b41f1d5c9a31f.exe<br />
<a href="http://www.ss64.com/nt/del.html"><span style="color: #b1b100; font-weight: bold;">del</span></a> /F 40033d8063564d1b3e4b41f1d5c9a31f.exe<br />
<a href="http://www.ss64.com/nt/if.html"><span style="color: #00b100; font-weight: bold;">if</span></a> <a href="http://www.ss64.com/nt/exist.html"><span style="color: #000000; font-weight: bold;">exist</span></a> 40033d8063564d1b3e4b41f1d5c9a31f.exe <a href="http://www.ss64.com/nt/goto.html"><span style="color: #00b100; font-weight: bold;">goto</span></a> deleteagain<br />
<a href="http://www.ss64.com/nt/del.html"><span style="color: #b1b100; font-weight: bold;">del</span></a> zcbgjy.bat</div></div>
<p>Granted the batch script is lame, it&#8217;s a very basic script that deletes the malware and deletes itself but the batch script could have contained a lot of useful information. All deleted or modified files that Capture-Bat sees are located in the following directory.</p>
<div class="codecolorer-container dos blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\Program Files\Capture\logs</div></div>
<p>Below is a screen shot of my deleted files for this malware.</p>
<p><a href="http://travisaltman.com/wp-content/deletedFiles1.png"><img class="alignnone size-medium wp-image-282" title="deletedFiles" src="http://travisaltman.com/wp-content/deletedFiles1-300x147.png" alt="" width="300" height="147" /></a></p>
<p>Don&#8217;t forget that Capture-Bat collects pcap&#8217;s during the analysis under the same directory as the deleted malware, see screen shot below.</p>
<p><a href="http://travisaltman.com/wp-content/malwarePcap.png"><img class="alignnone size-medium wp-image-283" title="malwarePcap" src="http://travisaltman.com/wp-content/malwarePcap-300x193.png" alt="" width="300" height="193" /></a></p>
<p>From a quick google search it doesn&#8217;t look like that memehehz.info has a great reputation. It could be that memehehz.info is a malware site or it could be that memehehz.info got infected with malware itself. The malware analyzed here isn&#8217;t the most recent malware I simply wanted to walk you through an example and how Capture-Bat can help you in the analysis of what the malware is trying to do. When it comes to analyzing malware I wouldn&#8217;t say only the tip of the iceberg has been analyzed but there is definitely more to cover. My main goal was to get others familiar with good malware analysis tools such as Capture-Bat so that they may be better able to react and respond to malicious activity on their own networks. Hopefully this helped and as always if you have any feedback I&#8217;d love to hear it.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/malware-analysis-tool-capture-bat/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>password dictionary generator</title>
		<link>http://travisaltman.com/password-dictionary-generator/</link>
		<comments>http://travisaltman.com/password-dictionary-generator/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 04:13:59 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[learning]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://travisaltman.com/?p=199</guid>
		<description><![CDATA[I had the need to generate a password dictionary that would cover every possible combination for a defined character set.  I first learned to program in Python so I was going to start there first.  Before writing the program I decided to Google and see if anyone else had tackled this problem via Python, turned [...]]]></description>
			<content:encoded><![CDATA[<p>I had the need to generate a password dictionary that would cover every possible combination for a defined character set.  I first learned to program in Python so I was going to start there first.  Before writing the program I decided to Google and see if anyone else had tackled this problem via Python, turned out they had.  <a href="http://forums.remote-exploit.org/programming/14204-another-password-wordlist-generator-python.html" target="_blank">Siph0n posted his Python code</a> to create a password dictionary over at the BackTrack forums.  I wanted to post it here as a mirror and to discuss the implications of creating a password dictionary with every possible combination.  Below is the Python code.</p>
<div class="codecolorer-container python blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">f=<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'wordlist'</span>, <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> xselections<span style="color: black;">&#40;</span>items, n<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> n==0: <span style="color: #ff7700;font-weight:bold;">yield</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>items<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> ss <span style="color: #ff7700;font-weight:bold;">in</span> xselections<span style="color: black;">&#40;</span>items, n-1<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">yield</span> <span style="color: black;">&#91;</span>items<span style="color: black;">&#91;</span>i<span style="color: black;">&#93;</span><span style="color: black;">&#93;</span>+ss<br />
<br />
<span style="color: #808080; font-style: italic;"># Numbers = 48 - 57</span><br />
<span style="color: #808080; font-style: italic;"># Capital = 65 - 90</span><br />
<span style="color: #808080; font-style: italic;"># Lower = 97 - 122</span><br />
numb = <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>48,58<span style="color: black;">&#41;</span><br />
cap = <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>65,91<span style="color: black;">&#41;</span><br />
low = <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>97,123<span style="color: black;">&#41;</span><br />
choice = 0<br />
<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>choice<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>1,8<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; choice = <span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span><span style="color: #483d8b;">'<br />
&nbsp; &nbsp; 1) Numbers<br />
&nbsp; &nbsp; 2) Capital Letters<br />
&nbsp; &nbsp; 3) Lowercase Letters<br />
&nbsp; &nbsp; 4) Numbers + Capital Letters<br />
&nbsp; &nbsp; 5) Numbers + Lowercase Letters<br />
&nbsp; &nbsp; 6) Numbers + Capital Letters + Lowercase Letters<br />
&nbsp; &nbsp; 7) Capital Letters + Lowercase Letters<br />
&nbsp; &nbsp; : '</span><span style="color: #483d8b;">''</span><span style="color: black;">&#41;</span> <br />
<br />
choice = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>choice<span style="color: black;">&#41;</span><br />
poss = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
<span style="color: #ff7700;font-weight:bold;">if</span> choice == 1:<br />
&nbsp; &nbsp; poss += numb<br />
<span style="color: #ff7700;font-weight:bold;">elif</span> choice == 2:<br />
&nbsp; &nbsp; poss += cap<br />
<span style="color: #ff7700;font-weight:bold;">elif</span> choice == 3:<br />
&nbsp; &nbsp; poss += low<br />
<span style="color: #ff7700;font-weight:bold;">elif</span> choice == 4:<br />
&nbsp; &nbsp; poss += numb<br />
&nbsp; &nbsp; poss += cap<br />
<span style="color: #ff7700;font-weight:bold;">elif</span> choice == 5:<br />
&nbsp; &nbsp; poss += numb<br />
&nbsp; &nbsp; poss += low<br />
<span style="color: #ff7700;font-weight:bold;">elif</span> choice == 6:<br />
&nbsp; &nbsp; poss += numb<br />
&nbsp; &nbsp; poss += cap<br />
&nbsp; &nbsp; poss += low<br />
<span style="color: #ff7700;font-weight:bold;">elif</span> choice == 7:<br />
&nbsp; &nbsp; poss += cap<br />
&nbsp; &nbsp; poss += low<br />
<br />
bigList = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
<span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> poss:<br />
&nbsp; &nbsp; bigList.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span><span style="color: #008000;">chr</span><span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
MIN = <span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;What is the min size of the word? &quot;</span><span style="color: black;">&#41;</span><br />
MIN = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>MIN<span style="color: black;">&#41;</span><br />
MAX = <span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;What is the max size of the word? &quot;</span><span style="color: black;">&#41;</span><br />
MAX = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>MAX<span style="color: black;">&#41;</span><br />
<span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>MIN,MAX+1<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> s <span style="color: #ff7700;font-weight:bold;">in</span> xselections<span style="color: black;">&#40;</span>bigList,i<span style="color: black;">&#41;</span>: f.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">''</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>s<span style="color: black;">&#41;</span> + <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span></div></div>
<p>If you&#8217;re familiar with programming and Python in particular then you could just grab the code and roll but I really wanted to discuss the usefulness of an application like this.  First I will discuss the basics of how to get this program up and running but will eventually jump into other implications such as time, storage, and usefulness of a password dictionary.</p>
<p>How to install and use the program</p>
<ol>
<li>You must have Python installed.  If you&#8217;re running Linux (you should be) then it&#8217;s probably already installed.  If you&#8217;re running then Windows then you will have to <a href="http://www.python.org/download/" target="_blank">download Python</a>.</li>
<li>Now that you have Python installed simply copy and paste the code above into a text file and name it passwordDictionaryGenerator.py.  The .py extension is needed because that&#8217;s how Python recognizes code that it&#8217;s suppose to execute.</li>
<li>Modify appropriate variables within the program.  The only variables you may want to modify are numb, cap, and low.  These variables contain the ASCII equivalent ranges for the letters and numbers you will be using to generate your dictionary.  You may want to modify these variables so that your dictionary does not contain a-z but only a-k, I&#8217;ll leave that up to you.</li>
<li>Now to run the program simply type
<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">python passwordDictionaryGenerator.py</div></div>
<p>You will have to answer the questions about which character set you want to use and how long / short your password dictionary is going to be.  Once you answer the questions it may seem like the program isn&#8217;t doing anything but it is, it will spit you back to the command line once the program has completed.  The output will be a file called wordlist.</li>
</ol>
<p>So now you have this cool program that can generate a password dictionary for you, how big (size MB, GB, TB, etc) will this dictionary be?  How long will it take to generate this dictionary?  Let&#8217;s tackle the size question first as it will help us calculate the time as well.  The key to calculating the size is a math term called permutations.  <a href="http://www.aaaknow.com/sta-permu.htm" target="_blank">Permutations</a> is a simple equation to determine the number of words for that particular character set and length of word.  The basic equation is below.</p>
<p>n<sup>r</sup></p>
<p>n = total character set (e.g.  a-z + A-Z + 0-9 = 62)</p>
<p>r = length of the word</p>
<p>Now you&#8217;ll have to calculate n<sup>r</sup> for each length to get every possible combination.  So for a 6 digit long password your equation will look like the following.</p>
<p>n<sup>6</sup> + n<sup>5</sup> + n<sup>4</sup> + n<sup>3</sup> + n<sup>2</sup> + n<sup>1</sup> = every possible combination</p>
<p>Let&#8217;s try an example where our character set is a-z (n = 26) and our password is no longer than 6 (r = 1-6) digits, how many words will be in our dictionary?</p>
<p>26<sup>6</sup> + 26<sup>5</sup> + 26<sup>4</sup> + 26<sup>3</sup> + 26<sup>2</sup> + 26<sup>1</sup> = 321,272,406 = total # of words</p>
<p>So now we understand how to calculate the total number of words in our dictionary.  How does that relate to the size?  Well for the most part if the length of the password is x then the size in bytes will be x + 1 for that particular line.  Then all we have to do is multiply each n<sup>r</sup> times the size of that particular line to get the size for that particular length.  That may have just sound really confusing so hopefully the following graph clears that up some.</p>
<p><a href="http://travisaltman.com/wp-content/possibleCombinationChart.png"><img class="aligncenter size-full wp-image-212" title="possibleCombinationChart" src="http://travisaltman.com/wp-content/possibleCombinationChart.png" alt="" width="395" height="210" /></a></p>
<p>I went ahead and generated this dictionary, it took about 30 minutes.  Turns out the size matched my calculations.</p>
<p><a href="http://travisaltman.com/wp-content/wordlistSize.png"><img class="aligncenter size-full wp-image-215" title="wordlistSize" src="http://travisaltman.com/wp-content/wordlistSize.png" alt="" width="250" height="198" /></a></p>
<p>So now you have the basic formula for calculating the size of your desired dictionary.  Let&#8217;s take a look at a larger example just to cure our curiosity.  Let&#8217;s assume the following parameters.</p>
<ul>
<li>character set = a-z, A-Z, &amp; 0-9</li>
<li>password length = 1-8</li>
<li>n = 62</li>
<li>r = 1 &#8211; 8</li>
</ul>
<p>With these parameters the size of our dictionary jumps to 1,800 terabytes or 1.8 petabytes. Take a look at the chart below.</p>
<p><a href="http://travisaltman.com/wp-content/possibleCombinationChart2.png"><img class="aligncenter size-full wp-image-221" title="possibleCombinationChart2" src="http://travisaltman.com/wp-content/possibleCombinationChart2.png" alt="" width="487" height="290" /></a></p>
<p>You can see how quickly the size jumps up. I don&#8217;t know about you but I don&#8217;t have a two petabyte drive lying around. Generating this dictionary is just infeasible. I did calculate the time it would probably take to generate this dictionary, it came out to be about 11 days. So the time to create such a dictionary is nothing compared to the storage required to house it. Not only that I don&#8217;t know to many applications that can handle a large dictionary as input, so that&#8217;s another factor you&#8217;ll have to keep in mind when generating your dictionary.</p>
<p>Calculating the time it takes to generate these dictionaries I&#8217;ll leave up to you.  The basic idea is that you can run the python program for a particular length password for a set amount of time and then extrapolate form there.  For the most part time isn&#8217;t really a factor but storage is. The concepts I&#8217;ve talked about here are nothing new. The idea of generating a password came to me and my coworkers as we were thinking of ways to test a WPA wireless infrastructure. Attacking WPA can be done offline so we were thinking of generating a dictionary to accomplish this. Hours later we soon realized the difficulty with generating such a large dictionary. This was actually good news because it meant that an attacker would have an extremely difficult time attacking a WPA access point with a complex password. <a href="http://www.renderlab.net/projects/WPA-tables/" target="_blank">Renderman and the Church of Wifi</a> have thought about this problem way before I did and came up with some rainbow tables to help test the strength of your WPA access point. You can&#8217;t really create a dictionary with every single combination for a lengthy password, your best bet is to create a dictionary with the most &#8220;common&#8221; passwords, which is no easy task either.</p>
<p>The moral of the story is to use lengthy complex passwords with a high character set, but you knew that already. So I just suggested that this program is somewhat useless, well it is but it isn&#8217;t. You can use this program to generate a small dictionary but a large dictionary (greater than a couple of terabytes) is probably out of the question. So use this program and let me know what your results are, I&#8217;m always interested in your feedback. Happy cracking.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/password-dictionary-generator/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fingerprinting MySQL</title>
		<link>http://travisaltman.com/fingerprinting-mysql/</link>
		<comments>http://travisaltman.com/fingerprinting-mysql/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 17:22:25 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[databases]]></category>

		<guid isPermaLink="false">http://travisaltman.com/?p=193</guid>
		<description><![CDATA[Determine version locally / with access
select version();
or
mysql -V
Determine version remotely
nmap -sV -p 3306 addressOfMachine
or
nc -w 1 addressOfMachine 3306
With netcat you may see weird output, example is below
nc -w 1 192.168.1.1 3306
4
4.1.20ï¿½{
jWU$PHXc,fV[J=3'hW]NL
In this case the version is 4.1.20, so you&#8217;ll have to read through the mess that is netcat output.
]]></description>
			<content:encoded><![CDATA[<p>Determine version locally / with access</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">select version();</div></div>
<p>or</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">mysql -V</div></div>
<p>Determine version remotely</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">nmap -sV -p 3306 addressOfMachine</div></div>
<p>or</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">nc -w 1 addressOfMachine 3306</div></div>
<p>With netcat you may see weird output, example is 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">nc -w 1 192.168.1.1 3306<br />
4<br />
4.1.20ï¿½{<br />
jWU$PHXc,fV[J=3'hW]NL</div></div>
<p>In this case the version is 4.1.20, so you&#8217;ll have to read through the mess that is netcat output.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/fingerprinting-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>0</slash:comments>
		</item>
		<item>
		<title>Video tutorial for metasploit autopwn and nessus</title>
		<link>http://travisaltman.com/video-tutorial-for-metasploit-autopwn-and-nessus/</link>
		<comments>http://travisaltman.com/video-tutorial-for-metasploit-autopwn-and-nessus/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 18:15:27 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[video]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://travisaltman.com/?p=174</guid>
		<description><![CDATA[

I teach network secuirty at ECPI College of Technology. At the end of every class students present their projects for the course. One group put together a video of their project and I figured it would be a good idea to post it. It&#8217;s about 27 minutes and goes over a hand full of things, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">
<p style="text-align: center;"><br /><img src="/wp-content/cis425project.jpg" alt="media" /><br />
[See post to watch Flash video]</p>
<p>I teach network secuirty at <a href="http://ecpi.edu/" target="_blank">ECPI College of Technology</a>. At the end of every class students present their projects for the course. One group put together a video of their project and I figured it would be a good idea to post it. It&#8217;s about 27 minutes and goes over a hand full of things, one of the neatest being the part using Nessus and Metasploit&#8217;s autopwnage. I also think the video has some great funny moments as well, especially the Star Wars CVE effect. Either way let me know if you find it helpful or not. I don&#8217;t have the greatest bandwidth so be patient with the player as it may take a while to load. It&#8217;s also a large video, high resolution that is, so don&#8217;t forget to click the fullscreen icon on the bottom right of the player. The audio capture is low so you will probably need to jack up the volume.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/video-tutorial-for-metasploit-autopwn-and-nessus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="/wp-content/cis425project.flv" length="1" type="video/x-flv"/>
	</item>
		<item>
		<title>Search an IP range via the command line</title>
		<link>http://travisaltman.com/search-an-ip-range-via-the-command-line/</link>
		<comments>http://travisaltman.com/search-an-ip-range-via-the-command-line/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 14:32:42 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[scripting]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://travisaltman.com/?p=127</guid>
		<description><![CDATA[So how do you manipulate a list of IP&#8217;s via the command line?  Well there are several ways to go about this but I&#8217;ll present the way I went about it.
In my scenario I had a range of IP&#8217;s that I needed to extract/exclude out of a list of IP&#8217;s. This task needed to [...]]]></description>
			<content:encoded><![CDATA[<p>So how do you manipulate a list of IP&#8217;s via the command line?  Well there are several ways to go about this but I&#8217;ll present the way I went about it.</p>
<p>In my scenario I had a range of IP&#8217;s that I needed to extract/exclude out of a list of IP&#8217;s. This task needed to be done on a Windoze machine, I do most of my scripting on a Linux box, so I was trying to rely on the findstr command. Trying to use the <a href="http://ss64.com/nt/findstr.html" target="_blank">findstr command</a> to search, extract, or manipulate a list of IP&#8217;s will make you crazy. Now I&#8217;m sure there&#8217;s way smarter people out there that can craft a simple one line findstr command to hack and slash on an IP list but I&#8217;m not one of those people.  I also tried to utilize some regular expression magic to manipulate an IP range.  Google has this <a href="http://www.google.com/support/analytics/bin/answer.py?hl=en&amp;answer=55572" target="_blank">regular expression generator</a> specifically for IP ranges, which seems neat at first but I couldn&#8217;t get it to work within findstr.</p>
<p>After no luck with findstr I was gonna turn to my old friend grep.  Now for those that don&#8217;t know grep is a pattern / regular expression matching command within Linux. Grep has the ability to search for patterns within directories and files for a specific string (e.g. IP addresses). There is a <a href="http://www.thedance.net/~win95/grep.exe" target="_self">grep Windows executable</a> with basically the same functionality but it couldn&#8217;t handle Google&#8217;s regular expression either. After burning through two different programs to perform this task I was almost at a lost. My coworker reminded me of <a href="http://www.amazon.com/Effective-awk-Programming-Arnold-Robbins/dp/0596000707/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1252164251&amp;sr=8-2" target="_blank">awk</a>, how could I forget. Awk is a native program within Linux but you can download an exe version of the program. There are different flavors of awk (gawk and mawk) and different programmers that try and port over awk. I tried some awk.exe&#8217;s and some gawk.exe&#8217;s but I had the best success with mawk.exe, you can grab <a href="http://travisaltman.com/tools/mawk.exe" target="_self">mawk.exe here</a>. So enough yip yapping let&#8217;s walk through the solution. Below is a sample list of IP&#8217;s that we&#8217;ll hack and slash on, let&#8217;s assume these IP&#8217;s are in a file called IPlist.txt.</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">192.168.0.1<br />
192.168.0.2<br />
192.168.0.3<br />
192.168.0.4<br />
192.168.0.5<br />
192.168.0.6<br />
192.168.0.7<br />
192.168.0.8<br />
192.168.0.9<br />
192.168.0.10<br />
192.168.0.11<br />
192.168.0.12<br />
192.168.0.13<br />
192.168.0.14<br />
192.168.0.15<br />
192.168.0.16<br />
192.168.0.17<br />
192.168.0.18<br />
192.168.0.19<br />
192.168.0.20<br />
192.168.5.1<br />
192.168.5.2<br />
192.168.5.3<br />
192.168.5.4<br />
192.168.5.5<br />
192.168.5.6<br />
192.168.5.7<br />
192.168.5.8<br />
192.168.5.9<br />
192.168.5.10<br />
192.168.5.11<br />
192.168.5.12<br />
192.168.5.13<br />
192.168.5.14<br />
192.168.5.15<br />
192.168.5.16<br />
192.168.5.17<br />
192.168.5.18<br />
192.168.5.19<br />
192.168.5.20</div></div>
<p>So let&#8217;s say we wanted to extract or exclude the range 192.168.0.5-192.168.0.15, you would use the mawk 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">mawk &quot;BEGIN {FS='.'}; $3&amp;lt;0 || $3&amp;gt;0 || ($3==0 &amp;amp;&amp;amp;($4&amp;lt;5 || $4&amp;gt;15)) {print $0}&quot; IPlist.txt</div></div>
<p>Let me explain the command above. BEGIN simply processes the text before mawk starts munching. FS stands for field separator, here we are telling mawk that our filed separator is period (surrounded by single quotes). The $3 is basically a variable calling the 3rd field, in our case it&#8217;s the third number in our IP address. The || means &#8220;or&#8221;. The == is to determine is something is equivalent. The &amp;&amp; is &#8220;and&#8221;. The $4 is the 4th number in our IP address because it&#8217;s the 4th field. So the command reads like this: separator is a period, we want the 3rd number to be less than zero or greater than zero or equal to 3 and we want the 4th number to be less than 5 or greater than 15. The $0 represents  the entire line so the print statement is just printing out the entire line that matches our criteria. Let&#8217;s look at a similar example, say we want to extract 192.168.5.10-18.</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">mawk &quot;BEGIN {FS='.'}; $3&amp;lt;5 || $3&amp;gt;5 || ($3==5 &amp;amp;&amp;amp;($4&amp;lt;10 || $4&amp;gt;18)) {print $0}&quot; IPlist.txt</div></div>
<p>I&#8217;m sure there are probably other ways to go about performing the same task but this one works for me. Now feel free to go ahead and <a href="http://www.youtube.com/watch?v=pxjZM-d_ShI" target="_blank">mawk it out</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/search-an-ip-range-via-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reverse engineering Linux executables</title>
		<link>http://travisaltman.com/reverse-engineering-linux-executables/</link>
		<comments>http://travisaltman.com/reverse-engineering-linux-executables/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 03:55:02 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[reverse engineering]]></category>

		<guid isPermaLink="false">http://travisaltman.com/reverse-engineering-linux-executables/</guid>
		<description><![CDATA[There aren&#8217;t a whole lot of options when it comes to reverse engineering Linux executables / binaries. Thanks to Chris Rohlf this process is now much easier and flexible. Chris has created a framework called Leaf that aids in the reversing process. His works strictly focuses on Linux ELF format which is equivalent to Windows [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Leaf ELF framework" href="http://travisaltman.com/wp-content/leaf-logo-1.png"><img src="http://travisaltman.com/wp-content/leaf-logo-1.png" alt="Leaf ELF framework" align="left" /></a>There aren&#8217;t a whole lot of options when it comes to reverse engineering Linux executables / binaries. Thanks to <a title="sharpest cat around when it comes to RE" href="http://em386.blogspot.com/">Chris Rohlf</a> this process is now much easier and flexible. Chris has created a <a title="check-a-check it out" href="http://code.google.com/p/leaf-re/">framework called Leaf</a> that aids in the reversing process. His works strictly focuses on <a href="http://en.wikipedia.org/wiki/Executable_and_Linkable_Format">Linux ELF format</a> which is equivalent to <a href="http://en.wikipedia.org/wiki/Portable_Executable">Windows PE format</a>. Chris gave a talk at <a href="http://www.carolinacon.org/">Carolina Con 2009</a> and his talk about the framework was excellent. It was nice to see that one of his main focal points was creating easy to read output. We all know that if your output is crap then you won&#8217;t be able to make heads or tails of what the tool is doing.</p>
<p>Now the Leaf framework is still in beta but this project is open source and Chris welcomes more input into the project. The framework only works on the x86 architecture but supports both 32 and 64 bit binaries. The title of this post refers to reverse engineering Linux but the Leaf framework works on both BSD and Solaris as well. Hopefully this framework will get good traction as Chris has built a nice foundation.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/reverse-engineering-linux-executables/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CarolinaCon coming up soon</title>
		<link>http://travisaltman.com/carolinacon-coming-up-soon/</link>
		<comments>http://travisaltman.com/carolinacon-coming-up-soon/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 03:09:01 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[learning]]></category>

		<guid isPermaLink="false">http://travisaltman.com/carolinacon-coming-up-soon/</guid>
		<description><![CDATA[That time of year is approaching for the annual goodness that is CarolinaCon. This year the conference will be held March 13 &#8211; 14th. CarolinaCon is essentially a weekend long party with some great talks about technology thrown on top. The hotel bar is just steps away from the rooms where the talks are held [...]]]></description>
			<content:encoded><![CDATA[<p>That time of year is approaching for the annual goodness that is <a href="http://www.carolinacon.org/index.php/" title="CarolinaCon">CarolinaCon</a>. This year the conference will be held March 13 &#8211; 14th. CarolinaCon is essentially a weekend long party with some great talks about technology thrown on top. The hotel bar is just steps away from the rooms where the talks are held so that always makes for a good time. I also encourage others to <a href="http://www.carolinacon.org/index.php/call_for_speakers/" title="CarolinaCon's call for speakers">submit a talk</a> as they are always looking for good speakers but don&#8217;t take too long to submit your talk because submissions are due by January 15th. I&#8217;ll be heading down to Raleigh to check this conference out once again, hope to see you there.</p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/carolinacon-coming-up-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fingerprinting SSL tutorial</title>
		<link>http://travisaltman.com/fingerprinting-ssl-tutorial/</link>
		<comments>http://travisaltman.com/fingerprinting-ssl-tutorial/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 23:25:41 +0000</pubDate>
		<dc:creator>travis</dc:creator>
				<category><![CDATA[web security]]></category>

		<guid isPermaLink="false">http://travisaltman.com/fingerprinting-ssl-tutorial/</guid>
		<description><![CDATA[My tool of choice when it comes to fingerprinting SSL is OpenSSL. There are other tools out there such as thcsslcheck and ssl digger but in my experience these tools tie your hands when you want granular detail. It&#8217;s best to get it straight from the horse&#8217;s mouth &#62;&#62; OpenSSL. This tutorial focuses on fingerprinting [...]]]></description>
			<content:encoded><![CDATA[<p>My tool of choice when it comes to fingerprinting SSL is OpenSSL. There are other tools out there such as <a href="http://freeworld.thc.org/root/tools/">thcsslcheck</a> and <a href="http://www.foundstone.com/us/resources/proddesc/ssldigger.htm">ssl digger</a> but in my experience these tools tie your hands when you want granular detail. It&#8217;s best to get it straight from the horse&#8217;s mouth &gt;&gt; <a href="http://www.openssl.org/">OpenSSL</a>. This tutorial focuses on fingerprinting the ciphers and protocols supported by a SSL server, you can obtain tons of information from OpenSSL but this tutorial will not dig into all those aspects. Also this tutorial won&#8217;t go into the installation of OpenSSL on your OS just the usage thereof. The first step/command is to determine what kind of ciphers a SSL server may use. This is done by issuing the 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">openssl ciphers -v</div></div>
<p>Output of this command can be seen below.</p>
<p><a title="OpenSSL ciphers command" href="http://travisaltman.com/wp-content/opensslcipherscommand.png"><img src="http://travisaltman.com/wp-content/opensslcipherscommand.png" alt="OpenSSL ciphers command" /></a></p>
<p>I use this command on a consistent basis because it lists ciphers from strongest to weakest. So when looking at output from the OpenSSL command you can refer to this list to see how strong or weak the cipher support may be. The &#8220;<strong>openssl ciphers -v</strong>&#8221; command has nothing to do with what cipher the web server you are trying to fingerprint supports, &#8220;<strong>openssl ciphers -v</strong>&#8221; simply lists the ciphers that OpenSSL can check. I repeat the &#8220;<strong>openssl ciphers -v</strong>&#8221; command has nothing to do with the web server you are fingerprinting. You can also check out the man page for additional options when it comes to listing ssl ciphers.</p>
<p>The command you&#8217;ll use the most is</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">openssl s_client</div></div>
<p>but always with options. The &#8220;<strong>s_client</strong>&#8221; argument emulates a SSL client that can connect to a remote device running a SSL service. Another helpful option is &#8220;<strong>-connect</strong>&#8220;. You&#8217;ll need to supply a name/IP and a port (default port is 4433). Enough talking about the commands lets take a look at some examples.</p>
<p><a title="openssl s_client connect template" href="http://travisaltman.com/wp-content/openssl-s_client-connect-template.png"><img src="http://travisaltman.com/wp-content/openssl-s_client-connect-template.png" alt="openssl s_client connect template" /></a></p>
<p>The command above is the basic template you&#8217;ll use to fingerprint a web server that supports SSL. Instead of IP address you could also use the domain name (e.g. travisaltman.com). See the example below.</p>
<p><a title="openssl s_client -connect error" href="http://travisaltman.com/wp-content/opensslerror.png"><img src="http://travisaltman.com/wp-content/opensslerror.png" alt="openssl s_client -connect error" /></a></p>
<p>You&#8217;ll notice that an error message is generated in the example above, that&#8217;s because no SSL service is listening on port 80 at travisaltman.com. This is a typical error message you will see if openssl fails to connect with a SSL service. Now lets see what a successful connection would look like.</p>
<p><a title="openssl successful connection" href="http://travisaltman.com/wp-content/opensslsuccessfulconnection.png"><img src="http://travisaltman.com/wp-content/opensslsuccessfulconnection.png" alt="openssl successful connection" /></a></p>
<p>The connection may seem to hang but you can kill it with a &#8220;Q&#8221; or &#8220;Cntrl C&#8221;, the connection will also eventually timeout. You&#8217;ll first notice how much information you get back from the server via the openssl command, initially it can be overwhelming.  When it comes to fingerprinting I tend to focus on the &#8220;SSL-Session&#8221; section because it tells you what protocol and cipher is being used for the communication. In the &#8220;SSL-section&#8221; above you see that <a href="http://travisaltman.com">travisaltman.com</a> supports the TLSv1 protocol and the cipher is DHE-RSA-AES256-SHA. This is great that it gives us this information but when it comes to fingerprinting we&#8217;ll want to know what other protocols and ciphers the web server supports. Let&#8217;s say we wanted to know if a web server supports SSLv2 instead of SSLv3 or TLSv1. The command below tells openssl to only connect using SSLv2, this is done with the &#8220;-ssl2&#8243; option.</p>
<p><a title="openssl command with ssl2 option" href="http://travisaltman.com/wp-content/opensslspecifyssl2.png"><img src="http://travisaltman.com/wp-content/opensslspecifyssl2.png" alt="openssl command with ssl2 option" /></a></p>
<p>A truncated version of successful output from this command can be seen below.</p>
<p><a title="successful output from ssl2 option in openssl" href="http://travisaltman.com/wp-content/outputopensslspecifyingssl2.png"><img src="http://travisaltman.com/wp-content/outputopensslspecifyingssl2.png" alt="successful output from ssl2 option in openssl" /></a></p>
<p>So you see that my site supports both SSLv2 and SSLv3, in this case the default cipher for communicating over SSLv2 is the DES-CBC3-MD5 cipher.  You&#8217;ll notice from the &#8220;<strong>openssl ciphers -v</strong>&#8221; command that this is the strongest SSLv2 cipher with a key size of 168. You may then be wondering if this SSL server would support weaker SSLv2 keys and also weaker SSLv3 keys. In order to get this granular you would have to specify within openssl which ciphers to check. This is the reason why I love fingerprinting with openssl as oppose to those tools I mentioned at the beginning of this article. So let&#8217;s say you wanted to know if a SSL server supported the weakest SSLv2 cipher, which according the output of &#8220;<strong>openssl ciphers -v</strong>&#8221; is EXP-RC4-MD5, you can issue the 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">openssl s_client -ssl2 -cipher EXP-RC4-MD5 -connect travisaltman.com:443</div></div>
<p>A truncated version of successful output from this command can be seen below.</p>
<p><a title="fingerprinting the weakest SSL2 cipher" href="http://travisaltman.com/wp-content/weakestssl2output.png"><img src="http://travisaltman.com/wp-content/weakestssl2output.png" alt="fingerprinting the weakest SSL2 cipher" /></a></p>
<p>So this proves that my SSL server supports the weakest SSL cipher (40 bit key) possible. Looking through the &#8220;<strong>openssl ciphers -v</strong>&#8221; output you&#8217;ll notice another SSLv2 cipher that supports 40 bit (EXP-RC2-CBC-MD5). If you wanted to figure out if the SSL server supports either one of these SSLv2 40 bit ciphers you could issue the 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">openssl s_client -ssl2 -cipher EXP-RC4-MD5:EXP-RC2-CBC-MD5 -connect travisaltman.com:443</div></div>
<p>The -cipher option behaves like an OR, meaning if any cipher in that colon separated list is found supported by the SSL server the command will execute successfully. Taking a look at an example may clear things up a bit. Let&#8217;s fingerprint our buddies over at <a title="arrrrr maties" href="http://thepiratebay.org/">thepiratebay.org</a> and see what ciphers they support.</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">openssl s_client -cipher AES256-SHA -connect thepiratebay.org:443</div></div>
<p>I won&#8217;t bore you with the output, thepiratebay.org does support this strong cipher, now let&#8217;s try the weakest cipher.</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">openssl s_client -cipher EXP-RC4-MD5 -connect thepiratebay.org:443</div></div>
<p>No dice, they do not support this weak encryption. Now if you combined these ciphers into one option (<strong>-cipher AES256-SHA:EXP-RC4-MD5</strong>) you would get successful output. So the point is to be careful when going through the fingerprinting process as you may think a SSL server supports a weak cipher when in fact they don&#8217;t. So after you have gone through this process and determined what ciphers and protocols the SSL sever supports what should you take away? This is a very good question and one that lots of people have opinions about. The real answer is it depends on what kind of risk you are willing to accept and how easily accessible you want your application to be. In most cases I would recommend only supporting a SSLv3/TLSv1 256 bit cipher because it&#8217;s so easy to implement. Only supporting 256 bit may mean limited access, especially to legacy applications but this is becoming less and less common. Most modern browsers and applications can now easily handle the higher key ciphers. I would also mention <a title="cve is da bomb" href="http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=sslv2">numerous vulnerabilites found within SSLv2</a> including the <a href="http://www.openssl.org/news/secadv_20051011.txt">rollback vulnerability</a> from three years ago. So applications that transmit sensitive information may not want to support SSLv2 at all. Keep in mind that most browsers will attempt to communicate with the highest possible cipher. So even if your SSL server supports SSLv2 for backwards compatibility odds are most users will communicate with the strongest SSLv3/TLSv1 cipher your server supports. You don&#8217;t have to solely rely on openssl, you could also test in Firefox if your SSL server allows communications on weaker ciphers. Simply type about:config in the address bar of Firefox, then in the filter type &#8220;security.ssl&#8221;. From there you can enable and disable various ciphers and see if your SSL sever allows the communication. A screen shot of this can be seen below.</p>
<p><a title="about:config SSL settings within Firefox" href="http://travisaltman.com/wp-content/aboutconfigfirefoxsslsettings.png"><img src="http://travisaltman.com/wp-content/aboutconfigfirefoxsslsettings.png" alt="about:config SSL settings within Firefox" /></a></p>
<p>That pretty much wraps up this tutorial on fingerprinting SSL. In my spare time I wrote a shell script that automated this process for me given a list of IP&#8217;s that were running a SSL sever. This shell script is not ready for prime time but I hope to release a &#8220;tools&#8221; section soon and place some of my other scripts in there as well.  I&#8217;m no guru on this subject it&#8217;s just simply my experience. As always your feedback is welcome.</p>
<p>travis@hacktop:~$ more references</p>
<p><a title="best openssl command line reference" href="http://h71000.www7.hp.com/doc/83final/BA554_90007/rn01.html">http://h71000.www7.hp.com/doc/83final/BA554_90007/rn01.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://travisaltman.com/fingerprinting-ssl-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
