In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Script description:
The script can monitor the specified important files of the system. When the files are viewed or modified, the script will check the users and IP who recently logged in to the system, and email notifications. #! / usr/bin/perluse strict;use Mail::Sender;use Digest::SHA;my @ files= ('/ etc/passwd','/ etc/shadow','/ var/log/wtmp'); my $last_cmd= `last-2`; while (1) {my% md5_res;my% output;my @ change;foreach my $file (@ files) {$md5_res {$file} = MD5_digest ($file); while (1) {sleep 10 Foreach my $file (@ files) {if ($md5_res {$file} ne MD5_digest ($file)) {$output {$file} = "$file is changed";}; if (% output) {foreach my $key (% output) {print "$output {$key}\ n";} print "$last_cmd"; last;}; sub MD5_digest {my $file=shift;my $sha=Digest::SHA- > new ('256'); $sha- > addfile ($file); my $digest=$sha- > hexdigest;return "$digest" } sub Send_mail {my ($subject,$msg) = @ _; my $sender=new Mail::Sender- > MailMsg ({smtp = > 'mail.aaa.com',from = >' neo@aaa.com',to = > 'neo@gmail.com',subject = > $subject,msg = > $msg,auth = >' LOGIN',authid = > neo',authpwd = > '1234',}) or die "$Mail::Sender::Error\ n"; print "Mail sent ok";}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.