=pod

=head1 NAME

Sslscan::Parser - Parse sslscan scan data with Perl

=head1 VERSION

This document describes Sslscan::Parser version .01

=head1 SYNOPSIS

 my $np = new Sslscan::Parser;

 my $parser = $np->parse_file('test1.xml');
    #a Sslscan::Parser Object

 my $host = $parser->get_host('10.0.0.100');
    #a Sslscan::Parser::Host Object

 my @ports = $host->get_all_ports();
    #an Array of Sslscan::Parser::Host::Port Objects

 my $port = $host->get_port('80');
    #a Sslscan::Parser::Host::Port Object

 my @ciphers = $port->get_all_ciphers();
    #an Array of Sslscan::Parser::Host::Port::Cipher Objects
 
I<For a full listing of methods see the documentation corresponding to each object.>

=head1 DESCRIPTION


=head1 OVERVIEW


 Sslscan::Parser                              -- Core parser
 |
 +--Sslscan::Parser::Session                  -- Sslscan scan session information
 |  
 +--Sslscan::Parser::Host                     -- General host information
 |  |
 |  |--Sslscan::Parser::Host::Port            -- Port information
 |  |  |
 |  |  +--Sslscan::Parser::Host::Port::Cipher -- Cipher information
 |  |  |


=head1 METHODS

=head2 Sslscan::Parser

The main idea behind the core modules is, you will first parse the
scan data then extract the information. Therefore, you should run
parse_file or parse_scan then the you can use any of the get_*
methods.

=over 4

=item B<parse_file($xml_file)>

Parse a Sslscan XML file. The XML files are generated from using the: Sslscan.pl --xml=file output.xml $IP

=item B<parse_scan($scan_args,@ips)> 

Perform a Sslscan scan with Sslscan::Parser. The results will be parsed once the scan is complete.

=item B<get_session()>

Obtain the Sslscan::Parser::Session object which contains the session scan information.

=item B<get_host($ipaddr)>

Obtain the Sslscan::Parser::Host object which the host information.

=item B<get_all_hosts()>

Obtain an Array of Sslscan::Parser::Host objects which contain host information.

=back

=head2 Sslscan::Parser::Session

This object contains the scan session information of the Sslscan scan.

=over 4


=item B<title()>

Returns the title of the scan.

=item B<web()>

Returns the website.

=item B<version()>

Returns the version of sslscan.

=back

=head2 Sslscan::Parser::Host

This object contains the information for a host.

=over 4


=item B<ip()>

Returns a string which contains the ip of this host.

=item B<get_port($port)>

Obtain a Sslscan::Parser::Host::Port object which contains the port information.

=item B<get_all_ports()>

Obtain an Array of Sslscan::Parser::Host::Port objects which contain port information.

=back

=head2 Sslscan::Parser::Host::Port

This object contains the information for a port.

=over 4


=item B<port()>

Returns a string which contains the port number.

=item B<get_all_ciphers()>

Returns an Array of Sslscan::Parser::Host::Port::Cipher objects which contain information about the ciphers

=back

=head2 SslScan::Parser::Host::Port::Cipher

This object contains the information for cipher.

=over 4

=item B<status()>

Returns the status of the cipher

=item B<cipher()>

Returns the Cipher.

=item B<bits()>

Returns the number of bits

=item B<sslversion()>

Returns the ssl version

=back 

=head1 EXAMPLES


Here is an example of parsing an XML file using Sslscan::Parser:

my $sslpx = new Sslscan::Parser;

my $parser = $sslpx->parse_file("test1.xml");

foreach my $h ( $parser->get_all_hosts() ){
    print "ip: " . $h->ip . "\n";
    foreach my $p ( $h->get_all_ports ) {
        print "port: " . $p->port . "\n";
    }   
    print "---\n";

}   

=head1 SEE ALSO

 sslscan, XML::LibXML and Object::InsideOut
 

=head1 AUTHOR

Joshua "Jabra" Abraham, S<E<lt>jabra AT spl0it DOT orgE<gt>>

=head1 COPYRIGHT AND LICENSE

Copyright 2009 Joshua D. Abraham. All rights reserved.

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut


