Jump to content
MiniDisc

Radmin with empty password scanner

Recommended Posts

Posted
#!/usr/bin/perl
use IO::Socket;


##################################################
# Radmin with empty password scanner
#
# usage: ./scan.pl 213.59.*.*
# thanx to Forb
# Coded by Satir (satir@cyberlords.net) from CyberLords [cyberlords.net]
################################################################################
#####

$|++;
use IO::Socket; ## ????? ??????

$pids=10; ## Count of threads
$port = 4899; ## Default port
$tout = 5; ## Default timeout
$log = 'scan.log'; ## Default logfile


$once=0;
$fatal=0;

if (@ARGV[0]=~/((.*).(.*).(.*).(.*))/) {
$netmask = $1;
$n1 = $2;
$n2 = $3;
$n3 = $4;
$n4 = $5;
}

quit("Incorrect port") if ($port=~/D/);
quit("No hostmask given") unless $netmask;
check();

while(1) {
@ips=@ipz[$once..$once+$pids];
for ($i=0;$i<=$pids;$i++) {
unless($ips[$i]) {
killpidz();
exit print "Scan is completen";
}


if ($pid=fork()) {
push(@forked,$pid);
} else {
$res=check_radmin($ips[$i],$port);
logg($ips[$i],$res) if ($res ne 0);
exit;
}
}
$once+=$pids;
killpidz();
}

sub check {
for ($i=0;$i<=254;$i++) {
$ipi = $i;
if ($n2 ne '*') { $i = 254,$ipi = $n2 }
for ($j=0;$j<=254;$j++) {
$ipj = $j;
if ($n3 ne '*') { $j = 254,$ipj = $n3 }
for ($k=1;$k<=254;$k++) {
$ipk = $k;
if ($n4 ne '*') { $k = 254,$ipi = $n2 }
my($ipaddr) = "$n1.$ipi.$ipj.$ipk";
chomp($ipaddr);
push(@ipz,$ipaddr);
}
}
}
}

sub quit {
my($reason)=@_;
print "$reasonn" if $reason;
exit;
}

sub logg {
my($ip,$ans)=@_;
open(LOGG,">>$log");
$str="NULL PASS!!!" if $ans eq 1;
$str="need pass." if $ans eq 2;

print LOGG "$ip:$port : $strn";
close(LOGG);
}

sub killpidz {
foreach (@forked) {
chomp;
waitpid($_,0);
kill("TERM" => $_)
}
undef @forked;
}


sub check_radmin{
($host,$port)=@_;

$sock=IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port, Photo => "tcp");

if($sock)
{
$sock->send("x01x00x00x00x01x00x00x00x08x08");
$sock->recv($data,1024);
close($sock);

@marks=split(//,$data);
foreach(@marks){
$string.=unpack('H8', $_);
}
if($string=~/a080/g){
return 1;
}
else{
return 2;
}

}else { return 0;}
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...