NAME
Dirbuster::Parser - Parse Dirbuster scan data with Perl
VERSION
This document describes Dirbuster::Parser version .01
SYNOPSIS
my $dpx = new Dirbuster::Parser;
my $parser = $dpx->parse_file('test1.xml');
#a Dirbuster::Parser Object
my @results = $parser->get_all_results();
#an Array of Dirbuster::Parser::Result Objects
foreach my $h ( grep($_->type eq 'Dir', $parser->get_all_results()) ) {
print "Type: " . $h->type . "\n";
print "Path: " . $h->path . "\n";
print "Response Code: " . $h->response_code . "\n";
}
For a full listing of methods see the documentation corresponding to each object.
DESCRIPTION
OVERVIEW
Dirbuster::Parser -- Core parser
|
+--Dirbuster::Parser::Session -- Dirbuster scan session information
|
+--Dirbuster::Parser::Target -- General target information
| |
| |--Dirbuster::Parser::Target::Result -- Result information
| | |
METHODS
Dirbuster::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 then the you can use any of the subroutines of the objects.
- parse_file($xml_file)
-
Parse a Dirbuster XML file. This subroutine returns a Dirbuster::Parser object containing the information from the XML.
- get_session()
-
Obtain the Dirbuster::Parser::Session object which contains the session scan information.
- get_all_results()
-
Obtain an Array of Dirbuster::Parser::Target::Result objects which contain file and directory information.
Dirbuster::Parser::Target::Result
This object contains the information for a result
- type()
-
Returns a string which contains the type (File or Dir)
- response_code()
-
Returns the response code from the request.
- path()
-
Returns the path.
EXAMPLES
Here is an example of parsing an XML file using Dirbuster::Parser:
my $dpx = new Dirbuster::Parser;
my $parser = $dpx->parse_file('test1.xml');
print "Directories:\n"; foreach my $h ( grep($_->type eq "Dir", $parser->get_all_results()) ) { print "Type: " . $h->type . "\n"; print "Path: " . $h->path . "\n"; print "Response Code: " . $h->response_code . "\n"; }
print "Files:\n"; foreach my $h ( grep($_->type eq "File", $parser->get_all_results()) ) { print "Type: " . $h->type . "\n"; print "Path: " . $h->path . "\n"; print "Response Code: " . $h->response_code . "\n"; }
SEE ALSO
Dirbuster, 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.