/
usr
/
local
/
lp
/
apps
/
malre
/
scripts
/
File Upload :
llllll
Current File: //usr/local/lp/apps/malre/scripts/get_stats.pl
#! /usr/bin/perl ### pipe in maldet results, stats of each file comes out use warnings; use strict; my $v_type = "maldet"; my $f_out; my $d_progdir = __FILE__; $d_progdir = ( readlink($d_progdir) || $d_progdir ); my @progdir = split( m/\//, $d_progdir ); pop( @progdir ); $d_progdir = join( "/", @progdir ); require( $d_progdir . '/escape.pm' ); require( $d_progdir . '/stats.pm' ); require( $d_progdir . '/lock_file.pm' ); while (@ARGV) { my $v_arg = shift(@ARGV); if ( $v_arg eq "--maldet" ) { $v_type = "maldet"; } elsif ( $v_arg eq "--checkers" ) { $v_type = "checkers"; } elsif ( $v_arg eq "--out" && defined $ARGV[0] ) { $f_out = shift(@ARGV) } } if ( ! -t STDIN ) { if ($f_out) { fn_open_stats($f_out); } while (<STDIN>) { my $_line = $_; my $v_file; my $v_type = $v_type; my $v_details; chomp( $_line ); if ( $v_type eq "maldet" ) { ($v_details, $v_file) = split( m/ : /, $_line, 2 ); } elsif ( $v_type eq "checkers" ) { if ( $_line =~ m/^wp:/ ) { ($v_details, $v_file) = split( m/: \//, $_line, 2 ); $v_file = '/' . $v_file; $v_type = 'checkers_wp'; } else { ($v_details, $v_file) = split( m/]:\//, $_line, 2 ); $v_file = '/' . $v_file; $v_type = 'checkers_scan'; } } if ( substr( $v_file, 0, 1 ) eq "/" ) { fn_report_file($v_file, $v_type, undef, $v_details); } } if ($f_out) { fn_close_stats($f_out); } }
Copyright ©2k19 -
Hexid
|
Tex7ure