NAME
NetworkInfo::Discovery::Nmap - NetworkInfo::Discovery extension using Nmap
VERSION
Version 0.02
SYNOPSIS
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.
DESCRIPTION
This module is an extension to NetworkInfo::Discovery
which uses the Nmap utility to scan networks, find active hosts, their services and operating system.
METHODS
- new()
-
Creates and returns a new
NetworkInfo::Discovery::Nmap
object, which derives fromNetworkInfo::Discovery::Detect
.Options
hosts
- expects a scalar or an arrayref of IP addresses in CIDR notationports
- expects a scalar or an arrayref with a port or a ports rangeguess_system
- when enabled, tells nmap to use TCP/IP fingerprinting to guess remote operating system (note: root privileges required). Default is 0 (disabled).
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)
];
- do_it()
-
Run the scan.
- hosts()
-
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
- ports()
-
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.
Examples
$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
- guess_system()
-
When enabled, tells nmap to use TCP/IP fingerprinting to guess remote operating system (note: root privileges required). Default is 0 (disabled).
SEE ALSO
NetworkInfo::Discovery, Nmap::Scanner
AUTHOR
Sébastien Aperghis-Tramoni, <sebastien@aperghis.net>
BUGS
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.
COPYRIGHT & LICENSE
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.