<?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>Schadenfreude &#187; spam</title>
	<atom:link href="http://www.ralree.com/tag/spam/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ralree.com</link>
	<description>Malicious enjoyment derived from observing someone else's misfortune</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:49:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Fighting Spam on Typo with Logic</title>
		<link>http://www.ralree.com/2007/02/05/fighting-spam-on-typo-with-logic/</link>
		<comments>http://www.ralree.com/2007/02/05/fighting-spam-on-typo-with-logic/#comments</comments>
		<pubDate>Mon, 05 Feb 2007 14:29:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[typo]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2007/10/13/fighting-spam-on-typo-with-logic</guid>
		<description><![CDATA[I realized that spam bots are stupid, and spammers are generally not the best programmers, so a while back I made a system to fight the intolerable spam plaguing us. I noted today that Robby on Rails was having this same problem, and I figured I might as well share what has worked for me. First, I added this line to my views/articles/_comment_box.rhtml: # &#60;td&#62;&#60;p&#62;&#60;label for=&#34;comment_body&#34;&#62;Your message&#60;/label&#62;&#60;/p&#62;&#60;/td&#62; # &#60;td valign=&#34;top&#34; colspan=&#34;2&#34;&#62; # &#60;%= text_area &#34;comment&#34;, &#34;body&#34; %&#62; # &#60;/td&#62; # [...]]]></description>
			<content:encoded><![CDATA[<p>I realized that spam bots are stupid, and spammers are generally not the best programmers, so a while back I made a system to fight the intolerable spam plaguing us.  I noted today that Robby on Rails was having this same <a href="http://www.robbyonrails.com/articles/2005/06/04/ruby-fpdf-on-ruby-on-rails">problem</a>, and I figured I might as well share what has worked for me.</p>
<p>First, I added this line to my <strong>views/articles/_comment_box.rhtml</strong>:</p>
<div class="CodeRay">
<div class="code">
<pre><code>
#     <span class="ta">&lt;td&gt;</span><span class="ta">&lt;p&gt;</span><span class="ta">&lt;label</span> <span class="an">for</span>=<span class="s"><span class="dl">&quot;</span><span class="k">comment_body</span><span class="dl">&quot;</span></span><span class="ta">&gt;</span>Your message<span class="ta">&lt;/label&gt;</span><span class="ta">&lt;/p&gt;</span><span class="ta">&lt;/td&gt;</span>
#     <span class="ta">&lt;td</span> <span class="an">valign</span>=<span class="s"><span class="dl">&quot;</span><span class="k">top</span><span class="dl">&quot;</span></span> <span class="an">colspan</span>=<span class="s"><span class="dl">&quot;</span><span class="k">2</span><span class="dl">&quot;</span></span><span class="ta">&gt;</span>
#       <span class="c">&lt;%= text_area &quot;comment&quot;, &quot;body&quot; %&gt;</span>
#     <span class="ta">&lt;/td&gt;</span>
#  <span class="ta">&lt;/tr&gt;</span>
    <span class="ta">&lt;tr&gt;</span>
      <span class="ta">&lt;td&gt;</span>
        <span class="ta">&lt;p&gt;</span>
          <span class="c">&lt;% spammer_array = [[&quot;two&quot;,&quot;9&quot;,&quot;twelve&quot;,&quot;2&quot;][rand(4)],[&quot;1&quot;,&quot;15&quot;,&quot;4&quot;,&quot;eight&quot;][rand(4)]] %&gt;</span>
<span class="c">&lt;% question = &quot;What's #{spammer_array[0]} times #{spammer_array[1]} ? (numerical)&quot; %&gt;</span>
          <span class="ta">&lt;label</span> <span class="an">for</span>=<span class="s"><span class="dl">&quot;</span><span class="k">spammers_suck</span><span class="dl">&quot;</span></span><span class="ta">&gt;</span><span class="c">&lt;%= question %&gt;</span><span class="ta">&lt;/label&gt;</span>
        <span class="ta">&lt;/p&gt;</span>
      <span class="ta">&lt;/td&gt;</span>
      <span class="ta">&lt;td&gt;</span> <span class="c">&lt;%= text_field_tag &quot;spammers_suck&quot; %&gt;</span><span class="c">&lt;%= hidden_field_tag &quot;spammers_question&quot;, question %&gt;</span><span class="ta">&lt;/td&gt;</span>
    <span class="ta">&lt;/tr&gt;</span>
#   <span class="ta">&lt;tr&gt;</span>
#     <span class="ta">&lt;td</span> <span class="an">colspan</span>=<span class="s"><span class="dl">&quot;</span><span class="k">2</span><span class="dl">&quot;</span></span> <span class="an">id</span>=<span class="s"><span class="dl">&quot;</span><span class="k">frm-btns</span><span class="dl">&quot;</span></span><span class="ta">&gt;</span>
</code></pre>
</div>
</div>
<p>So far, it&#8217;s simply a new table row with some junk in it.  But, the interesting thing is that every time the page is created and cached, it contains a new random equation for the user to guess.  This is then sent along with the request to post a comment (not the preview, mind you) to the <strong>comment</strong> action.</p>
<div class="CodeRay">
<div class="code">
<pre><code>
<span class="c"># Again: Commented parts are unchanged from Typo codebase</span>
<span class="c">#  def comment</span>
<span class="c">#    unless @request.xhr? || this_blog.sp_allow_non_ajax_comments</span>
<span class="c">#      render_error(&quot;non-ajax commenting is disabled&quot;)</span>
<span class="c">#    return</span>
<span class="c">#   end</span>

    <span class="c">#AntiSpam</span>
    b = params[<span class="sy">:spammers_question</span>].split(<span class="s"><span class="dl">&quot;</span><span class="k"> </span><span class="dl">&quot;</span></span>)
    c = [[<span class="i">2</span>, <span class="i">9</span>, <span class="i">12</span>, <span class="i">2</span>], [<span class="i">1</span>, <span class="i">15</span>, <span class="i">4</span>, <span class="i">8</span>]]
    d = [[<span class="s"><span class="dl">&quot;</span><span class="k">two</span><span class="dl">&quot;</span></span>,<span class="s"><span class="dl">&quot;</span><span class="k">9</span><span class="dl">&quot;</span></span>,<span class="s"><span class="dl">&quot;</span><span class="k">twelve</span><span class="dl">&quot;</span></span>,<span class="s"><span class="dl">&quot;</span><span class="k">2</span><span class="dl">&quot;</span></span>], [<span class="s"><span class="dl">&quot;</span><span class="k">1</span><span class="dl">&quot;</span></span>,<span class="s"><span class="dl">&quot;</span><span class="k">15</span><span class="dl">&quot;</span></span>,<span class="s"><span class="dl">&quot;</span><span class="k">4</span><span class="dl">&quot;</span></span>,<span class="s"><span class="dl">&quot;</span><span class="k">eight</span><span class="dl">&quot;</span></span>]]
    num_one = <span class="i">0</span>
    num_two = <span class="i">0</span>
    c[<span class="i">0</span>].each_with_index{|t,i| <span class="r">if</span>(b[<span class="i">1</span>].index(d[<span class="i">0</span>][i])); num_one = t; <span class="r">end</span>}
    c[<span class="i">1</span>].each_with_index{|t,i| <span class="r">if</span>(b[<span class="i">3</span>].index(d[<span class="i">1</span>][i])); num_two = t; <span class="r">end</span>}

    <span class="r">if</span> <span class="r">not</span> params[<span class="sy">:spammers_suck</span>].to_i == num_one * num_two
      render_text <span class="s"><span class="dl">&quot;</span><span class="k">You're either a spammer, or you can't do math.</span><span class="dl">&quot;</span></span>

<span class="c">#    elsif request.post?</span>
<span class="c">#      begin</span>
<span class="c">#      @article = this_blog.published_articles.find(params[:id])</span>
<span class="c"># ...</span>
</code></pre>
</div>
</div>
<p>This very simple hack has caused a complete cease of comment spam on my blog.  I also globally disabled trackbacks (which took a manual database query in the end), and so far the only spam-like comment I&#8217;ve gotten was a hate comment ;).  So, the moral of the story is that you don&#8217;t have to put up with spam in Typo, and you don&#8217;t have to use Askimet or some other external service to fight it.  Just some simple math is all it takes to pwn the noob-bots.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2007/02/05/fighting-spam-on-typo-with-logic/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PhishTank pwns Phishing Phools</title>
		<link>http://www.ralree.com/2006/10/07/phishtank-pwns-phishing-phools/</link>
		<comments>http://www.ralree.com/2006/10/07/phishtank-pwns-phishing-phools/#comments</comments>
		<pubDate>Sat, 07 Oct 2006 12:31:00 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[phishing]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.ralree.info/2008/06/23/phishtank-pwns-phishing-phools</guid>
		<description><![CDATA[PhishTank is an awesome website that keeps a database of phishing websites that are user submitted and verified. It integrates with OpenDNS, so when a site is verified by the community as a phishing site, OpenDNS users will see a phishing warning instead of the original website. There are also other perks like spelling correction and faster DNS resolves, but the phishing this is revolutionary. I joined PhishTank today, and I&#8217;m currently in second place on number of phishing sites [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.phishtank.com">PhishTank</a> is an awesome website that keeps a database of phishing websites that are<br />
user submitted and verified.  It integrates with<br />
<a href="http://www.opendns.com">OpenDNS</a>, so when a site is verified by the community<br />
as a phishing site, OpenDNS users will see a phishing warning instead of the<br />
original website.  There are also other perks like spelling correction and<br />
faster DNS resolves, but the phishing this is revolutionary.  I joined<br />
PhishTank today, and I&#8217;m currently in second place on number of phishing sites<br />
submitted.  I submitted 167 of them from Google&#8217;s blacklist after filtering it<br />
with a short perl script.</p>
<div class="CodeRay">
<div class="code">
<pre><code>
#!/usr/bin/perl
use strict;
use LWP;
die(&quot;Specify a link file.&quot;) unless $ARGV[0];
open IN, &quot;&lt;&quot;, $ARGV[0];
open OUT, &quot;&gt;&gt;&quot;, &quot;results.&quot;.$ARGV[0];
while(&lt;IN&gt;) {
  if(/&lt;a href=&quot;(.*?)&quot;/) {
    my $browser = LWP::UserAgent-&gt;new;
    $browser-&gt;timeout(3);
    my $response = $browser-&gt;get($1);
    if($response-&gt;is_success) {
      print OUT &quot;$_\n&quot;;
      print &quot;Success: $1\n&quot;;
    } else { print &quot;Failed: $1\n&quot;; }
  }
}
</code></pre>
</div>
</div>
<p>:) I&#8217;m so happy when I find sites that are already marked as phishers.  If<br />
only the process of submission could be automated completely&#8230;I&#8217;ll play with<br />
the API on PhishNet and maybe it will become reality.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ralree.com/2006/10/07/phishtank-pwns-phishing-phools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

