<?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; Spam</title>
	<atom:link href="http://insanesecurity.info/blog/tag/spam/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>That&#8217;s a cool trick</title>
		<link>http://insanesecurity.info/blog/thats-a-cool-trick</link>
		<comments>http://insanesecurity.info/blog/thats-a-cool-trick#comments</comments>
		<pubDate>Wed, 27 Jan 2010 18:01:06 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/?p=304</guid>
		<description><![CDATA[Today when reddit was down for maintenance people kept gathering on the #redditdowntime channel on freenode where under a couple of minutes intriguing things started to happen. You can read the whole story here (and come back afterwards). TLDR: the channel (through some javascript code) got link spammed in huge numbers. The code &#8211; which [...]]]></description>
			<content:encoded><![CDATA[<p>Today when reddit was down for maintenance people kept gathering on the <a href="http://irc.freenode.net:6667/redditdowntime">#redditdowntime channel on freenode</a> where under a couple of minutes intriguing things started to happen.</p>
<p>You can read the whole story <a href="http://unethicalblogger.com/posts/2010/01/using_browser_piss_irc_users_or_spamming_redditdowntime">here</a> (and come back afterwards).<br />
<span id="more-304"></span><br />
TLDR: the channel (through some javascript code) got link spammed in huge numbers.</p>
<p>The code &#8211; which you can find in the article I&#8217;ve pointed earlier &#8211; basically has an iframe, a form with an input tag (pointing to the iframe) and a small javascript code to do the magic.</p>
<p>What I&#8217;ve liked in the code is the way it sends the connection and &#8220;payload&#8221; to the irc server; via the following (combined) string.</p>
<pre>
x.value = '\r\nUSER '+i+' 8 * :'+n+ // user
          '\r\nNICK '+n+ // nick
          '\r\nJOIN #redditdowntime\r\n'
          +new Array(99).join(
              'PRIVMSG #redditdowntime :http://bit.ly/lolreddit\r\n'
          )+'';
</pre>
<p>And I like especially the last part of the payload, of which my first impression was that is creating 99 new lines and lastly the actual message as a way to wait while the server responded correctly.</p>
<p>Soon afterwards (couple of seconds, I swear) I realized that this snippet of code generates 100 messages to send.</p>
<p>Nice trick, I&#8217;ll remember it next time I&#8217;ll have to do a string repeat.</p>
<p>And as in any situation where someone needs to be blamed, this time the blame fell upon the Freenode sysadmins; and it was said in such a lovely way.</p>
<blockquote cite="Freenode is run by morons"><p>
IN MY HUMBLE OPINION, (THIS IS MY OPINION AND NOT FACT):</p>
<p>Freenode is run by morons who can&#8217;t read IRCD config files. It is that simple.</p>
<p>Instead of reading the docs, freenode is switching to another IRCD to solve this &#8220;problem&#8221;. Well the problem is between the chair and the keyboard of the freenode admins. The thing you posted should not work at all against a properly configured IRCD. Instead REAL ADMINS with the practical skills of READING COMPREHENSION read the DOCUMENTS that describe the CONFIGURATION OPTIONS. And then they turn on the one feature invented in the 90s that will stop this dead.</p>
<p>But no, freenode has historically been run by people who don&#8217;t seem to exhibit any understanding of an IRC server or sysadmining. They will convert the entire network on the 30th to a new IRC which allows to ban users who send HTTP header to an IRC Server. Instead of reading the docs and turning on a certain option WHICH I WILL NOT SHARE HERE BECAUSE FREENODE ADMINS ARE IDIOTS AND SHOULD READ THE BLOODY DOCS.</p>
<p>Also firewalling with a pattern match on POST would&#8217;ve solved these problems too. But freenode admins are not the brightest admins.
</p></blockquote>
<p>And all of this because a Reddit user once owned a Digg user&#8230;. I can&#8217;t find the picture!</p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/thats-a-cool-trick/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>
		<item>
		<title>Spam free forms and contact details</title>
		<link>http://insanesecurity.info/blog/spam-free-forms-and-contact-details</link>
		<comments>http://insanesecurity.info/blog/spam-free-forms-and-contact-details#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:47:38 +0000</pubDate>
		<dc:creator>dblackshell</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[CAPTCHA]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://insanesecurity.info/blog/spam-free-forms-and-contact-details</guid>
		<description><![CDATA[I always have been annoyed by things like: the morning alarm clock, long distance travels, undocumented functions and spam. But from all the above mentioned spam as well may be the most annoying one from it, the rest of them don&#8217;t happen that often. And certainly we realize the mass spreading of spam when we [...]]]></description>
			<content:encoded><![CDATA[<p>I always have been annoyed by things like: the morning alarm clock, long distance travels, undocumented functions and spam. But from all the above mentioned spam as well may be the most annoying one from it, the rest of them don&#8217;t happen that often.<br />
<span id="more-17"></span><br />
And certainly we realize the mass spreading of spam when we see the statistics for <a href="http://files.data.timgraham.net.s3.amazonaws.com/tg/blogs/data/wp-content/uploads/amonthofspam.gif">a month of spam</a>. Unfortunately the number of spammers will grow/maintain itself long from now on. Until spammers get paid I can&#8217;t see why they would stop. Hell, some people try making money by <a href="http://www.forward-moving.com/blog/2006/10/12/spam-a-battle-worth-fighting/">trademarking the word spam</a>.</p>
<p>Well, enough said about that, the main issue we are facing is how to reduce the spam we get. I&#8217;m not talking about email protection, or blog protection; I don&#8217;t know how you people consider, but I think Akismet is doing a great job for blogs! I want to talk about those moments when you create a contact/comment page and want to make it spam proof.</p>
<h2>Are you human? (CAPTCHA)</h2>
<p>It seems to be the solution in many cases. But I&#8217;m not talking about making your own CAPTCHA, if you lack the experience. Some did it and it went from &#8217;simple&#8217; to imposible: take a look at <a href="http://www.geeksaresexy.net/2008/04/24/rapidshare-captcha-will-drive-you-crazy/">RapidShare&#8217;s CAPTCHA</a>. Instead I would recommend you to implement <a href="http://recaptcha.net/">reCAPTCHA</a>. Apart from the fact that you can reinitialize a CAPTCHA when you can&#8217;t read it, it has playable sound version of it for visualy impaled people. And on top of all this you help <a href="http://recaptcha.net/learnmore.html">digitize old texts</a>. As if that weren&#8217;t enough, it protects you from bots that may have surpased the other protection techniques.</p>
<p><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 type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h2>The math question = ?</h2>
<p>I bet you all have seen it, quite often used in a static equation way. I have also wrote about it on my last home of the blog in the article <a href="http://insanesecurity.wordpress.com/2008/04/22/less-spam-on-blogs/">less spam on blogs</a>. I think that I said enough about it there.</p>
<h2>Javascript to the rescue!?</h2>
<p>It may seem that the simplest and handier way to protect a form against spam bots may as well be Javascript. We live in a web 2.0 enviroument, full of Javascript effects and only a handful of people have it restricted with <a href="http://noscript.net">NoScript</a> or something of sort. Thus we can safely use javascript as a protection against spam. Why? Because normal bots can&#8217;t parse (execute) Javascript code, even crawlers (GoogleBot, YahooBot) parse Javascript code only for obvious links, email addresses, etc.</p>
<p>There are two ways to do a form with Javascript: DOM way and simple dumping way. Simple is better:</p>
<pre>
&lt;form action="target.php"&gt;
  &lt;script type="text/javascript"&gt;
    document.write('&lt;in'+'put type="text" name="human" /&gt;');
    document.write('&lt;inpu'+'t type="submit" /&gt;');
  &lt;/script&gt;
&lt;/form&gt;
</pre>
<p>The concatenation of the strings is needed so that the bots can&#8217;t match it against there usual input regular expressions. I used this type of protection for displaying my email address on the <a href="http://insanesecurity.info/about/">About</a> page, although could have used <a href="http://mailhide.recaptcha.net/">MailHide</a> also. Didn&#8217;t want to bother my readers that much.</p>
<h2>Conclusion</h2>
<p>Actually it&#8217;s totally up to you to choose one of the above. CAPTCHA would be the best, but in some particular cases there is no need to bother your users so much, check my previous example.</p>
<p>Update: <a href="http://www.csarven.ca/hiding-email-addresses">Hide email address in source code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://insanesecurity.info/blog/spam-free-forms-and-contact-details/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
