Hello friends, now I will show you how to make a simple anti spam protection (without using captcha) who is very effective.
The original idea (for educational purposes) is taken from here:
Part 1
Part 2
Sorry about the links and macedonian language, but I respect my friend and I have to mention that he is the author of the idea.
So, let's start.
What is a spam bot and how it works ?
Spam bots is an application who is programmed to sending mails, write a posts and etc...
You can learn more about spam bots on wikipedia.
How it working a spam bot ?
I will give you a few simple examples written in Perl...
If the HTML form is:
<form name="my_form" action="add_post.php" method="post">
<input type="text" name="title" />
<textarea name="msg" rows="10" cols="50"></textarea>
</form>
Then. here is the spam script:
#!/usr/bin/perl
use HTTP::Request::Common;
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2");
push @{ $ua->requests_redirectable }, 'POST';
# directly on url (add_post.php)
my $url = "http://the-example-site.com/add_post.php";
my $title = "This is a spam title...";
my $message = "This is a spam message... bla bla bla...";
my $response = $ua->request(POST $url, ["title" => "$title", "msg" => "$message"]);
if ($response->is_success) {
print $response->decoded_content
} else {
die $response->status_line;
}
print "Finish...";
exit;
This is the simple (not very effective) script for spamming (just for educational purposes).
This script will create "POST" object and will go directly on url.
The message will be successfully added.
Тхе аdvanced spam bot works:
- Takes the source from the url
- Parse HTML forms (takes directly url, name of the form elements)
- Creates POST object (with the form elements)
- Go on the directly url and will send the "post" object
So, I wrote simple example in PHP... How to protect from spam bots.
If someone has a better solution can correct me. :)
Thanks, SkyDriver.