Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/perl
#coder: kodo no kami
#route: technicolor
#face: www.facebook.com/hacker.fts315
use WWW::Mechanize;
my $IP = "192.168.1.252"; #ip do roteador
my $LOGIN = "admin"; #login
my $SENHA = "admin"; #senha
my $kodo = WWW::Mechanize->new;
print "================================\n" .
" FTS routeTechnicolor Info\n" .
"================================\n\n";
$kodo->post("http://" . $IP . "/login.cgi",[username=>$LOGIN,password=>$SENHA,isSubmit=>"1"]);
$kodo->get("/status_lanclients.cgi");
@kami = $kodo->content =~ /var vInterfaceName = new Array...(.*)function stopRefresh/s;
@fts_ativo = $kami[0] =~ /vActive.length.*?=.*?(\d+)/gs;
@fts_nome = $kami[0] =~ /vHostName.length.*?=.*?'(.*?)'/gs;
@fts_ip = $kami[0] =~ /vIpAddress.length.*?=.*?'(.*?)'/gs;
@fts_ipv6 = $kami[0] =~ /vIpAddress_v6.length.*?=.*?'(.*?)'/gs;
@fts_mac = $kami[0] =~ /vMacAddress.length.*?=.*?'(.*?)'/gs;
@fts_tipo = $kami[0] =~ /vAddressSource.length.*?=.*?'(.*?)'/gs;
@fts_interface = $kami[0] =~ /vInterfaceName.length.*?=.*?'(.*?)'/gs;
my $kont = 0;
foreach $kamisama(@fts_ativo)
{
print (($kamisama == 1)?"[ON] ":"[OFF] ");
print $fts_nome[$kont] . " (mac: " . $fts_mac[$kont] . "), iface: ". $fts_interface[$kont]. "\n" .
"ip: " . $fts_ip[$kont] . ", ipv6: " . $fts_ipv6[$kont] . ', tipo: ' . $fts_tipo[$kont] . "\n" .
"..............................\n\n";
$kont++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.