<?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>[blog.rayfoo] &#187; tools</title>
	<atom:link href="http://blog.rayfoo.info/tag/tools/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.rayfoo.info</link>
	<description>Infosec, DFIR, tech geekery, thoughts and whatnot</description>
	<lastBuildDate>Wed, 25 Jan 2012 00:36:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Metasploitable!</title>
		<link>http://blog.rayfoo.info/2010/05/metasploitable</link>
		<comments>http://blog.rayfoo.info/2010/05/metasploitable#comments</comments>
		<pubDate>Fri, 21 May 2010 14:14:23 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[practice]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vulnerable]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=559</guid>
		<description><![CDATA[Metasploit now has a utility to allow people to practise pentesting on a controlled environment.  Termed "Metasploitable", I'm guessing it is because it is "pwnable" It's basically an Ubuntu 8.04 server on a VMware 6.5 image, running plenty of old and vulnerable services.  Yummy! It is available to Metasploit Express customers from the Customer Center, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-562" title="metasploit" src="http://blog.rayfoo.info/wp-content/uploads/2010/05/metasploit-300x64.png" alt="" width="300" height="64" />Metasploit now has a utility to allow people to practise pentesting on a controlled environment.  Termed "Metasploitable", I'm guessing it is because it is "pwnable" <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>It's basically an Ubuntu 8.04 server on a VMware 6.5 image, running plenty of old and vulnerable services.  Yummy!</p>
<p>It is available to Metasploit Express customers from the <a href="http://www.rapid7.com/customers/customer-login.jsp">Customer Center</a>, and for the rest of us peeps, it's freely available for <a href="http://www.metasploit.com/documents/express/Metasploitable.zip.torrent">download via Bittorrent</a>. (a bit slow, but I'll try to seed this for as long as possible when I managed to get it entirely)</p>
<p>More info at <a href="http://blog.metasploit.com/2010/05/introducing-metasploitable.html">the blog post</a>.</p>
<p>[via <a href="http://blog.metasploit.com/2010/05/introducing-metasploitable.html">Metasploit Blog</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/05/metasploitable/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weird outgoing IP accesses&#8230;</title>
		<link>http://blog.rayfoo.info/2010/04/weird-outgoing-ip-accesses</link>
		<comments>http://blog.rayfoo.info/2010/04/weird-outgoing-ip-accesses#comments</comments>
		<pubDate>Wed, 28 Apr 2010 16:44:00 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[investigation]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=547</guid>
		<description><![CDATA[Found out by accident (plenty of "accident"s happening with me recently) that one of the home computers has been connecting out to some weird China IP amongst others, all of which are blacklisted according to robtex... Starting to get quite concerned, since there was a lot of stuff that was previously installed, like those that [...]]]></description>
			<content:encoded><![CDATA[<p>Found out by accident (plenty of "accident"s happening with me recently) that one of the home computers has been connecting out to some weird China IP amongst others, all of which are blacklisted according to <a href="http://www.robtex.com/">robtex</a>...</p>
<p>Starting to get quite concerned, since there was a lot of stuff that was previously installed, like those that you "need" to install in order to view online videos.</p>
<p>Will start to do some verbose logging to gather more info, but this isn't looking good so far.  How this came up was because of the way the computer tried to connect to the site, apparently it tried to make too many connections at the same time, causing the router to think that there's a SYN flood attack going on lol.</p>
<p>Culprit #1 - 221.238.197.38 [<a href="http://www.robtex.com/ip/221.238.197.38.html">robtex report</a>]</p>
<p>Other culprits: 204.2.160.27 [<a href="http://www.robtex.com/ip/204.2.160.27.html">rb</a>], 61.155.137.7 [<a href="http://www.robtex.com/ip/61.155.137.7.html">rb</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/04/weird-outgoing-ip-accesses/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting additional (IP/network/location) info along with your Splunk searches</title>
		<link>http://blog.rayfoo.info/2010/04/getting-additional-ipnetworklocation-info-along-with-your-splunk-searches</link>
		<comments>http://blog.rayfoo.info/2010/04/getting-additional-ipnetworklocation-info-along-with-your-splunk-searches#comments</comments>
		<pubDate>Mon, 19 Apr 2010 17:57:07 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[log analysis]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[Splunk]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=529</guid>
		<description><![CDATA[Chanced upon some of the info by accident (smack at the bottom of one part of the Splunk documentation...), but I can't find it now.  Going to share here anyway Some (or probably most/all) of your searches might involve public IP addresses, and more often than not we would want to have additional info along [...]]]></description>
			<content:encoded><![CDATA[<p>Chanced upon some of the info by accident (smack at the bottom of one part of the <a href="http://www.splunk.com/">Splunk</a> <a href="http://www.splunk.com/base/Documentation">documentation</a>...), but I can't find it now.  Going to share here anyway <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Some (or probably most/all) of your searches might involve public IP addresses, and more often than not we would want to have additional info along with the IP address to work with.</p>
<p>Three of the things that we could do in Splunk automatically would be to get IP-location info, or to reverse lookup an IP to a domain, or to lookup a domain to an IP.</p>
<p><span id="more-529"></span></p>
<h1>1. Geolocation</h1>
<p>There're two ways to do geolocating of IPs: using the iplocation command, or to use the MAXMIND app.</p>
<h2>1a. iplocation</h2>
<p>The command iplocation is described as:</p>
<blockquote><p>Finds ips in _raw and looks up the IP location using the hostip.info database. IPs are extracted as ip1, ip2, etc. Cities and Countries are likewise extracted.</p></blockquote>
<p>What we only need to do is to pipe the search to iplocation and let it do the rest!  The lookups are done from the server on the fly, so make sure that the server is able to do whois/ns lookups on the network.</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex | iplocation</span></p>
<p><a href="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-iplocation.png"><img class="aligncenter size-medium wp-image-530" title="splunk iplocation" src="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-iplocation-300x138.png" alt="" width="300" height="138" /></a></p>
<h2>1b. MAXMIND app</h2>
<p>Like previously mentioned before: install the <a href="http://www.splunkbase.com/apps/All/4.x/Add-On/app:Geo+Location+Lookup+Script">MAXMIND app</a>, then pipe the field containing IPs to the lookup (the field name <em>must</em> be clientip, if not this will not work duh)</p>
<p>This can work with the server not having any internet connectivity, but the accuracy is entirely dependant on the cached MAXMIND database.</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex | lookup geoip clientip</span></p>
<p style="text-align: center;">or</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex2 | lookup geoip clientip as fieldwithip</span></p>
<p><a href="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-geoiplookup.png"><img class="aligncenter size-medium wp-image-531" title="splunk geoiplookup" src="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-geoiplookup-300x137.png" alt="" width="300" height="137" /></a></p>
<h2>2, 3. IP-hostname or hostname-IP</h2>
<p>These two items are pretty similar.  Spunk 4 comes with a lookup script called external_lookup.py, and the config is already in the default transforms.conf.  So we only need to use it!</p>
<p style="text-align: center;">Resolving IPs to hostnames:</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex | lookup dnslookup clientip</span></p>
<p><a href="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-ip-to-hostname.png"><img class="aligncenter size-medium wp-image-532" title="splunk ip to hostname" src="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-ip-to-hostname-300x136.png" alt="" width="300" height="136" /></a></p>
<p style="text-align: center;">Resolving hostnames to IPs:</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex | lookup dnslookup clienthost</span></p>
<p style="text-align: center;">(no screenshot, sorry <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
<p style="text-align: center;"><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; color: #339966;"><span style="line-height: 18px; white-space: pre; font-size: small;"><br />
</span></span></p>
<p>Leave a comment if this helped, or if you want to ask anything!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/04/getting-additional-ipnetworklocation-info-along-with-your-splunk-searches/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshooting Splunk</title>
		<link>http://blog.rayfoo.info/2010/03/troubleshooting-splunk</link>
		<comments>http://blog.rayfoo.info/2010/03/troubleshooting-splunk#comments</comments>
		<pubDate>Mon, 08 Mar 2010 14:27:51 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[data mining]]></category>
		<category><![CDATA[log analysis]]></category>
		<category><![CDATA[log collection]]></category>
		<category><![CDATA[logs]]></category>
		<category><![CDATA[Splunk]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=478</guid>
		<description><![CDATA[Have been fiddling around with Splunk lately.  Splunk's a really good tool to use for log collection and analysis (and that's oversimplifying it, I believe it can even do event correlation...), which really made my love for data mining go crazy of late:P  Best part is that it has a perpetual free license, nice! One [...]]]></description>
			<content:encoded><![CDATA[<p>Have been fiddling around with <a href="http://www.splunk.com/">Splunk</a> lately.  Splunk's a really good tool to use for log collection and analysis (and that's oversimplifying it, I believe it can even do event correlation...), which really made my love for data mining go crazy of late:P  Best part is that it has a perpetual free license, nice!</p>
<p>One of the things I encountered when using Splunk was that it didn't seem to be indexing all the log files that it was set to monitor.  After some reading up and experimenting the reason became clear: Splunk will not work properly if you set it to monitor too many files.</p>
<p>How many is too many?  For example, setting it to monitor a logfile directory which only has one active log and 100+++ rotated logs, is too many.  What should be done instead is to set it to monitor the active logfile only, and use oneshot adding of the other logfiles to the index you want.</p>
<p>Gonna do some more sharing/writeups about this crazily great tool.  There's really a lot that this thing can do man.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/03/troubleshooting-splunk/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful Firefox Plugins</title>
		<link>http://blog.rayfoo.info/2010/03/useful-firefox-plugins</link>
		<comments>http://blog.rayfoo.info/2010/03/useful-firefox-plugins#comments</comments>
		<pubDate>Wed, 03 Mar 2010 15:46:23 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[information gathering]]></category>
		<category><![CDATA[penetration testing]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=474</guid>
		<description><![CDATA[Sharing my list of favourite Firefox plugins.  Some are used more for only when doing web application penetration testing, whereas some are useful for everyday awareness/protection when surfing around the interwebs.  Do leave comments if this helps, or you have any complaints/suggestions to help improve the list Adblock Plus: you know what this is for... [...]]]></description>
			<content:encoded><![CDATA[<p>Sharing my list of favourite Firefox plugins.  Some are used more for only when doing web application penetration testing, whereas some are useful for everyday awareness/protection when surfing around the interwebs.  Do leave comments if this helps, or you have any complaints/suggestions to help improve the list <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<ul>
<li><a href="https://addons.mozilla.org/firefox/addon/1865">Adblock Plus</a>: you know what this is for...  Remember to disable when performing penetration testing.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2489">CacheViewer</a>: Allows for viewing and sorting of cache files.  Seldom used, but a great tool nonetheless when the need comes for it.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2166">Domain Details</a>: Displays plenty of information about the server (type, headers, IP, location) that you're accessing.  Good for basic information awareness during normal surfing.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/26">Download Statusbar</a>: View and manage downloads from a tidy statusbar.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/201">DownThemAll</a>: For fast grabbing of files from a directory.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug</a>: Powerful tool for web developers that allows you to freely manipulate/view the loaded objects for a page.  I haven't really figured out how to use this for penetration testing yet though.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/748">Greasemonkey</a>: Could come in very handy if you want to do some mods to a site's page automatically, remember to enable/disable the scripts that aren't needed when on a penetration testing job.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/10909">IE Tab</a>: Don't really use this, unless I get a site that's coded to work only with "browsers like IE".</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/3863">iMacros for Firefox</a>: Another powerful macro editing/playback tool, I don't use this though <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/216">JavaScript Debugger</a>: JS debugger and profiler, more useful for web developers I think.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP headers</a>: Great for showing basic information about the HTTP headers being exchanged.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/722">NoScript</a>: A MUST-HAVE for Forefox.  Whitelists the scripts and objects that are allowed to load for a domain, amongst other protection features against other nasties out there.  Remember to disable for penetration testing engagements.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/13308">People Search and Public Record Toolbar</a>: Great tool for information gathering, pity I never had the chance to <em>really</em> use it <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/8186">ScrapBook</a>: Aids in archiving and organizing pages.  I use it to profile a site's workflow.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/125">SwitchProxy</a> / <a href="https://addons.mozilla.org/en-US/firefox/addon/2464">FoxyProxy</a>: A must-have for changing between the many proxy tools that I use.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/966">Tamper Data</a>: I use this to grab extra timeline information about the loading of pages.  Also allows you to do request/response editing.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/59">User Agent Switcher</a>: Self explanatory.  Useful for certain situations only.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2214">View Dependencies</a>: A must-have for organizing image/JavaScript/CSS resources for a page in a tidy manner.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/697">View formatted source</a>: Formats HTML source neatly for viewing.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/655">View Source Chart</a>: Formats final document DOM (after all the loading/JavaScript events have finished firing) for easy viewing.  Also for when View formatted source isn't available for the version of Firefox that you're using.</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer</a>: Great for manipulating the forms/cookies/JavaScript/whatnot on a page.  A definite must-have for penetration testing.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/03/useful-firefox-plugins/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Web Security Dojo v1.0 release</title>
		<link>http://blog.rayfoo.info/2010/02/web-security-dojo-v1-0-release</link>
		<comments>http://blog.rayfoo.info/2010/02/web-security-dojo-v1-0-release#comments</comments>
		<pubDate>Fri, 26 Feb 2010 16:19:48 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[training]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=455</guid>
		<description><![CDATA[Web Security Dojo is a turnkey web application security lab with tools, targets, and training materials built into a Virtual Machine(VM). It is ideal for both self-instruction and training classes since everything is pre-configured and no external network connection is needed. All tools and targets are configured to use non-conflicting ports and a Firefox proxy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mavensecurity.com/dojo.php"><img class="alignright size-full wp-image-456" title="Maven" src="http://blog.rayfoo.info/wp-content/uploads/2010/02/Maven-chop.png" alt="" width="157" height="148" /></a></p>
<blockquote><p>Web Security Dojo is a turnkey web application security lab with tools, targets, and training materials built into a Virtual Machine(VM).  It is ideal for both self-instruction and training classes since everything is pre-configured and no external network connection is needed.  All tools and targets are configured to use non-conflicting ports and a Firefox proxy switcher is set up to match.</p>
<p>Web Security Dojo is an open source project built on Ubuntu and hosted at SourceForge.  It is available in three flavors: a Virtualbox VM, VMWare VM, and a build script which can be used on a standard Ubuntu 9.10 install to produce the Dojo.  Collaboration and contributions are welcomed.</p></blockquote>
<p>Looks pretty promising, I will be checking this out and writing more (as usual, when my "relaxed" schedule allows me to) later.  But this looks like one of those training tools that I wished existed far earlier: a full environment with the targets and tools to let you learn and train your web application security kung-fu.</p>
<p>So what're you waiting for ?!  <a href="http://dojo.mavensecurity.com/">Go grab a copy</a> and try it out!  Unless you really really want to see a review from me first.  Heeeyyaaaahhhh!!</p>
<p><object width="580" height="360"><param name="movie" value="http://www.youtube.com/v/lum6bSsyJ38&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999&#038;hd=1&#038;border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/lum6bSsyJ38&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999&#038;hd=1&#038;border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="580" height="360"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/02/web-security-dojo-v1-0-release/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Want to learn learn about cryptography and cryptanalysis?</title>
		<link>http://blog.rayfoo.info/2009/10/want-to-learn-learn-about-cryptography-and-cryptanalysis</link>
		<comments>http://blog.rayfoo.info/2009/10/want-to-learn-learn-about-cryptography-and-cryptanalysis#comments</comments>
		<pubDate>Fri, 30 Oct 2009 10:16:56 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[cryptanalysis]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=321</guid>
		<description><![CDATA[CrypTool seems pretty impressive as a learning/teaching tool.  Do check it out! Runs in Windows only, though that's not going to stop me from trying to run it under Wine.. heh.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cryptool.de/index.php/en/">CrypTool</a> seems pretty impressive as a learning/teaching tool.  Do check it out!</p>
<p>Runs in Windows only, though that's not going to stop me from trying to run it under Wine.. heh.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2009/10/want-to-learn-learn-about-cryptography-and-cryptanalysis/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Verifying rkhunter file warnings</title>
		<link>http://blog.rayfoo.info/2009/10/verifying-rkhunter-file-warnings</link>
		<comments>http://blog.rayfoo.info/2009/10/verifying-rkhunter-file-warnings#comments</comments>
		<pubDate>Mon, 12 Oct 2009 06:46:26 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[detection]]></category>
		<category><![CDATA[Finnix]]></category>
		<category><![CDATA[hardening]]></category>
		<category><![CDATA[rkhunter]]></category>
		<category><![CDATA[rootkit]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server administration]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=250</guid>
		<description><![CDATA[I got this problem as my rkhunter installation detected changed files (due to updates), so I encountered this solution by steve as I was searching for a solution. Of course, as there could be a root kit/trojan/malicious stuff running in your system as rkhunter's meant to detect, you should NOT fully trust anything running from [...]]]></description>
			<content:encoded><![CDATA[<p>I got this problem as my <a href="http://www.rootkit.nl/projects/rootkit_hunter.html">rkhunter</a> installation detected changed files (due to updates), so I encountered this <a href="http://www.shuningbian.net/2009/06/dealing-with-rkhunter-warnings.php">solution</a> by <a href="http://www.shuningbian.net/">steve</a> as I was searching for a solution.</p>
<p>Of course, as there could be a root kit/trojan/malicious stuff running in your system as rkhunter's meant to detect, you should NOT fully trust anything running from the machine.  But I had to rely on this solution temporarily until I can get it (rebooted and) checked out proper using a tool like <a href="http://www.finnix.org/">Finnix</a>.<br />
Am reposting the script here for reference, but you can get the most recent copy of the script <a href="http://git.pictorii.com/?p=scripts.git;a=blob_plain;f=verify.sh;hb=rei">here</a> .<br />
<span id="more-250"></span></p>
<p>
<pre style="color:green">#!/bin/bash
desc="
This script will verify whether files for which rkhunter has logged a
warning for is still valid. It does this by finding which debian package
it came out of, and downloads them, unpacks them, then checks
the checksums.

Run it by supplying a rkhunter log file as first argument
"

HASHER="sha256sum"

IFS="
"
function find_suspect_files
{
	echo "parsing $1 for suspect files" 1>&#038;2
	grep -1 Warning "$1"| grep File | sed 's|.*File: ||'
}

function find_packages
{
	echo "finding packages" 1>&#038;2
	for suspect_file in $1
	do
		package=$(dpkg -S $suspect_file|awk '{print $1}'|sed 's/.$//')
		echo "suspect file $suspect_file found in $package" 1>&#038;2
		echo $package
	done

}

function make_aptitude_args
{
	echo "generating aptitude arguments" 1>&#038;2
	for package in $1
	do
		version=$(dpkg -p $package | grep Version | awk '{print $2}')
		echo $package=$version
	done
}

function cleanup
{
	echo "cleaning up"
	popd
	rm -rf tmp
	exit $1
}

function setup
{
	echo "setting up"
	rm -rf tmp
	mkdir tmp
	pushd tmp
}

if [ $# -ne 1 ];
then
	echo "$desc"
	exit 1
fi

suspect_files=$(find_suspect_files "$1")

packages=$(find_packages "$suspect_files" | sort | uniq)

if [ -z "$packages" ];
then
	echo "***WARNING****"
	echo "No packages contain any of the suspect files!"
	cleanup 1
fi

aptitude_args=$(make_aptitude_args "$packages")

setup

echo "downloading packages"
aptitude download $aptitude_args 1>/dev/null
if [ $? -ne 0 ];
then
	echo "aptitude download failed!"
	echo "args=$aptitude_args"
	cleanup 1
fi

echo "unpacking"
for deb_file in *.deb
do
	ar -x $deb_file
	tar zxf data.tar.gz
	rm -rf data.tar.gz control.tar.gz
done

for suspect_file in $suspect_files
do
	if [ ! -f ".$suspect_file" ]
	then
		echo "***WARNING****"
		echo "For some reason .$suspect_file does not exis!"
		continue
	fi
	echo -n "verifying $suspect_file... "
	suspect_sum=$($HASHER $suspect_file | awk '{print $1}')
	clean_sum=$($HASHER ".$suspect_file" | awk '{print $1}')
	if [ $suspect_sum == $clean_sum ];
	then
		echo "OK"
	else
		echo
		echo "***WARNING****"
		echo "Checksum mistmatch for $suspect_file!!!"
		echo "Should be: $clean_sum"
		echo "Is: $suspect_sum"
	fi
done
cleanup</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2009/10/verifying-rkhunter-file-warnings/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Slowloris against nginx</title>
		<link>http://blog.rayfoo.info/2009/10/testing-slowloris-against-nginx</link>
		<comments>http://blog.rayfoo.info/2009/10/testing-slowloris-against-nginx#comments</comments>
		<pubDate>Mon, 12 Oct 2009 05:59:24 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[RSnake]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Slowloris]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=244</guid>
		<description><![CDATA[CCCCCCCCCCOOCCOOOOO888@8@8888OOOOCCOOO888888888@@@@@@@@@8@8@@@@888OOCooocccc:::: CCCCCCCCCCCCCCCOO888@888888OOOCCCOOOO888888888888@88888@@@@@@@888@8OOCCoococc::: CCCCCCCCCCCCCCOO88@@888888OOOOOOOOOO8888888O88888888O8O8OOO8888@88@@8OOCOOOCoc:: CCCCooooooCCCO88@@8@88@888OOOOOOO88888888888OOOOOOOOOOCCCCCOOOO888@8888OOOCc:::: CooCoCoooCCCO8@88@8888888OOO888888888888888888OOOOCCCooooooooCCOOO8888888Cocooc: ooooooCoCCC88@88888@888OO8888888888888888O8O8888OOCCCooooccccccCOOOO88@888OCoccc ooooCCOO8O888888888@88O8OO88888OO888O8888OOOO88888OCocoococ::ccooCOO8O888888Cooo oCCCCCCO8OOOCCCOO88@88OOOOOO8888O888OOOOOCOO88888O8OOOCooCocc:::coCOOO888888OOCC oCCCCCOOO88OCooCO88@8OOOOOO88O888888OOCCCCoCOOO8888OOOOOOOCoc::::coCOOOO888O88OC oCCCCOO88OOCCCCOO8@@8OOCOOOOO8888888OoocccccoCO8O8OO88OOOOOCc.:ccooCCOOOO88888OO CCCOOOO88OOCCOOO8@888OOCCoooCOO8888Ooc::...::coOO88888O888OOo:cocooCCCCOOOOOO88O CCCOO88888OOCOO8@@888OCcc:::cCOO888Oc..... ....cCOOOOOOOOOOOc.:cooooCCCOOOOOOOOO OOOOOO88888OOOO8@8@8Ooc:.:...cOO8O88c. . .coOOO888OOOOCoooooccoCOOOOOCOOOO OOOOO888@8@88888888Oo:. . ...cO888Oc.. .oOOOOOOOOOCCoocooCoCoCOOOOOOOO COOO888@88888888888Oo:. .O8888C: .oCOo. ...cCCCOOOoooooocccooooooooCCCOO CCCCOO888888O888888Oo. .o8Oo. .cO88Oo: :. .:..ccoCCCooCooccooccccoooooCCCC coooCCO8@88OO8O888Oo:::... .. :cO8Oc. . ..... :. .:ccCoooooccoooocccccooooCCC :ccooooCO888OOOO8OOc..:...::. .co8@8Coc::.. .... ..:cooCooooccccc::::ccooCCooC .:::coocccoO8OOOOOOC:..::....coCO8@8OOCCOc:... ....:ccoooocccc:::::::::cooooooC ....::::ccccoCCOOOOOCc......:oCO8@8@88OCCCoccccc::c::.:oCcc:::cccc:..::::coooooo .......::::::::cCCCCCCoocc:cO888@8888OOOOCOOOCoocc::.:cocc::cc:::...:::coocccccc ...........:::..:coCCCCCCCO88OOOO8OOOCCooCCCooccc::::ccc::::::.......:ccocccc:co .............::....:oCCoooooCOOCCOCCCoccococc:::::coc::::....... ...:::cccc:cooo ..... ............. .coocoooCCoco:::ccccccc:::ccc::.......... ....:::cc::::coC . . ... .... [...]]]></description>
			<content:encoded><![CDATA[<pre><span style="font-size: 9px; line-height: 8pt;">CCCCCCCCCCOOCCOOOOO888@8@8888OOOOCCOOO888888888@@@@@@@@@8@8@@@@888OOCooocccc::::
CCCCCCCCCCCCCCCOO888@888888OOOCCCOOOO888888888888@88888@@@@@@@888@8OOCCoococc:::
CCCCCCCCCCCCCCOO88@@888888OOOOOOOOOO8888888O88888888O8O8OOO8888@88@@8OOCOOOCoc::
CCCCooooooCCCO88@@8@88@888OOOOOOO88888888888OOOOOOOOOOCCCCCOOOO888@8888OOOCc::::
CooCoCoooCCCO8@88@8888888OOO888888888888888888OOOOCCCooooooooCCOOO8888888Cocooc:
ooooooCoCCC88@88888@888OO8888888888888888O8O8888OOCCCooooccccccCOOOO88@888OCoccc
ooooCCOO8O888888888@88O8OO88888OO888O8888OOOO88888OCocoococ::ccooCOO8O888888Cooo
oCCCCCCO8OOOCCCOO88@88OOOOOO8888O888OOOOOCOO88888O8OOOCooCocc:::coCOOO888888OOCC
oCCCCCOOO88OCooCO88@8OOOOOO88O888888OOCCCCoCOOO8888OOOOOOOCoc::::coCOOOO888O88OC
oCCCCOO88OOCCCCOO8@@8OOCOOOOO8888888OoocccccoCO8O8OO88OOOOOCc.:ccooCCOOOO88888OO
CCCOOOO88OOCCOOO8@888OOCCoooCOO8888Ooc::...::coOO88888O888OOo:cocooCCCCOOOOOO88O
CCCOO88888OOCOO8@@888OCcc:::cCOO888Oc..... ....cCOOOOOOOOOOOc.:cooooCCCOOOOOOOOO
OOOOOO88888OOOO8@8@8Ooc:.:...cOO8O88c.      .  .coOOO888OOOOCoooooccoCOOOOOCOOOO
OOOOO888@8@88888888Oo:. .  ...cO888Oc..          .oOOOOOOOOOCCoocooCoCoCOOOOOOOO
COOO888@88888888888Oo:.       .O8888C:  .oCOo.  ...cCCCOOOoooooocccooooooooCCCOO
CCCCOO888888O888888Oo. .o8Oo. .cO88Oo:       :. .:..ccoCCCooCooccooccccoooooCCCC
coooCCO8@88OO8O888Oo:::... ..  :cO8Oc. . .....  :.  .:ccCoooooccoooocccccooooCCC
:ccooooCO888OOOO8OOc..:...::. .co8@8Coc::..  ....  ..:cooCooooccccc::::ccooCCooC
.:::coocccoO8OOOOOOC:..::....coCO8@8OOCCOc:...  ....:ccoooocccc:::::::::cooooooC
....::::ccccoCCOOOOOCc......:oCO8@8@88OCCCoccccc::c::.:oCcc:::cccc:..::::coooooo
.......::::::::cCCCCCCoocc:cO888@8888OOOOCOOOCoocc::.:cocc::cc:::...:::coocccccc
...........:::..:coCCCCCCCO88OOOO8OOOCCooCCCooccc::::ccc::::::.......:ccocccc:co
.............::....:oCCoooooCOOCCOCCCoccococc:::::coc::::....... ...:::cccc:cooo
 ..... ............. .coocoooCCoco:::ccccccc:::ccc::..........  ....:::cc::::coC
   .  . ...    .... ..  .:cccoCooc:..  ::cccc:::c:.. ......... ......::::c:cccco
  .  .. ... ..    .. ..   ..:...:cooc::cccccc:.....  .........  .....:::::ccoocc
       .   .         .. ..::cccc:.::ccoocc:. ........... ..  . ..:::.:::::::ccco</span></pre>
<p>Testing <a href="http://ha.ckers.org/">RSnake</a>'s <a href="http://ha.ckers.org/slowloris/">Slowloris</a> tool against a test <a href="http://nginx.org/">nginx</a> setup for myself: Though at first glance nginx is indeed not susceptible to such an attack, but observing the actual behaviour shows up some weird points.  Will write more when I have some more answers/observations.</p>
<p><a href="#conclusions">Conclusions</a> can be found at the bottom of this post, if you can't stand reading about experiments and whatnot.</p>
<h1>Edit (15 Oct)</h1>
<p>It seems that nginx <em>is</em> indeed affected by the Slowloris attack.  Whilst the attack is in progress, no other connections can be made to the server (thus causing the DOS situation).</p>
<p>Based on the way Slowloris works (sending headers slooooowly) the reason why this works against nginx is because of the max file descriptors limit.  Apparently each network connection to any process uses up one file descriptor, and the OS limits this number (ulimit in linux).  By default it is set to 1024, though it can be changed.</p>
<p>I'm not sure whether this is exactly the same as the original Slowloris attack, because Slowloris exhausts a web server specific resource (Apache's max clients for example), whereas hitting max file descriptor limits is a OS/process level "resource".</p>
<p>This is a problem nonetheless, because we could try to raise the max file descriptors limit for the nginx process, and they still can be all taken up by long-lived slow-sending HTTP requests like what Slowloris does.  The only difference is that it would take FAR more connections to Slowloris attack a nginx server successfully as compared to process-cased web servers like Apache.</p>
<p>A problem encountered so far is that nginx seems not to honour the <a href="http://wiki.nginx.org/NginxHttpCoreModule#client_header_timeout">client_header_timeout</a> directive, so it starts returning a "Request time out" status (408) to the Slowloris threads after a while, even when Slowloris is set to a far lower timeout than the nginx server is.  Will need to check up more on this, though with this behaviour nginx automatically recovers from a Slowloris attack after a while <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<h1>Edit (27 Oct)</h1>
<p>After checking out <em>id</em>s and <em>maxim</em>s reply in the forums, did some tests with the max file descriptors raised for the nginx process.  Did it not by raising the <em>ulimit -n</em> value, but by setting <a href="http://wiki.nginx.org/NginxHttpMainModule#worker_rlimit_nofile">worker_rlimit_nofile</a> to a higher value.  As a result nginx was able to take in "more" concurrent incoming connections this time, at least till the new ulimit for the nginx process was hit.</p>
<p>An interesting thing of note is that the client_header_timeout directive determines how much time a connection has to complete sending its headers for the request to be processed, and not how long nginx is willing to wait after receiving a header before it deems a connection as timed out.  This turned out to be the main factor in defending nginx against SlowLoris, when combined with nginxs other characteristics.<br />
<a id="conclusions" name="conclusions"></a></p>
<h1>Conclusions</h1>
<p>1. nginx is able to defend against small-mid scale SlowLoris attacks because it terminates requests that have not completed within a specified time (60 sec by default).  Thus the basic SlowLoris attack <span style="color: #ff0000;"><strong>WON'T</strong></span> work, since it relies on sending headers one at a time to keep a connection occupied.</p>
<p>2. nginx can be downed by SlowLoris, however, if many attack nodes are used.  We will need a total of <span style="color: #ff6600;"><em>file descriptor limit for nginx / 50</em></span> SlowLoris threads to successfully mount an attack.  50 because SlowLoris is coded to run 50 connections per thread.  This would (in theory) cause any released connections to be quickly taken up again by new SlowLoris connections.  SlowLoris would also have to be set at &lt;60 secs to work.  This is more like a DDOS attack than a SlowLoris attack though...</p>
<p>3. The problem with (2) above is that we might need a huge number of resources to mount it (DDOS level?).  If nginx was set to 100,000 max files limit, we would then need 100,000 / 50 = 2000 SlowLoris threads!</p>
<p>4. The access logs for nginx show the attack <span style="color: #ff0000;"><strong>in progress</strong></span> as it kicks out the client connections <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So... nginx is a good web server, use it! <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2009/10/testing-slowloris-against-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

