Package org.nmap4j.core.scans
Class ServiceDiscovery
java.lang.Object
org.nmap4j.core.scans.BaseScan
org.nmap4j.core.scans.ServiceDiscovery
- All Implemented Interfaces:
IScan
A ServiceDiscovery instance is used to scan a host or hosts to list all the
services the host is running, using NMap's default port specification. The
default port scan specification is to scan the top 1000 ports based on NMap's
own research of what are the most common open ports. You can override this
by providing your own port specification or instead select to
--top-ports (Flag.TOP_PORTS)
or the --port-ratio
(Flag.PORT_RATIO)
settings.
This class is a convenience class that simplifies setting up a scan. The simplest way to scan a host or set of hosts is as follows:
String[] includedHosts = { "192.168.1.1-255" } ;
ServiceDiscovery serviceDiscovery =
new ServiceDiscovery( includedHosts, null ) ;
ExecutionResults results = serviceDiscovery.execute();
This example is the simplest way to scan a set of hosts. NMap will let you specify a range of hosts either as noted above or as a space delimited list.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.nmap4j.core.scans.IScan
IScan.OutputType, IScan.TimingFlag
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class org.nmap4j.core.scans.BaseScan
addFlag, addPort, addPorts, excludeHost, excludeHosts, executeAsynchronousScan, executeScan, getArgumentProperties, getNMapProperties, includeHost, includeHosts, removeExcludeHost, removeExcludeHosts, removeFlag, removeIncludeHost, removeIncludeHosts, setNMapPath, setOutputType, setScanValidator, setTiming
-
Constructor Details
-
ServiceDiscovery
-