line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id$ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# api::cvesearch Brik |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package Metabrik::Api::Cvesearch; |
7
|
1
|
|
|
1
|
|
714
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use base qw(Metabrik::Client::Rest); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
529
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub brik_properties { |
13
|
|
|
|
|
|
|
return { |
14
|
0
|
|
|
0
|
1
|
|
revision => '$Revision$', |
15
|
|
|
|
|
|
|
tags => [ qw(unstable) ], |
16
|
|
|
|
|
|
|
author => 'GomoR ', |
17
|
|
|
|
|
|
|
license => 'http://opensource.org/licenses/BSD-3-Clause', |
18
|
|
|
|
|
|
|
commands => { |
19
|
|
|
|
|
|
|
db_info => [ ], |
20
|
|
|
|
|
|
|
browse => [ ], |
21
|
|
|
|
|
|
|
browse_vendor => [ qw(vendor) ], |
22
|
|
|
|
|
|
|
search => [ qw(vendor product) ], |
23
|
|
|
|
|
|
|
cve => [ qw(cve) ], |
24
|
|
|
|
|
|
|
last => [ ], |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# |
30
|
|
|
|
|
|
|
# https://www.circl.lu/services/cve-search/ |
31
|
|
|
|
|
|
|
# |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub db_info { |
34
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my $url = 'http://cve.circl.lu/api/dbInfo'; |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
$self->get($url) or return; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return $self->content; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub browse { |
44
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
my $url = 'http://cve.circl.lu/api/browse'; |
47
|
|
|
|
|
|
|
|
48
|
0
|
0
|
|
|
|
|
$self->get($url) or return; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $self->content; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub browse_vendor { |
54
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
55
|
0
|
|
|
|
|
|
my ($vendor) = @_; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
$self->brik_help_run_undef_arg('browse_vendor', $vendor) or return; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
my $url = 'http://cve.circl.lu/api/browse/'.$vendor; |
60
|
|
|
|
|
|
|
|
61
|
0
|
0
|
|
|
|
|
$self->get($url) or return; |
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
return $self->content; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub search { |
67
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
68
|
0
|
|
|
|
|
|
my ($vendor, $product) = @_; |
69
|
|
|
|
|
|
|
|
70
|
0
|
0
|
|
|
|
|
$self->brik_help_run_undef_arg('search', $vendor) or return; |
71
|
0
|
0
|
|
|
|
|
$self->brik_help_run_undef_arg('search', $product) or return; |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
|
my $url = 'http://cve.circl.lu/api/search/'.$vendor.'/'.$product; |
74
|
|
|
|
|
|
|
|
75
|
0
|
0
|
|
|
|
|
$self->get($url) or return; |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return $self->content; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub cve { |
81
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
82
|
0
|
|
|
|
|
|
my ($cve) = @_; |
83
|
|
|
|
|
|
|
|
84
|
0
|
0
|
|
|
|
|
$self->brik_help_run_undef_arg('cve', $cve) or return; |
85
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
|
my $url = 'http://cve.circl.lu/api/cve/'.$cve; |
87
|
|
|
|
|
|
|
|
88
|
0
|
0
|
|
|
|
|
$self->get($url) or return; |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
|
|
|
return $self->content; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub last { |
94
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
my $url = 'http://cve.circl.lu/api/last'; |
97
|
|
|
|
|
|
|
|
98
|
0
|
0
|
|
|
|
|
$self->get($url) or return; |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
return $self->content; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
1; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
__END__ |