| 1 | # $Id: Parser.pm 71 2008-08-31 05:58:17Z jabra $ | ||
| 2 | package MetasploitExpress::Parser; | ||
| 3 | { | ||
| 4 | 1 | ▶ | use Object::InsideOut; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use MetasploitExpress::Parser::Session; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | my @session : Field : Arg(session) : Get(session) : | |
| 7 | Type(MetasploitExpress::Parser::Session); | ||
| 8 | |||
| 9 | # parse_file | ||
| 10 | # | ||
| 11 | # Input: | ||
| 12 | # argument - self obj - | ||
| 13 | # argument - xml scalar | ||
| 14 | # | ||
| 15 | # Ouptut: | ||
| 16 | # | ||
| 17 | 0 | ▶ | sub parse_file { |
|
Subroutine
parse_file: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 18 | 0 | my ( $self, $file ) = @_; | |
| 19 | 0 | my $parser = XML::LibXML->new(); | |
| 20 | |||
| 21 | 0 | my $doc = $parser->parse_file($file); | |
| 22 | 0 | return MetasploitExpress::Parser->new( session => | |
| 23 | MetasploitExpress::Parser::Session->parse( $parser, $doc ) ); | ||
| 24 | } | ||
| 25 | |||
| 26 | 0 | ▶ | sub get_session { |
|
Subroutine
get_session: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 27 | 0 | my ($self) = @_; | |
| 28 | 0 | return $self->session; | |
| 29 | } | ||
| 30 | |||
| 31 | 0 | ▶ | sub get_host { |
|
Subroutine
get_host: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 32 | 0 | my ( $self, $ip ) = @_; | |
| 33 | 0 | return $self->session->scandetails->get_host_ip($ip); | |
| 34 | } | ||
| 35 | |||
| 36 | 0 | ▶ | sub get_all_hosts { |
|
Subroutine
get_all_hosts: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 37 | 0 | my ($self) = @_; | |
| 38 | 0 | return $self->session->scandetails->all_hosts(); | |
| 39 | } | ||
| 40 | |||
| 41 | 0 | ▶ | sub get_all_services { |
|
Subroutine
get_all_services: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 42 | 0 | my ($self) = @_; | |
| 43 | 0 | return $self->session->scandetails->all_services(); | |
| 44 | } | ||
| 45 | |||
| 46 | 0 | ▶ | sub get_all_events { |
|
Subroutine
get_all_events: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 47 | 0 | my ($self) = @_; | |
| 48 | 0 | return $self->session->scandetails->all_events(); | |
| 49 | } | ||
| 50 | |||
| 51 | 0 | ▶ | sub get_all_tasks { |
|
Subroutine
get_all_tasks: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 52 | 0 | my ($self) = @_; | |
| 53 | 0 | return $self->session->scandetails->all_tasks(); | |
| 54 | } | ||
| 55 | |||
| 56 | 0 | ▶ | sub get_all_reports { |
|
Subroutine
get_all_reports: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 57 | 0 | my ($self) = @_; | |
| 58 | 0 | return $self->session->scandetails->all_reports(); | |
| 59 | } | ||
| 60 | } | ||
| 61 | 1 | 1; | |
| 62 | |||