lib/Nmap/Scanner/Service.pm

filter: Statementstmt 100% 8 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 10 / 10 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/Nmap/Scanner/ScanInfo.pm ↑ Summary lib/Nmap/Scanner/Task.pm »
1  
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 3 ▶use Class::Generate qw(class);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 class 'Nmap::Scanner::Service' => {
7 qw(name $
8 proto $
9 rpcnum $
10 lowver $
11 highver $
12 method $
13 service $
14 version $
15 extrainfo $
16 tunnel $
17 product $
18 conf $),
19 '&as_xml' => q!
20  
21 my @entities = qw(name proto rpcnum lowver highver version
22 method conf);
23  
24 my $body = '';
25  
26 for my $e (@entities) {
27 $body .= qq($e="$self->{$e}" ) if $self->{$e};
28 }
29  
30 for my $ee (qw(product extrainfo)) {
31 next unless $self->{$ee};
32 my $encoded = encode_entities($self->{$ee});
33 $body .= qq($ee="$encoded" );
34 }
35  
36 return "<service ${body}/>";
37  
38 !
39 },
40 '-use' => 'HTML::Entities'
41 ;
42  
43 =pod
44  
45 =head1 DESCRIPTION
46  
47 This class represents a service as represented by the scanning output from
48 nmap.
49  
50 =head2 name()
51  
52 =head2 proto()
53  
54 =head2 rpcnum()
55  
56 =head2 lowver()
57  
58 =head2 highver()
59  
60 =head2 method()
61  
62 =head2 conf()
63  
64 =head2 tunnel()
65  
66 =head1 VERSION SCANNING MUTATORS
67  
68 Information will be present for this only if -sV is used.
69  
70 =head2 product()
71  
72 =head2 version()
73  
74 =head2 extrainfo()
75  
76 =cut
77  
78 3 1;
« lib/Nmap/Scanner/ScanInfo.pm ↑ Summary lib/Nmap/Scanner/Task.pm »