Advertisement
Guest User

YJ

a guest
Jan 27th, 2010
1,038
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.62 KB | None | 0 0
  1. #procv.pl www.securitybydefault.com
  2.  
  3. use strict ;
  4.  
  5. open STDERR, '>', "/dev/null";
  6.  
  7. my @resultado = `ps ax -o pid --no-headers` ;
  8.  
  9.  
  10. #print @resultado ;
  11.  
  12. foreach (@resultado) {
  13.  
  14.         #print "$_\n" ;
  15.  
  16.         $_ =~ /(\d*)$/ ;
  17.  
  18.         my $processid = $1 ;
  19.  
  20.         my $status = `ls -l /proc/$processid/exe` ;
  21.  
  22.         $status =~ /-> (.*)$/;
  23.  
  24.         my $binary = $1 ;
  25.  
  26.         my $rpmverify = `rpm -Vf $binary` ;
  27.  
  28.         if ($rpmverify) {
  29.  
  30.                 print "El proceso [ $processid $binary ] ha sufrido modificaciones en su paquete base:\n" ;
  31.  
  32.                 print "$rpmverify\n" ;
  33.         }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement