|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
verinec.importer.analysis.AAnalyserTask
verinec.importer.analysis.scanner.HostScanWorker
public class HostScanWorker
This thread scans all the ports of a specified host using nmap. Nmap is told to dump scan result into a file in java.io.tmpdir The file is then parsed??? todo: test whether portscanning works correctly It requires the nmap executable in folder (from current working directory) bin/nmap/nmap.exe on windows resp. bin/nmap.bin for Linux on linux.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
(package private) HostCommRenderer |
hostRenderer
Host Identifier of the host to scan, container for results. |
private boolean |
interrupted
Whether the worker should stop. |
protected static String |
LOGFILE_PREFIX
Prefix for the log file name. |
protected Logger |
logger
For logging. |
protected static String |
NMAP_LINUX
nmap.bin |
protected static File |
NMAP_PATH
Path where nmap is installed. |
protected static String |
NMAP_WINDOWS
nmap.exe |
protected ProgramExec |
nmapCall
To execute nmap. |
protected int |
os
Operating system to use. |
protected static String |
PARAMETERS
The parameters for nmap |
protected StartScan |
startScan
The scanner to get hosts from. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
HostScanWorker(int os,
HostCommRenderer hr)
Prepare the worker for a single scan. |
|
HostScanWorker(StartScan scan,
int os)
Create the worker thread to scan hosts using nmap. |
|
| Method Summary | |
|---|---|
void |
abortOperation()
Abort scanning as soon as possible. |
void |
run()
Start to scan the ports of hosts. |
void |
scan(HostCommRenderer hostRenderer)
This method will parse the file created by nmap and fill the information into the hostRenderer. |
| Methods inherited from class verinec.importer.analysis.AAnalyserTask |
|---|
getStarter, printMessage, setStarter |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final File NMAP_PATH
protected static final String NMAP_WINDOWS
protected static final String NMAP_LINUX
protected static final String PARAMETERS
protected static final String LOGFILE_PREFIX
protected int os
protected ProgramExec nmapCall
protected Logger logger
protected StartScan startScan
HostCommRenderer hostRenderer
private boolean interrupted
| Constructor Detail |
|---|
public HostScanWorker(StartScan scan,
int os)
StartScan instance for hosts to scan.
As we use nmap to scan the host, the operating system family also needs to
be specified.
The results of the scan are added to the HostCommRenderers.
scan - The containing class to retreive host names to scan.os - Operating System, one of the constants defined in this class.
public HostScanWorker(int os,
HostCommRenderer hr)
os - Operating System, one of the constants defined in this class.hr - The information about the host to scan.| Method Detail |
|---|
public void run()
run in interface Runnablerun in class Thread
public void scan(HostCommRenderer hostRenderer)
throws VerinecException
hostRenderer - The container for information about the host.
VerinecException - if running nmap or interpreting the scan output failspublic void abortOperation()
abortOperation in class AAnalyserTask
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||