#!/usr/local/bin/perl
use Socket;
use Compress::Zlib;
open (F, "bots.txt") || die "ERROR: Account List Unreadable\n";
@bots = <F>; close(F); $botlength = @bots.'';
for ($i=0; $i < $botlength; $i++) {
if (@bots[$i] !~ /^-/) { $botnum = $i; $THEBOT = @bots[$i]; last; }
} @bots[$botnum] = '-'.$THEBOT; chop($THEBOT);
open (G, '>bots.txt'); print G @bots; close (G);
print "\nUsing Account '".$THEBOT."'.\n";
$username = $THEBOT; $password = 'sockpass11';
Request('GET', 'neopets.com/loginpage.phtml', '', 'http://neopets.com/');
$res = Request('POST', 'neopets.com/hi.phtml', "destination=%2Fpetcentral.phtml&username=$username", 'http://neopets.com/index.phtml');
if ($res =~ 'Sorry, we did not find an account with that username.') {
print 'ERROR: Invalid username'; exit; }
$res = Request('POST', 'neopets.com/login.phtml', "username=$username&password=$password&destination=%2Fpetcentral.$phtml", 'http://neopets.com/hi.phtml');
if ($res =~ 'Welcome, <a href="/userlookup.phtml') {
print 'Login was successful';
} elsif ($res =~ 'Sorry, you have tried too many times to guess this password') {
print 'ERROR: Too many invalid login attempts'; exit;
} elsif ($res =~ 'This account has been <span style="color:#FF0000;font-weight:bold;">FROZEN</span>') {
print "ERROR: Account $username has been frozen"; exit;
} elsif ($res =~ 'That <font color="#FF0000"><strong>username/password</strong></font> combination is invalid.') {
print 'ERROR: Account password is invalid'; exit; }
else { print 'ERROR: Login was unsuccessful'; exit; }
@g = (189,539,197,586,713,571,552,600,412,371,305,204,627,258,720,390,676,150,74,794,659,367,726,381,
685,773,585,159,615,379,228,760,202,52,614,201,239,772,489,212,619,540,553,786,306,606,129,771,
527,19,226,668,519,500,248,340,660,574,198,734,796,400,645,368,707,444,428,544,230,366,761,229,
799,453,358,314,404,396,220,633,536,152,575,131,82,149,570,538,763,315,587,818,789,648,353,207);
@s = (940,800,500,800,1000,600,2000,334,5000,1000,250,500,750,500,5000,1667,1500,1000,750,225,500,800,700,1000,
1000,4000,800,1000,200,3500,334,5000,1000,500,500,400,750,1000,1400,500,1500,2500,750,1000,5000,800,200,1000,
1000,700,150,700,500,700,400,334,2800,3000,2000,1000,1000,1400,250,334,800,500,1500,1500,500,1000,1000,1350,
1000,3300,1200,50000,900,1000,180,800,1500,125,2500,750,200,250,1000,800,1000,400,2000,1000,500,800,2000,200);
@d = (41,41,46,21,21,46,121,46,91,121,21,91,46,46,91,91,21,121,91,21,21,21,91,21,
11,61,36,61,21,151,11,49,91,91,21,46,91,46,91,21,91,181,61,21,61,76,21,21,
11,86,61,31,21,21,91,21,121,181,241,21,21,21,91,21,46,21,91,121,61,21,21,181,
46,46,26,121,151,91,21,46,61,46,91,91,91,21,46,46,21,91,181,21,91,21,91,21);
@aD[0] = "*KS5fJ(+,=FO\$V^elCjpLbE_\@Q;~-9G}8ziBUg1c)mHkyPWd0AxnX72IMqY4owN?v!t.6uD{sh%a&TR:Zr3";
@aD[1] = "N;zqeE2Ps70lV8jD-!5ZgxB6Kfv\@Wc=y)XdQbLM*CIwko?t&Rr.%_TJFO^i4{UAn+a~1,ShGH\$}3(u9:pYm";
@aD[2] = "2IMHqbD=GX+i&5*Q4oVy.JYs;pT:f)uxL{gkU9vCnmcr7BZ\@FWNd_}wK,3ShAeEOzaP!%6l80j-R(~?1t^\$";
@aD[3] = "ma63v+Qh9qJ5dS*fgt0RuH\$sGw);W_z4l-bIVBoN~PE{(Fx&y\@:8%pnTk2Ze}!Y17cCKrUijO=^AM?,.XDL";
@aD[4] = "CwB%_Pi\@,?(1mkgx7nqa*cpUDjs2;GlLZKe^z+4=Itdv}XH6bNSVr0Q5WM\$:ho{FOfJYu)ETR~y938!.-A&";
@aD[5] = "wg0a%ZPSJ;U_\$e1-mvp:qcxRln~KTXE4(?usOH\@k={jW*5YBo3N26CQt&97IGbD.AfzMydr^,VhL)Fi+8!}";
@aD[6] = "%jOuNck,em(QVzH-nDr8!bG?ofhKYd}As25BR\$J&wTp~iF0U*9^;Lv+.PW:_IlXg{Za)q\@CE6S=t4137Mxy";
@aD[7] =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LxRCwiy";
@aD[18] = ",W%94xR\$}sFi;V^o.uc*TD&fmy07zN)pke-:BJMt3wI~8\@EQLj=nU!5v_r{ZA(6qla2hHbgXO+C?Yd1KSPG";
@aD[19] = "1jI8F;w-s&\@QVarBfybCNJh6Pn4R%^DuTx?9iH=2U3G7.YO)e,\$EWLZ{}tp(lSck50A:v+oz~g!_dXMqK*m";
foreach my $i (0..95) {
for ($j = 3; $j >= 1; $j--) {
$gameID = @g[$i]; $score = @s[$i] - fR(1, 15); $delay = @d[$i] + fR(1, 3);
undef($res); undef($sh); undef($sk); undef($im); undef($gu); undef($iRnd); undef($sHex);
undef($iTO); undef($iTW); undef($iBL); undef($iTZ); undef($sRp); undef($sBin); undef($sTp);
undef($nx); undef($iTp); undef($sTp); undef($iTpTW); undef($fro); undef($frt); undef($frh);
undef($sBin); undef($zth); undef($as);
$res = Request('GET', 'neopets.com/games/play.phtml?game_id='.$gameID, '', 'http://www.neopets.c...es/arcade.phtml');
$res = Request('GET', 'neopets.com/games/play_flash.phtml'.GB($res, 'http://neopets.com/g...ay_flash.phtml?', "\'"), '', 'neopets.com/games/play.phtml?game_id='.$gameID);
$sh = GB($res, '&sh=', '&'); $sk = GB($res, '&sk=', '&'); $delay = $delay.'000';
$delay = $delay - fR(1, 10); $delay = $delay + fR(1, 10); $stt = $delay / 1000;
$im = GB($res, '&include_movie=', "\">"); $gu = GenerateURL($gameID, $score, $delay, $sh, $sk, $username);
$res = Request('GET', 'neopets.com/games/session_keep_alive.phtml', '', ''); select(undef, undef, undef, $stt);
$res = Request('POST', $gu, 'onData=%5Btype%20Function%5D', $im); @res = split(/\n/, $res); $res = @res[1];
print "\n\nResult: $res\n";
}
} exit;
sub GenerateURL {
$fro = fR(111111111, 999999999); $frt = fR(111111, 999999); $frh = fR(24, 35);
$sBin = @_[3].@_[4]; $iBL = length(@_[3]) + length(@_[4]); $zth = @_[0]x300;
$as = AS("ssnhsh=@_[3]&ssnky=@_[4]&gmd=@_[0]&scr=@_[1]&frmrt=$frh&chllng=0&gmdrtn=@_[2]");
return "neopets.com/high_scores/process_flash_score.phtml?cn=$zth&gd=@_[2]&r=0.$fro$frt&gmd_g=@_[0]&mltpl_g=0&gmdt_g=$as&sh_g=@_[3]&sk_g=@_[4]&usrnm_g=$username&dc_g=0";
}
sub fR { return int(rand(@_[1] - @_[0] + 1)) + @_[0]; }
sub GB { return $1 if $_[0] =~ /@_[1](.*?)@_[2]/; }
sub AS {
$iTZ = 0; undef($sRP); $sRP = ''; undef($sTp); $sTp = '';
$iRnd = fR(0, 19); $sHex = @aD[$iRnd];
for ($iTO = 0; $iTO < length(@_[0]); $iTO++) {
if (int($iTW) >= int($iBL)) { $iTW = 0; }
$iTZ = index($sHex, substr(@_[0], $iTO, 1), 1) + 1;
if ($iTZ == 0) { $sRp = $sRp.substr(@_[0], $iTO, 1) + 1; } else {
$iTZ = ($iTZ + index($sHex, substr($sBin, $iTW, 1), 1) + 1) - 2;
if ($iTZ >= 83) { $iTZ = ($iTZ - 83); }
$sRp = $sRp.substr($sHex, $iTZ, 1); } $iTW = $iTW + 1; }
if ($iRnd >= 10) { $nx = $sRp.$iRnd; } else { $nx = $sRp."0".$iRnd; }
for ($iTp = 0; $iTp < length($nx); $iTp++) {
$sTp = ord(substr($nx, $iTp, 1));
for ($iTpTW = (3 - length($sTp)); $iTpTW > 0; $iTpTW--) { $sTp = "0".$sTp; }
$sRP = $sRP.$sTp;
} return $sRP;
}
sub Request {
($host, $file) = ($_[1] =~ m#([^/]*)(/.*)?$#i);
Request: {
socket(sock, AF_INET, SOCK_STREAM, getprotobyname('tcp'));
connect(sock, pack('S n a4 x8', AF_INET, 80, (gethostbyname($host))[4]));
select(sock); $|=1; select(STDOUT);
if ($_[3] != '') { $referer = "Referer: $_[3]\015\012" } else { $referer = ''; }
if (length($_[2]) == 0) {
print sock "$_[0] $file HTTP/1.1\015\012",
"Accept: */*\015\012",
"$referer",
"Accept-Language: en-ca\015\012",
"UA-CPU: x86\015\012",
"Accept-Encoding: gzip, deflate\015\012",
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)\015\012",
"Host: $host\015\012",
"Connection: Keep-Alive\015\012",
"$fcookie\015\012";
} elsif ($_[0] == 'POST') {
print sock "POST $file HTTP/1.1\015\012",
"Accept: */*\015\012",
"$referer",
"Accept-Language: en-ca\015\012",
"Content-Type: application/x-www-form-urlencoded\015\012",
"UA-CPU: x86\015\012",
"Accept-Encoding: gzip, deflate\015\012",
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)\015\012",
"Host: $host\015\012",
"Content-Length: ", length($_[2]), "\015\012",
"Connection: Keep-Alive\015\012",
"Cache-Control: no-cache\015\012",
"$fcookie\015\012$_[2]";
}
vec($rin = '', fileno(sock), 1) = 1;
select($rin, undef, undef, 60) || die "ERROR: $!";
$numread = 0;
while (($numread < 5) && ($thisread = read(sock, $status_line, 5 - $numread, $numread))) {
$numread+= $thisread; }
defined($thisread) || die "ERROR: $!";
$content = '';
if ($status_line !~ m#^HTTP/#) {
$content.= $_ while read(sock, $_, 16384);
} else {
$status_line.= <sock>;
($status_code) = ($status_line =~ m#^HTTP/\d+\.\d+\s+(\d+)#);
$headers = '';
while (<sock>) { last if /^\015?\012/; $headers.= $_; }
$headers =~ s/\015?\012[ \t]+/ /g ;
@headers = split(/\n/, $headers);
foreach $header (@headers) {
if ($header =~ /^set-cookie:/i) {
@cookies = split(/:.(.+?)=/, $header);
@value = split(/(.+?);/, @cookies[2]);
if ($cookie !~ /@cookies[1]=/) {
$cookie.= @cookies[1].'=';
$cookie.= @value[1].'; '; }
elsif ($cookie =~ /@cookies[1]=/) {
$cookie =~ substr($cookie, index($cookie,
@cookies[1]) + length(@cookies[1]) + 1,
index($cookie, ";", index($cookie, @cookies[1])) -
index($cookie, @cookies[1]) - length(@cookies[1]) - 1, @value[1]);
}
}
}
if (substr($cookie, length($cookie) - 4, length($cookie)) =~ /;./) {
$fcookie = "Cookie: ".substr($cookie, 0, length($cookie) - 2)."\015\012"; }
if ($status_code =~ /^(301|302|303)$/) {
unless (($file) = ($headers =~ /^location:[ \t]*(\S*)/im)) {
die "ERROR: No location in redirect"; }
($numredirects++ > 5) && die "ERROR: Too many location redirects";
close(sock); $file.= 'phtml'; redo Request;
}
($status_code == 200) || die "ERROR: HTTP Response not OK";
$content.= $_ while read(sock, $_, 16384);
}
close(sock);
}
if ($headers =~ /content-encoding:.?gzip/i) {
$content = Compress::Zlib::memGunzip($content); }
return $content;
}