verinec.importer.analysis.scanner
Class StartScan

java.lang.Object
  extended by verinec.importer.analysis.AAnalyserStartOperation
      extended by verinec.importer.analysis.scanner.StartScan
All Implemented Interfaces:
IOperation

public class StartScan
extends AAnalyserStartOperation

Starts the port scan operations for all hosts that should be scanned.

The constant SYNCHRONOUS_HOST_SCAN defines the number of parallel scans to execute. The starter creates as many threads, which will poll the starter for hosts to scan.

The starter filters the host names according to the configuration panel, to avoid scanning external hosts.

If no hosts should be scanned, nothing will be done. (Scanning is finished immediately.)

Author:
Patrick Aebischer, david.buchmann at unifr.ch, martial.seifriz at unifr.ch

Nested Class Summary
static class StartScan.ConfigPanel
          Configuration panel for the port scanner.
 
Field Summary
private  StartScan.ConfigPanel configuration
          The configurations panel
static int LINUX
          Nmap for linux should be launched.
private  Logger logger
           
private  Iterator scanIterGetElement
          The iterator to get the host for the scanns
static int SYNCHRONOUS_HOST_SCAN
          Constant to determine the number of parallel scans.
static int WINDOWS
          Nmap for windows should be launched.
 
Fields inherited from class verinec.importer.analysis.AAnalyserStartOperation
analyser
 
Constructor Summary
StartScan(HostCommRenderer host)
          Implement operation to launch a portscan against one host.
StartScan(StartScan.ConfigPanel conf, AnalysisThread analysis, Collection hosts)
          Implement operation to launch portscan threads for the found hosts.
 
Method Summary
static int determineOS()
          Determine the host os id.
 HostCommRenderer getNextHost()
          Get a host to scan.
 void scan()
          This method will create a HostScanThread for each host to scan and wait for them to finish.
 void updateState()
          Update the acutal state of progress.
 
Methods inherited from class verinec.importer.analysis.AAnalyserStartOperation
abortOperation, getThread, joinThreads, printMessage, setThread, startThreads
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WINDOWS

public static final int WINDOWS
Nmap for windows should be launched.

See Also:
Constant Field Values

LINUX

public static final int LINUX
Nmap for linux should be launched.

See Also:
Constant Field Values

logger

private Logger logger

SYNCHRONOUS_HOST_SCAN

public static final int SYNCHRONOUS_HOST_SCAN
Constant to determine the number of parallel scans.

See Also:
Constant Field Values

configuration

private StartScan.ConfigPanel configuration
The configurations panel


scanIterGetElement

private Iterator scanIterGetElement
The iterator to get the host for the scanns

Constructor Detail

StartScan

public StartScan(StartScan.ConfigPanel conf,
                 AnalysisThread analysis,
                 Collection hosts)
          throws VerinecException
Implement operation to launch portscan threads for the found hosts. Filters which hosts to really scan on the configuration settings.

Parameters:
conf - The configuration dialog with the settings.
analysis - The main application object.
hosts - A list of all found hosts.
Throws:
VerinecException - If VerinecStudio can not be found.

StartScan

public StartScan(HostCommRenderer host)
          throws VerinecException
Implement operation to launch a portscan against one host.

Parameters:
host - A list of all found hosts.
Throws:
VerinecException - If VerinecStudio can not be found.
Method Detail

scan

public void scan()
This method will create a HostScanThread for each host to scan and wait for them to finish. The results are added to the HostCommRenderer class. To configure which hosts to scan, activate the option to scan the found hosts in the ConfigPanel.


updateState

public void updateState()
Update the acutal state of progress. This method is called, when a scan to a host completed


getNextHost

public HostCommRenderer getNextHost()
Get a host to scan. Only hosts matching the criteria to be scanned are returned. When the list is finished, returns null.

Returns:
a host which should be scanned or null if there are no more hosts.

determineOS

public static int determineOS()
Determine the host os id.

Returns:
One of the os constants in HostScanThread or -1 if unknown.

Copyright © 2005 Verinec, DIUF