Cpanel, si te monitorojme se kush futet nepermjet :2082
Ky script i thjeshte ju dergon juve nje liste te kycjeve te reja ne cpanel te serverit tuaj. Mund te jete e dobishme per investigime, ose per te kuptuar kur ka dicka qe nuk shkon ne nje account.</p>
#!/usr/bin/perl
chdir('/root');
$d = `date +%m/%d/%Y`;
chomp($d);
@logins = `cat /usr/local/cpanel/logs/access_log|grep $d|awk '{print \$1 " " \$3}'|sort|uniq`;
$x = "";
foreach(@logins) {
chomp;
/(.*?)\ (.*)/;
next if $2 eq "-";
$z = `whois $1|grep addres|tail -n 1`;
chomp($z);
$x.="$z $1 $2\n";
}
if (not -f "./latestscan") {
`touch ./latestscan`;
}
$y = `cat ./latestscan`;
exit if $y eq $x;
open(F, ">latestscan");
print F $x;
close F;
$sendmail = "/usr/sbin/sendmail -t";
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL "Reply-to: root\@myserver.org\n";
print SENDMAIL "Subject: Login report hostf1\n";
print SENDMAIL "To: alerts\@yourserver.com\n";
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $x;
close(SENDMAIL);
Ky artikull eshte marre nga: http://www.albseo.com/?p=870. Per me shume artikuj te ngjashem vizitoni: http://www.albseo.com/?p=870
Ky script i thjeshte ju dergon juve nje liste te kycjeve te reja ne cpanel te serverit tuaj. Mund te jete e dobishme per investigime, ose per te kuptuar kur ka dicka qe nuk shkon ne nje account.</p>
#!/usr/bin/perl
chdir('/root');
$d = `date +%m/%d/%Y`;
chomp($d);
@logins = `cat /usr/local/cpanel/logs/access_log|grep $d|awk '{print \$1 " " \$3}'|sort|uniq`;
$x = "";
foreach(@logins) {
chomp;
/(.*?)\ (.*)/;
next if $2 eq "-";
$z = `whois $1|grep addres|tail -n 1`;
chomp($z);
$x.="$z $1 $2\n";
}
if (not -f "./latestscan") {
`touch ./latestscan`;
}
$y = `cat ./latestscan`;
exit if $y eq $x;
open(F, ">latestscan");
print F $x;
close F;
$sendmail = "/usr/sbin/sendmail -t";
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL "Reply-to: root\@myserver.org\n";
print SENDMAIL "Subject: Login report hostf1\n";
print SENDMAIL "To: alerts\@yourserver.com\n";
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $x;
close(SENDMAIL);
Ky artikull eshte marre nga: http://www.albseo.com/?p=870. Per me shume artikuj te ngjashem vizitoni: http://www.albseo.com/?p=870