NetworkInfo::Discovery::Nmap - NetworkInfo::Discovery extension using Nmap
Version 0.02
use NetworkInfo::Discovery::Nmap; my $scanner = NetworkInfo::Discovery::Nmap->new( hosts => [ qw( 192.168.0.0/24 192.168.1.0/24 ) ], ); $scanner->do_it;
See eg/nmapdisc.pl for a more complete example.
This module is an extension to NetworkInfo::Discovery which uses the Nmap utility to scan networks, find active hosts, their services and operating system.
NetworkInfo::Discovery
Creates and returns a new NetworkInfo::Discovery::Nmap object, which derives from NetworkInfo::Discovery::Detect.
NetworkInfo::Discovery::Nmap
NetworkInfo::Discovery::Detect
Options
hosts - expects a scalar or an arrayref of IP addresses in CIDR notation
hosts
ports - expects a scalar or an arrayref with a port or a ports range
ports
guess_system - when enabled, tells nmap to use TCP/IP fingerprinting to guess remote operating system (note: root privileges required). Default is 0 (disabled).
guess_system
Example
# specify one host my $scanner = new NetworkInfo::Discovery::Nmap hosts => '192.168.0.0/24'; # specify several hosts my $scanner = new NetworkInfo::Discovery::Nmap hosts => [ qw(192.168.0.0/24) ];
Run the scan.
Add hosts or networks to the scan list. Expects addresses in CIDR notation. Return the current list of hosts when called with no argument.
Examples
$scanner->hosts('192.168.4.53'); # add one host $scanner->hosts('192.168.5.48/29'); # add a subnet $scanner->hosts(qw(192.168.6.0/30 10.0.0.3/28)); # add two subnets
Add ports to the scan list. Expects single ports (e.g. '8080') or ports ranges (e.g. '1-123'). Return the current list of ports when called with no argument.
$scanner->ports('8080'); # add one port $scanner->ports('1-123'); # add a ports range $scanner->ports(qw(137-139 201-208)); # add two ports ranges
When enabled, tells nmap to use TCP/IP fingerprinting to guess remote operating system (note: root privileges required). Default is 0 (disabled).
NetworkInfo::Discovery, Nmap::Scanner
Sébastien Aperghis-Tramoni, <sebastien@aperghis.net>
Please report any bugs or feature requests to bug-networkinfo-discovery-nmap@rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=NetworkInfo-Discovery-Nmap. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-networkinfo-discovery-nmap@rt.cpan.org
Copyright 2004 Sébastien Aperghis-Tramoni, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install NetworkInfo::Discovery::Nmap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm NetworkInfo::Discovery::Nmap
CPAN shell
perl -MCPAN -e shell install NetworkInfo::Discovery::Nmap
For more information on module installation, please visit the detailed CPAN module installation guide.