blib/lib/Duadua/Parser/Bot/Log4Shell.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 10 | 10 | 100.0 |
branch | 1 | 2 | 50.0 |
condition | 4 | 6 | 66.6 |
subroutine | 3 | 3 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 19 | 22 | 86.3 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Duadua::Parser::Bot::Log4Shell; | ||||||
2 | 6 | 6 | 41 | use strict; | |||
6 | 12 | ||||||
6 | 175 | ||||||
3 | 6 | 6 | 28 | use warnings; | |||
6 | 12 | ||||||
6 | 611 | ||||||
4 | |||||||
5 | sub try { | ||||||
6 | 139 | 139 | 1 | 317 | my ($class, $d) = @_; | ||
7 | |||||||
8 | 139 | 50 | 66 | 295 | if ( index($d->ua, '${') == 0 && index($d->ua, '://') > -1 && $d->ua =~ m!\}$! ) { | ||
66 | |||||||
9 | 1 | 5 | my $h = { | ||||
10 | name => 'Log4Shell', | ||||||
11 | is_bot => 1, | ||||||
12 | }; | ||||||
13 | |||||||
14 | 1 | 7 | return $h; | ||||
15 | } | ||||||
16 | } | ||||||
17 | |||||||
18 | 1; | ||||||
19 | |||||||
20 | __END__ |