line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: ScanDetails.pm 18 2008-05-05 23:55:18Z jabra $ |
2
|
|
|
|
|
|
|
package MetasploitExpress::Parser::ScanDetails; |
3
|
|
|
|
|
|
|
{ |
4
|
1
|
|
|
1
|
|
2018
|
use Object::InsideOut; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
5
|
1
|
|
|
1
|
|
463
|
use XML::LibXML; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use MetasploitExpress::Parser::Host; |
7
|
|
|
|
|
|
|
use MetasploitExpress::Parser::Event; |
8
|
|
|
|
|
|
|
use MetasploitExpress::Parser::Task; |
9
|
|
|
|
|
|
|
use MetasploitExpress::Parser::Service; |
10
|
|
|
|
|
|
|
use MetasploitExpress::Parser::Report; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my @hosts : Field : Arg(hosts) : Get(hosts) : |
13
|
|
|
|
|
|
|
Type(List(MetasploitExpress::Parser::Host)); |
14
|
|
|
|
|
|
|
my @events : Field : Arg(events) : Get(events) : |
15
|
|
|
|
|
|
|
Type(List(MetasploitExpress::Parser::Event)); |
16
|
|
|
|
|
|
|
my @tasks : Field : Arg(tasks) : Get(tasks) : |
17
|
|
|
|
|
|
|
Type(List(MetasploitExpress::Parser::Task)); |
18
|
|
|
|
|
|
|
my @services : Field : Arg(services) : Get(services) : |
19
|
|
|
|
|
|
|
Type(List(MetasploitExpress::Parser::Service)); |
20
|
|
|
|
|
|
|
my @reports : Field : Arg(reports) : Get(reports) : |
21
|
|
|
|
|
|
|
Type(List(MetasploitExpress::Parser::Report)); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub parse { |
24
|
|
|
|
|
|
|
my ( $self, $parser, $doc ) = @_; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $xpc = XML::LibXML::XPathContext->new($doc); |
27
|
|
|
|
|
|
|
my ( @hosts, @events, @tasks, @reports, @services ); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
foreach my $i ( $xpc->findnodes('//MetasploitExpressV3/hosts/host') ) |
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
my $address |
32
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('address') } ) > 0 |
33
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('address') }[0]->textContent() |
34
|
|
|
|
|
|
|
: undef; |
35
|
|
|
|
|
|
|
my $address6 |
36
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('address6') } ) > 0 |
37
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('address6') }[0]->textContent() |
38
|
|
|
|
|
|
|
: undef; |
39
|
|
|
|
|
|
|
my $arch |
40
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('arch') } ) > 0 |
41
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('arch') }[0]->textContent() |
42
|
|
|
|
|
|
|
: undef; |
43
|
|
|
|
|
|
|
my $comm |
44
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('comm') } ) > 0 |
45
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('comm') }[0]->textContent() |
46
|
|
|
|
|
|
|
: undef; |
47
|
|
|
|
|
|
|
my $comments |
48
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('comments') } ) > 0 |
49
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('comments') }[0]->textContent() |
50
|
|
|
|
|
|
|
: undef; |
51
|
|
|
|
|
|
|
my $id |
52
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('id') } ) > 0 |
53
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('id') }[0]->textContent() |
54
|
|
|
|
|
|
|
: undef; |
55
|
|
|
|
|
|
|
my $info |
56
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('info') } ) > 0 |
57
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('info') }[0]->textContent() |
58
|
|
|
|
|
|
|
: undef; |
59
|
|
|
|
|
|
|
my $created_at |
60
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('created-at') } ) > 0 |
61
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('created-at') }[0] |
62
|
|
|
|
|
|
|
->textContent() |
63
|
|
|
|
|
|
|
: undef; |
64
|
|
|
|
|
|
|
my $mac |
65
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('mac') } ) > 0 |
66
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('mac') }[0]->textContent() |
67
|
|
|
|
|
|
|
: undef; |
68
|
|
|
|
|
|
|
my $name |
69
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('name') } ) > 0 |
70
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('name') }[0]->textContent() |
71
|
|
|
|
|
|
|
: undef; |
72
|
|
|
|
|
|
|
my $os_flavor |
73
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('os-flavor') } ) > 0 |
74
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('os-flavor') }[0]->textContent() |
75
|
|
|
|
|
|
|
: undef; |
76
|
|
|
|
|
|
|
my $os_lang |
77
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('os-flavor') } ) > 0 |
78
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('os-lang') }[0]->textContent() |
79
|
|
|
|
|
|
|
: undef; |
80
|
|
|
|
|
|
|
my $os_name |
81
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('os-name') } ) > 0 |
82
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('os-name') }[0]->textContent() |
83
|
|
|
|
|
|
|
: undef; |
84
|
|
|
|
|
|
|
my $os_sp |
85
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('os-sp') } ) > 0 |
86
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('os-sp') }[0]->textContent() |
87
|
|
|
|
|
|
|
: undef; |
88
|
|
|
|
|
|
|
my $purpose |
89
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('purpose') } ) > 0 |
90
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('purpose') }[0]->textContent() |
91
|
|
|
|
|
|
|
: undef; |
92
|
|
|
|
|
|
|
my $state |
93
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('state') } ) > 0 |
94
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('state') }[0]->textContent() |
95
|
|
|
|
|
|
|
: undef; |
96
|
|
|
|
|
|
|
my $updated_at |
97
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('updated-at') } ) > 0 |
98
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('updated-at') }[0] |
99
|
|
|
|
|
|
|
->textContent() |
100
|
|
|
|
|
|
|
: undef; |
101
|
|
|
|
|
|
|
my $workspace_id |
102
|
|
|
|
|
|
|
= scalar( @{ $i->getElementsByTagName('workspace-id') } ) > 0 |
103
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('workspace-id') }[0] |
104
|
|
|
|
|
|
|
->textContent() |
105
|
|
|
|
|
|
|
: undef; |
106
|
|
|
|
|
|
|
my $host = MetasploitExpress::Parser::Host->new( |
107
|
|
|
|
|
|
|
address => $address, |
108
|
|
|
|
|
|
|
address6 => $address6, |
109
|
|
|
|
|
|
|
arch => $arch, |
110
|
|
|
|
|
|
|
comm => $comm, |
111
|
|
|
|
|
|
|
comments => $comments, |
112
|
|
|
|
|
|
|
created_at => $created_at, |
113
|
|
|
|
|
|
|
id => $id, |
114
|
|
|
|
|
|
|
info => $info, |
115
|
|
|
|
|
|
|
mac => $mac, |
116
|
|
|
|
|
|
|
name => $name, |
117
|
|
|
|
|
|
|
os_lang => $os_lang, |
118
|
|
|
|
|
|
|
os_name => $os_name, |
119
|
|
|
|
|
|
|
os_flavor => $os_flavor, |
120
|
|
|
|
|
|
|
os_sp => $os_sp, |
121
|
|
|
|
|
|
|
purpose => $purpose, |
122
|
|
|
|
|
|
|
state => $state, |
123
|
|
|
|
|
|
|
updated_at => $updated_at, |
124
|
|
|
|
|
|
|
workspace_id => $workspace_id, |
125
|
|
|
|
|
|
|
); |
126
|
|
|
|
|
|
|
push( @hosts, $host ); |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
foreach my $i ( |
130
|
|
|
|
|
|
|
$xpc->findnodes('//MetasploitExpressV3/services/service') ) |
131
|
|
|
|
|
|
|
{ |
132
|
|
|
|
|
|
|
my $service = MetasploitExpress::Parser::Service->new( |
133
|
|
|
|
|
|
|
id => scalar( @{ $i->getElementsByTagName('id') } ) > 0 |
134
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('id') }[0]->textContent() |
135
|
|
|
|
|
|
|
: undef, |
136
|
|
|
|
|
|
|
name => scalar( @{ $i->getElementsByTagName('name') } ) > 0 |
137
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('name') }[0]->textContent() |
138
|
|
|
|
|
|
|
: undef, |
139
|
|
|
|
|
|
|
host_id => scalar( @{ $i->getElementsByTagName('host-id') } ) |
140
|
|
|
|
|
|
|
> 0 |
141
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('host-id') }[0]->textContent() |
142
|
|
|
|
|
|
|
: undef, |
143
|
|
|
|
|
|
|
info => scalar( @{ $i->getElementsByTagName('info') } ) > 0 |
144
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('info') }[0]->textContent() |
145
|
|
|
|
|
|
|
: undef, |
146
|
|
|
|
|
|
|
port => scalar( @{ $i->getElementsByTagName('port') } ) > 0 |
147
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('port') }[0]->textContent() |
148
|
|
|
|
|
|
|
: undef, |
149
|
|
|
|
|
|
|
proto => scalar( @{ $i->getElementsByTagName('proto') } ) > 0 |
150
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('proto') }[0]->textContent() |
151
|
|
|
|
|
|
|
: undef, |
152
|
|
|
|
|
|
|
state => scalar( @{ $i->getElementsByTagName('state') } ) > 0 |
153
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('state') }[0]->textContent() |
154
|
|
|
|
|
|
|
: undef, |
155
|
|
|
|
|
|
|
updated_at => |
156
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('updated-at') } ) > 0 |
157
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('updated-at') }[0] |
158
|
|
|
|
|
|
|
->textContent() |
159
|
|
|
|
|
|
|
: undef, |
160
|
|
|
|
|
|
|
created_at => |
161
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('created-at') } ) > 0 |
162
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('created-at') }[0] |
163
|
|
|
|
|
|
|
->textContent() |
164
|
|
|
|
|
|
|
: undef, |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
); |
167
|
|
|
|
|
|
|
push( @services, $service ); |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
foreach |
171
|
|
|
|
|
|
|
my $i ( $xpc->findnodes('//MetasploitExpressV3/events/event') ) |
172
|
|
|
|
|
|
|
{ |
173
|
|
|
|
|
|
|
my $event = MetasploitExpress::Parser::Event->new( |
174
|
|
|
|
|
|
|
created_at => |
175
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('created-at') } ) > 0 |
176
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('created-at') }[0] |
177
|
|
|
|
|
|
|
->textContent() |
178
|
|
|
|
|
|
|
: undef, |
179
|
|
|
|
|
|
|
critical => |
180
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('critical') } ) > 0 |
181
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('critical') }[0]->textContent() |
182
|
|
|
|
|
|
|
: undef, |
183
|
|
|
|
|
|
|
host_id => scalar( @{ $i->getElementsByTagName('host-id') } ) |
184
|
|
|
|
|
|
|
> 0 |
185
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('host-id') }[0]->textContent() |
186
|
|
|
|
|
|
|
: undef, |
187
|
|
|
|
|
|
|
id => scalar( @{ $i->getElementsByTagName('id') } ) > 0 |
188
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('id') }[0]->textContent() |
189
|
|
|
|
|
|
|
: undef, |
190
|
|
|
|
|
|
|
name => scalar( @{ $i->getElementsByTagName('name') } ) > 0 |
191
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('name') }[0]->textContent() |
192
|
|
|
|
|
|
|
: undef, |
193
|
|
|
|
|
|
|
seen => scalar( @{ $i->getElementsByTagName('seen') } ) > 0 |
194
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('seen') }[0]->textContent() |
195
|
|
|
|
|
|
|
: undef, |
196
|
|
|
|
|
|
|
updated_at => |
197
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('updated-at') } ) > 0 |
198
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('updated-at') }[0] |
199
|
|
|
|
|
|
|
->textContent() |
200
|
|
|
|
|
|
|
: undef, |
201
|
|
|
|
|
|
|
workspace_id => |
202
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('workspace-id') } ) |
203
|
|
|
|
|
|
|
> 0 |
204
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('workspace-id') }[0] |
205
|
|
|
|
|
|
|
->textContent() |
206
|
|
|
|
|
|
|
: undef, |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
); |
209
|
|
|
|
|
|
|
push( @events, $event ); |
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
foreach my $i ( $xpc->findnodes('//MetasploitExpressV3/tasks/task') ) |
213
|
|
|
|
|
|
|
{ |
214
|
|
|
|
|
|
|
my $task = MetasploitExpress::Parser::Task->new( |
215
|
|
|
|
|
|
|
completed_at => |
216
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('completed-at') } ) |
217
|
|
|
|
|
|
|
> 0 |
218
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('completed-at') }[0] |
219
|
|
|
|
|
|
|
->textContent() |
220
|
|
|
|
|
|
|
: undef, |
221
|
|
|
|
|
|
|
created_at => |
222
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('created-at') } ) > 0 |
223
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('created-at') }[0] |
224
|
|
|
|
|
|
|
->textContent() |
225
|
|
|
|
|
|
|
: undef, |
226
|
|
|
|
|
|
|
created_by => |
227
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('created_by') } ) > 0 |
228
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('created_by') }[0] |
229
|
|
|
|
|
|
|
->textContent() |
230
|
|
|
|
|
|
|
: undef, |
231
|
|
|
|
|
|
|
description => |
232
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('description') } ) > 0 |
233
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('description') }[0] |
234
|
|
|
|
|
|
|
->textContent() |
235
|
|
|
|
|
|
|
: undef, |
236
|
|
|
|
|
|
|
error => scalar( @{ $i->getElementsByTagName('error') } ) > 0 |
237
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('error') }[0]->textContent() |
238
|
|
|
|
|
|
|
: undef, |
239
|
|
|
|
|
|
|
id => scalar( @{ $i->getElementsByTagName('id') } ) > 0 |
240
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('id') }[0]->textContent() |
241
|
|
|
|
|
|
|
: undef, |
242
|
|
|
|
|
|
|
module => scalar( @{ $i->getElementsByTagName('module') } ) |
243
|
|
|
|
|
|
|
> 0 |
244
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('module') }[0]->textContent() |
245
|
|
|
|
|
|
|
: undef, |
246
|
|
|
|
|
|
|
path => scalar( @{ $i->getElementsByTagName('path') } ) > 0 |
247
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('path') }[0]->textContent() |
248
|
|
|
|
|
|
|
: undef, |
249
|
|
|
|
|
|
|
progress => |
250
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('progress') } ) > 0 |
251
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('progress') }[0]->textContent() |
252
|
|
|
|
|
|
|
: undef, |
253
|
|
|
|
|
|
|
result => scalar( @{ $i->getElementsByTagName('result') } ) |
254
|
|
|
|
|
|
|
> 0 |
255
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('result') }[0]->textContent() |
256
|
|
|
|
|
|
|
: undef, |
257
|
|
|
|
|
|
|
updated_at => |
258
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('updated-at') } ) > 0 |
259
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('updated-at') }[0] |
260
|
|
|
|
|
|
|
->textContent() |
261
|
|
|
|
|
|
|
: undef, |
262
|
|
|
|
|
|
|
workspace_id => |
263
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('workspace-id') } ) |
264
|
|
|
|
|
|
|
> 0 |
265
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('workspace-id') }[0] |
266
|
|
|
|
|
|
|
->textContent() |
267
|
|
|
|
|
|
|
: undef, |
268
|
|
|
|
|
|
|
); |
269
|
|
|
|
|
|
|
push( @tasks, $task ); |
270
|
|
|
|
|
|
|
} |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
foreach |
273
|
|
|
|
|
|
|
my $i ( $xpc->findnodes('//MetasploitExpressV3/reports/report') ) |
274
|
|
|
|
|
|
|
{ |
275
|
|
|
|
|
|
|
my $report = MetasploitExpress::Parser::Report->new( |
276
|
|
|
|
|
|
|
created_at => |
277
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('created-at') } ) > 0 |
278
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('created-at') }[0] |
279
|
|
|
|
|
|
|
->textContent() |
280
|
|
|
|
|
|
|
: undef, |
281
|
|
|
|
|
|
|
created_by => |
282
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('created-by') } ) > 0 |
283
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('created-by') }[0] |
284
|
|
|
|
|
|
|
->textContent() |
285
|
|
|
|
|
|
|
: undef, |
286
|
|
|
|
|
|
|
id => scalar( @{ $i->getElementsByTagName('id') } ) > 0 |
287
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('id') }[0]->textContent() |
288
|
|
|
|
|
|
|
: undef, |
289
|
|
|
|
|
|
|
path => scalar( @{ $i->getElementsByTagName('path') } ) > 0 |
290
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('path') }[0]->textContent() |
291
|
|
|
|
|
|
|
: undef, |
292
|
|
|
|
|
|
|
rtype => scalar( @{ $i->getElementsByTagName('rtype') } ) > 0 |
293
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('rtype') }[0]->textContent() |
294
|
|
|
|
|
|
|
: undef, |
295
|
|
|
|
|
|
|
options => scalar( @{ $i->getElementsByTagName('options') } ) |
296
|
|
|
|
|
|
|
> 0 |
297
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('options') }[0]->textContent() |
298
|
|
|
|
|
|
|
: undef, |
299
|
|
|
|
|
|
|
updated_at => |
300
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('updated-at') } ) > 0 |
301
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('updated-at') }[0] |
302
|
|
|
|
|
|
|
->textContent() |
303
|
|
|
|
|
|
|
: undef, |
304
|
|
|
|
|
|
|
workspace_id => |
305
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('workspace-id') } ) |
306
|
|
|
|
|
|
|
> 0 |
307
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('workspace-id') }[0] |
308
|
|
|
|
|
|
|
->textContent() |
309
|
|
|
|
|
|
|
: undef, |
310
|
|
|
|
|
|
|
downloaded_at => |
311
|
|
|
|
|
|
|
scalar( @{ $i->getElementsByTagName('downloaded-at') } ) |
312
|
|
|
|
|
|
|
> 0 |
313
|
|
|
|
|
|
|
? @{ $i->getElementsByTagName('downloaded-at') }[0] |
314
|
|
|
|
|
|
|
->textContent() |
315
|
|
|
|
|
|
|
: undef, |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
); |
318
|
|
|
|
|
|
|
push( @reports, $report ); |
319
|
|
|
|
|
|
|
} |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
return MetasploitExpress::Parser::ScanDetails->new( |
322
|
|
|
|
|
|
|
hosts => \@hosts, |
323
|
|
|
|
|
|
|
reports => \@reports, |
324
|
|
|
|
|
|
|
tasks => \@tasks, |
325
|
|
|
|
|
|
|
events => \@events, |
326
|
|
|
|
|
|
|
services => \@services, |
327
|
|
|
|
|
|
|
); |
328
|
|
|
|
|
|
|
} |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
sub all_hosts { |
331
|
|
|
|
|
|
|
my ($self) = @_; |
332
|
|
|
|
|
|
|
my @hosts = @{ $self->hosts }; |
333
|
|
|
|
|
|
|
return @hosts; |
334
|
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
sub all_services { |
337
|
|
|
|
|
|
|
my ($self) = @_; |
338
|
|
|
|
|
|
|
my @services = @{ $self->services }; |
339
|
|
|
|
|
|
|
return @services; |
340
|
|
|
|
|
|
|
} |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
sub all_events { |
343
|
|
|
|
|
|
|
my ($self) = @_; |
344
|
|
|
|
|
|
|
my @events = @{ $self->events }; |
345
|
|
|
|
|
|
|
return @events; |
346
|
|
|
|
|
|
|
} |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
sub all_tasks { |
349
|
|
|
|
|
|
|
my ($self) = @_; |
350
|
|
|
|
|
|
|
my @tasks = @{ $self->tasks }; |
351
|
|
|
|
|
|
|
return @tasks; |
352
|
|
|
|
|
|
|
} |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
sub all_reports { |
355
|
|
|
|
|
|
|
my ($self) = @_; |
356
|
|
|
|
|
|
|
my @reports = @{ $self->reports }; |
357
|
|
|
|
|
|
|
return @reports; |
358
|
|
|
|
|
|
|
} |
359
|
|
|
|
|
|
|
} |
360
|
|
|
|
|
|
|
1; |