Skip to content

Commit

Permalink
Updated links.
Browse files Browse the repository at this point in the history
  • Loading branch information
apersaud committed Dec 8, 2016
1 parent b92b1ee commit a5b7ccc
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 55 deletions.
8 changes: 6 additions & 2 deletions Changes
@@ -1,11 +1,15 @@
Revision history for Perl extension Nmap::Parser.

Bleeding Edge version: http://apersaud.github.io/Nmap-Parser/
Bleeding Edge version: https://github.com/modernistik/Nmap-Parser

For a full list of changes and contributors see: https://github.com/apersaud/Nmap-Parser/commits/master

Changes for 1.33
- Add tcp_port_state_ttl() function for export from nmap xml results. Thanks to @matrix.
- Document fixes thanks to @zOrg1331

Changes for 1.32
- Updated website: http://apersaud.github.io/Nmap-Parser/
- Updated website: https://github.com/modernistik/Nmap-Parser
- Eliminate global variables %D - thanks to bonsaiviking
Changes for 1.30
- Merged features of pull request #6 (bonsaiviking)
Expand Down
96 changes: 48 additions & 48 deletions Parser.pm
Expand Up @@ -3,7 +3,7 @@ package Nmap::Parser;
use strict;
use XML::Twig;

our $VERSION = 1.32;
our $VERSION = 1.33;


