PERL Captcha Solver
Perl 5+ and libwww-perl library is required.
#!/usr/bin/perl
use warnings;
use strict;
use LWP::UserAgent;
use HTTP::Request::Common;
my $api_url='http://127.0.0.1:80/';
my $api_username='captcha';
my $api_password='sniper';
# SOLVE CAPTCHA
sub solve_captcha
{
my $ua = LWP::UserAgent->new();
my $response = $ua->request(POST $api_url, Content_Type => 'multipart/form-data', Content => [
function => 'picture2',
username => $api_username,
password => $api_password,
pict =>[$_[0]]
]);
if ($response->is_error())
{
return $response->status_line;
} else {
return $response->content();
}
}
# Solve the captcha
printf solve_captcha("/captcha.png");