NAME
Sslscan::Parser - Parse sslscan scan data with Perl
VERSION
This document describes Sslscan::Parser version .02
SYNOPSIS
my $np = new Sslscan::Parser;
my $parser = $np->parse_file('sslscan.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
DESCRIPTION
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
| | |
METHODS
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 subroutines in this module.
- parse_file($xml_file)
-
Parse a Sslscan XML file. This subroutine will return a Sslscan::Parser object that contains the XML data.
XML files are generated from using the following command:
$ sslscan --xml=file.xml [hostname]
- parse_scan($scan_args,@ips)
-
Perform a Sslscan scan with Sslscan::Parser. The results will be parsed once the scan is complete. This subroutine will return a Sslscan::Parser object that contains the XML data.
- get_session()
-
Obtain the Sslscan::Parser::Session object which contains the session scan information.
- get_host($ipaddr)
-
Obtain the Sslscan::Parser::Host object which the host information.
- get_all_hosts()
-
Obtain an Array of Sslscan::Parser::Host objects which contain host information.
Sslscan::Parser::Session
This object contains the scan session information of the Sslscan scan.
- title()
-
Returns the title of the scan.
- web()
-
Returns the website.
- version()
-
Returns the version of sslscan.
Sslscan::Parser::Host
This object contains the information for a host.
- ip()
-
Returns a string which contains the ip of this host.
- get_port($port)
-
Obtain a Sslscan::Parser::Host::Port object which contains the port information.
- get_all_ports()
-
Obtain an Array of Sslscan::Parser::Host::Port objects which contain port information.
Sslscan::Parser::Host::Port
This object contains the information for a port.
- port()
-
Returns a string which contains the port number.
- get_all_ciphers()
-
Returns an Array of Sslscan::Parser::Host::Port::Cipher objects which contain information about the ciphers
SslScan::Parser::Host::Port::Cipher
This object contains the information for cipher.
- status()
-
Returns the status of the cipher. Either "accepted" or "rejected"
- cipher()
-
Returns the Cipher.
- bits()
-
Returns the number of bits of the cipher.
- sslversion()
-
Returns the SSL version.
EXAMPLES
Here is an example of parsing an XML file using Sslscan::Parser:
my $sslpx = new Sslscan::Parser;
my $parser = $sslpx->parse_file("sslscan.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";
foreach my $c ( $c->get_all_ciphers ) {
print "version is " . $c->sslversion . "\n";
print "cipher is " . $c->cipher . "\n";
print "bits is " . $c->bits . "\n";
print "status is " . $c->status . "\n";
}
}
print "---\n";
}
SEE ALSO
sslscan, XML::LibXML and Object::InsideOut
AUTHOR
Joshua "Jabra" Abraham, <jabra AT spl0it DOT org>
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.