sub new {
Expand Down Expand Up @@ -628,7 +628,7 @@ sub __host_trace_error_tag_hdlr {

my $error_tag = $trace_tag->first_child('error');
if ( defined $error_tag ) {

# If an error happens, always provide a true value even if
# it doesn't contains a useful string
my $errorstr = $error_tag->{att}->{errorstr} || 1;
Expand Down Expand Up @@ -1118,44 +1118,44 @@ Nmap::Parser - parse nmap scan data with perl
use Nmap::Parser;
my $np = new Nmap::Parser;
$np->parsescan($nmap_path, $nmap_args, @ips);
#or
$np->parsefile($file_xml);
my $session = $np->get_session();
#a Nmap::Parser::Session object
my $host = $np->get_host($ip_addr);
#a Nmap::Parser::Host object
my $service = $host->tcp_service(80);
#a Nmap::Parser::Host::Service object
my $os = $host->os_sig();
#a Nmap::Parser::Host::OS object
#---------------------------------------
my $np2 = new Nmap::Parser;
$np2->callback(\&my_callback);
$np2->parsefile($file_xml);
#or
$np2->parsescan($nmap_path, $nmap_args, @ips);
sub my_callback {
my $host = shift;
#Nmap::Parser::Host object
#.. see documentation for all methods ...
}
I<For a full listing of methods see the documentation corresponding to each object.>
You can also visit the website L<http://apersaud.github.io/Nmap-Parser/> for additional installation instructions.
I<For a full listing of methods see the documentation corresponding to each object.>
You can also visit the website L<https://github.com/modernistik/Nmap-Parser> for additional installation instructions.
=head1 DESCRIPTION
Expand All @@ -1164,7 +1164,7 @@ It is implemented by parsing the xml scan data that is generated by nmap. This
will enable anyone who utilizes nmap to quickly create fast and robust security scripts
that utilize the powerful port scanning abilities of nmap.
The latest version of this module can be found on here L<http://apersaud.github.io/Nmap-Parser/>
The latest version of this module can be found on here L<https://github.com/modernistik/Nmap-Parser>
=head1 OVERVIEW
Expand All @@ -1179,7 +1179,7 @@ operating system signature information (OS guessed names, classes, osfamily..etc
Nmap::Parser -- Core parser
|
+--Nmap::Parser::Session -- Nmap scan session information
|
|
+--Nmap::Parser::Host -- General host information
| |
| |-Nmap::Parser::Host::Service -- Port service information
Expand Down Expand Up @@ -1258,7 +1258,7 @@ you are parsing lots of nmap scan data files with persistent variables.
Sets the parsing mode to be done using the callback function. It takes the parameter
of a code reference or a reference to a function. If no code reference is given,
it resets the mode to normal (no callback).
$np->callback(\&my_function); #sets callback, my_function() will be called
$np->callback(); #resets it, no callback function called. Back to normal.
Expand Down Expand Up @@ -1423,7 +1423,7 @@ is used as the location in the array. The index starts at 0;
hostname() eq hostname(0);
hostname(1); #second hostname found
hostname(400) eq hostname(1) #nothing at 400; return the name at the last index
=item B<ipv4_addr()>
Expand Down Expand Up @@ -1529,7 +1529,7 @@ a string argument can be given to these functions to filter the list.
$host->tcp_ports('open') #returns all only 'open' ports (even 'open|filtered')
$host->udp_ports('open|filtered'); #matches exactly ports with 'open|filtered'
I<Note that if a port state is set to 'open|filtered' (or any combination), it will
be counted as an 'open' port as well as a 'filtered' one.>
Expand Down Expand Up @@ -1560,33 +1560,33 @@ Returns the state of the given port, provided by the port number in $portid.
=item B<udp_open_ports()>
Returns the list of open TCP|UDP ports respectively. Note that if a port state is
for example, 'open|filtered', it will appear on this list as well.
for example, 'open|filtered', it will appear on this list as well.
=item B<tcp_filtered_ports()>
=item B<udp_filtered_ports()>
Returns the list of filtered TCP|UDP ports respectively. Note that if a port state is
for example, 'open|filtered', it will appear on this list as well.
for example, 'open|filtered', it will appear on this list as well.
=item B<tcp_closed_ports()>
=item B<udp_closed_ports()>
Returns the list of closed TCP|UDP ports respectively. Note that if a port state is
for example, 'closed|filtered', it will appear on this list as well.
for example, 'closed|filtered', it will appear on this list as well.
=item B<tcp_service($portid)>
=item B<udp_service($portid)>
Returns the Nmap::Parser::Host::Service object of a given service running on port,
provided by $portid. See Nmap::Parser::Host::Service for more info.
provided by $portid. See Nmap::Parser::Host::Service for more info.
$svc = $host->tcp_service(80);
$svc->name;
$svc->proto;
=back
Expand Down Expand Up @@ -1644,7 +1644,7 @@ Returns the tunnel value. (If available)
=item B<fingerprint()>
Returns the service fingerprint. (If available)
=item B<version()>
Returns the version of the given product of the running service.
Expand Down Expand Up @@ -1794,8 +1794,8 @@ The host name of this hop, if known.
I think some of us best learn from examples. These are a couple of examples to help
create custom security audit tools using some of the nice features
of the Nmap::Parser module. Hopefully this can double as a tutorial.
More tutorials (articles) can be found at L<http://apersaud.github.io/Nmap-Parser/>
of the Nmap::Parser module. Hopefully this can double as a tutorial.
More tutorials (articles) can be found at L<https://github.com/modernistik/Nmap-Parser>
=head2 Real-Time Scanning
Expand Down Expand Up @@ -1823,7 +1823,7 @@ you can use cache_scan(). You must call cache_scan() BEFORE you initiate the par
my $np = new Nmap::Parser;
#telling np to save output
$np->cache_scan('nmap.localhost.xml');
$np->cache_scan('nmap.localhost.xml');
$np->parsescan('/usr/bin/nmap','-F','localhost');
#do other stuff...
Expand All @@ -1841,9 +1841,9 @@ setup before parsing>
use Nmap::Parser;
my $np = new Nmap::Parser;
$np->callback( \&booyah );
$np->parsefile('nmap_results.xml');
# or use parsescan()
Expand All @@ -1855,7 +1855,7 @@ setup before parsing>
#when it returns, host object will be deleted from memory
#(good for processing VERY LARGE files or scans)
}
=head2 Multiple Instances - (C<no less 'of'; my $self>)
Expand All @@ -1872,43 +1872,43 @@ same hosts, and compare if any new tcp have been open since then
use vars qw($nmap_exe $nmap_args @ips);
my $base = new Nmap::Parser;
my $curr = new Nmap::Parser;
$base->parsefile('base_image.xml'); #load previous state
$curr->parsescan($nmap_exe, $nmap_args, @ips); #scan current hosts
for my $ip ($curr->get_ips )
for my $ip ($curr->get_ips )
{
#assume that IPs in base == IPs in curr scan
my $ip_base = $base->get_host($ip);
my $ip_curr = $curr->get_host($ip);
my %port = ();
#find ports that are open that were not open before
#by finding the difference in port lists
my @diff = grep { $port{$_} < 2}
(map {$port{$_}++; $_}
my @diff = grep { $port{$_} < 2}
(map {$port{$_}++; $_}
( $ip_curr->tcp_open_ports , $ip_base->tcp_open_ports ));
print "$ip has these new ports open: ".join(',',@diff) if(scalar @diff);
for (@diff){print "$_ seems to be ",$ip_curr->tcp_service($_)->name,"\n";}
}
=head1 SUPPORT
=head2 Discussion Forum
If you have questions about how to use the module, or any of its features, you
can post messages to the Nmap::Parser module forum on CPAN::Forum.
L<https://github.com/apersaud/Nmap-Parser/issues>
L<https://github.com/modernistik/Nmap-Parser/issues>
=head2 Bug Reports, Enhancements, Merge Requests
Please submit any bugs or feature requests to:
L<https://github.com/apersaud/Nmap-Parser/issues>
L<https://github.com/modernistik/Nmap-Parser/issues>
B<Please make sure that you submit the xml-output file of the scan which you are having
trouble with.> This can be done by running your scan with the I<-oX filename.xml> nmap switch.
Expand All @@ -1918,17 +1918,17 @@ Please remove any important IP addresses for security reasons. It saves time in
nmap, XML::Twig
The Nmap::Parser page can be found at: L<http://apersaud.github.io/Nmap-Parser/>.
The Nmap::Parser page can be found at: L<https://github.com/modernistik/Nmap-Parser>.
It contains the latest developments on the module. The nmap security scanner
homepage can be found at: L<http://www.insecure.org/nmap/>.
=head1 AUTHORS
Origiinal author, Anthony Persaud L<http://modernistik.com>. However, special thanks to: Daniel Miller L<https://github.com/bonsaiviking> and Robin Bowes L<http://robinbowes.com>.
Origiinal author, Anthony Persaud L<https://www.modernistik.com>. However, special thanks to: Daniel Miller L<https://github.com/bonsaiviking> and Robin Bowes L<http://robinbowes.com>.
Please see Changes file and CONTRIBUTORS file for a list of other great contributors.
=head1 COPYRIGHT
Copyright (c) <2003-2013> <Anthony Persaud> L<http://modernistik.com>
Copyright (c) <2003-2017> <Anthony Persaud> L<https://www.modernistik.com>
MIT License
Expand Down
8 changes: 4 additions & 4 deletions tools/nmap2sqlite.pl
Expand Up @@ -51,7 +51,7 @@
pod2usage( -exitstatus => 0, -verbose => 2 );
}

print "\nnmap2sqlite.pl - ( http://apersaud.github.io/Nmap-Parser/ )\n",
print "\nnmap2sqlite.pl - ( https://github.com/modernistik/Nmap-Parser )\n",
( '-' x 50 ), "\n\n";

if ( $G{scan} && $G{nmap} eq '' ) {
Expand Down Expand Up @@ -216,7 +216,7 @@ =head1 DESCRIPTION
=head1 OPTIONS
These options are passed as command line parameters. Please use EITHER --scan or --xml. NOT both.
These options are passed as command line parameters. Please use EITHER --scan or --xml. NOT both.
=over 4
Expand All @@ -238,7 +238,7 @@ =head1 OPTIONS
=item B<--table TABLE_NAME>
Sets the table name to use in the database as TABLE_NAME.
Sets the table name to use in the database as TABLE_NAME.
=item B<--xml>
Expand Down Expand Up @@ -275,7 +275,7 @@ =head1 TARGET SPECIFICATION
nmap2sqlite.pl --scan 10.210.*.1-127
nmap2sqlite.pl --scan *.*.2.3-5
nmap2sqlite.pl --scan 10.[10-15].10.[2-254]
=head1 OUTPUT EXAMPLE
Expand Down
2 changes: 1 addition & 1 deletion tools/scan.pl
Expand Up @@ -12,7 +12,7 @@

my $np = new Nmap::Parser;

print "\nscan.pl - ( http://apersaud.github.io/Nmap-Parser/ )\n", ( '-' x 80 ), "\n\n";
print "\nscan.pl - ( https://github.com/modernistik/Nmap-Parser )\n", ( '-' x 80 ), "\n\n";

GetOptions(
'help|h|?' => \$G{helpme},
Expand Down

0 comments on commit a5b7ccc

Please sign in to comment.