line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::VirusScan::Engine::Command::Kaspersky::Kavscanner; |
2
|
1
|
|
|
1
|
|
48039
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
3
|
1
|
|
|
1
|
|
2
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
4
|
1
|
|
|
1
|
|
2
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
41
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
269
|
use File::VirusScan::Engine::Command; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
35
|
use vars qw( @ISA ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
8
|
|
|
|
|
|
|
@ISA = qw( File::VirusScan::Engine::Command ); |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
3
|
use Cwd 'abs_path'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
293
|
use File::VirusScan::Result; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
187
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub default_arguments |
15
|
|
|
|
|
|
|
{ |
16
|
6
|
|
|
6
|
0
|
25
|
return [ qw( -e PASBME -o syslog -i0 ) ]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub scan |
20
|
|
|
|
|
|
|
{ |
21
|
1
|
|
|
1
|
1
|
704
|
my ($self, $path) = @_; |
22
|
|
|
|
|
|
|
|
23
|
1
|
50
|
|
|
|
34
|
if(abs_path($path) ne $path) { |
24
|
1
|
|
|
|
|
18
|
return File::VirusScan::Result->error("Path $path is not absolute"); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my ($exitcode, $scan_response) = eval { $self->_run_commandline_scanner(join(' ', $self->{command}, @{ $self->{args} }, $path, '2>&1'), 'INFECTED',); }; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
if($@) { |
30
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error($@); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
0
|
|
|
|
if( 0 == $exitcode |
|
|
|
0
|
|
|
|
|
34
|
|
|
|
|
|
|
|| 5 == $exitcode |
35
|
|
|
|
|
|
|
|| 10 == $exitcode) |
36
|
|
|
|
|
|
|
{ |
37
|
0
|
|
|
|
|
|
return File::VirusScan::Result->clean(); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
0
|
0
|
|
|
|
|
if(9 == $exitcode) { |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# Password-protected ZIP |
43
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus('kavscanner-password-protected-zip'); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
if(20 == $exitcode) { |
47
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus('kavscanner-suspicious'); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
0
|
0
|
0
|
|
|
|
if( 21 == $exitcode |
51
|
|
|
|
|
|
|
|| 25 == $exitcode) |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
|
|
|
my ($virus_name) = $scan_response =~ m/INFECTED (\S+)/; |
54
|
0
|
|
0
|
|
|
|
$virus_name ||= 'unknown-Kavscanner-virus'; |
55
|
0
|
|
|
|
|
|
return File::VirusScan::Result->virus($virus_name); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
return File::VirusScan::Result->error("Unknown return code: $exitcode"); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
__END__ |