#!/usr/bin/perl use Digest::SHA1 qw(sha1_hex); my $wu_secret = "HASH SECRET"; my $wu_agent = "Grub WU1"; my $wu_tmp = ".wu1_tmp"; my $wu_per = $ARGV[0] || 250; my $count=0; my $key = sha1_hex($wu_secret); while() { chop; (print "REJECTED: $_\n" && next) unless(/http(.?)\:\/\/([^\/]+)(.*)/); if($count == 0) { open(WU,">$wu_tmp"); } $path = $3 || "/"; $host = ($1 eq "s" && $2 !~ /\:/)?"$2:443":$2; $key = sha1_hex("$key $host $path"); print WU "GET $3 HTTP/1.0\r\nHost: $host\r\nAgent: $wu_agent\r\n\r\n"; $count++; if($count == $wu_per) { close(WU); rename($wu_tmp,"$key.wu1"); $key = sha1_hex($wu_secret); $count = 0; } } close(WU); rename($wu_tmp,"$key.wu1");