<?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>insanesecurity &#187; RFI</title>
	<atom:link href="http://insanesecurity.info/blog/tag/rfi/feed" rel="self" type="application/rss+xml" />
	<link>http://insanesecurity.info/blog</link>
	<description>security through a distorted eye</description>
	<lastBuildDate>Thu, 25 Feb 2010 22:31:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Access Log Analysis</title>
		<link>http://insanesecurity.info/blog/access-log-analysis</link>
		<comments>http://insanesecurity.info/blog/access-log-analysis#comments</comments>
		<pubDate>Wed, 24 Jun 2009 06:02:37 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[DoS]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[LFI]]></category>
		<category><![CDATA[RFI]]></category>
		<category><![CDATA[Spam]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=33</guid>
		<description><![CDATA[A while ago I wrote an article entitled Logging the HTTP requests! where I mentioned why you should implement a logging system (especially when you haven&#8217;t got access to the access log, like in shared hosting environment) and how to implement a simple (or not) logging system. Today we will go a step further. Maybe [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I wrote an article entitled  <a href="http://insanesecurity.info/2009/01/logging-the-http-requests/">Logging the HTTP requests!</a> where I mentioned why you should implement a logging system (especially when you haven&#8217;t got access to the access log, like in shared hosting environment) and how to implement a simple (or not) logging system. Today we will go a step further.</p>
<p><span id="more-33"></span><br />
Maybe not exactly a full step, but you will understand later on why not.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>In the ending of the article I mentioned that there is a wordpress plugin that does just that, it is called access log (duh) and you can download it from <a href="http://wordpress.org/extend/plugins/access-logs/">here</a>. After installing the plugin and configuring it you may also want to decode the REQUEST_URI because that will help later on for analysis. Just add the <a href="http://php.net/rawurldecode">rawurldecode</a> function to the code:</p>
<p>
<pre>
$href = rawurldecode($_SERVER['REQUEST_URI']);
</pre>
<p>Another important step after installing/configuring the plugin would be to protect the log directory from unwanted visitors. I use a simple .htaccess file to accomplish the task. The following example denotes the rewrite rule I use:</p>
<pre>
RewriteRule ^(.*)$ http://insanesecurity.info [R=301,L]
</pre>
</p>
<p>If you&#8217;re a stranger towards .htaccess files you might be interested in, a short resource based article I wrote, <a href="http://insanesecurity.info/2009/03/htaccess-101/">.htaccess 101</a>.</p>
<p>After a while of log harvesting you might be interested in analyzing the logs and find potential intruders/attackers. That&#8217;s when <a href="http://code.google.com/p/apache-scalp/">Scalp</a> comes in.</p>
<blockquote><p>Scalp! is a log analyzer for the Apache web server that aims to look for security problems. The main idea is to look through huge log files and extract the possible attacks that have been sent through HTTP/GET (By default, Apache does not log the HTTP/POST variable).</p>
</blockquote>
<p>And this is the reason why we take a partial step, because it doesn&#8217;t support custom access log files, thus we cannot analyze POST requests. But let&#8217;s give <a href="http://rgaucher.info/b/">Romain</a> some time, as he&#8217;s working on a improved C++ version of it, which hopefully will have this feature. </p>
<p>Among Scalps features (options) are the following:</p>
<ul>
<li>tough: Will decode a part of potential attacks (this is done to use better the regexp from PHP-IDS in order to decrease the false-negative rate)</li>
<li>period: Specify a time-frame to look at, all the rest will be ignored </li>
<li>sample: Does a random sampling of the log lines in order to look at a certain percentage, this is useful when the user doesn&#8217;t want to do a full scan of all the log, but just ping it to see if there is some problem&#8230; </li>
<li>attack: Specify what classes of vulnerabilities the tool will look at (eg, look only for XSS, SQL Injection, etc.) </li>
</ul>
<p>The things that Scalp can find are: XSS, CSRF, SQL Injection, LFI, RFE (or RFI as some call it), DOS, Directory Transversal, Spam and Information Disclosure.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-4879499347590889";
/* 468x60, created 1/22/09 */
google_ad_slot = "0361207255";
google_ad_width = 468;
google_ad_height = 60;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>For more information you can visit the start page of the project <a href="http://code.google.com/p/apache-scalp/">here</a>, or just go to the download section <a href="http://code.google.com/p/apache-scalp/downloads/list">here</a>. Almost forgot to mention, Scalp is a python script.</p>
<p>Not done just yet, Scalp works with <a href="http://php-ids.org/">PHP-IDS</a>&#8217;s filters, so you&#8217;ll have to download the filter (xml) file from their website to get things working.</p>
<p>Enough said, hopefully Scalp will help you in preventing attackers, rather than helping you in attack forensics.</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/access-log-analysis/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
