NmapTest Class Reference
[Available modules]

Inheritance diagram for NmapTest:

TestModule TestConfigurationContainer

List of all members.


Detailed Description

TestEnv module NmapTest.

This module handles an instance of the port scanner nmap in a thread.

Therefore you can set some parameters:

Note: Some of of the functions of nmap require root privileges.

This module has been tested with Nmap 4.53.

Author:
Enrico Hartung <enrico@iptel.org>
Version:
0.1
License:
GPL

Requirements

Definition at line 150 of file NmapTest.py.


Public Member Functions

def initTestModule
 This function is expected to be overridden by the child class.
def run
 This method ist called after the start of the thread.

Private Attributes

 __nmapResult
 __command

Static Private Attributes

list _arguments = []
list __defaultArguments = ["--open", "-vv", "-d"]
string __command = "nmap"
int __retryTimer = 15
tuple __regexSplitter = re.compile("Interesting ports on ")
tuple __regexHostAddress = re.compile("^([a-zA-Z0-9\.\-]+)")
tuple __regexPort = re.compile("^([0-9]+)/([a-z]+)\s+([a-z]+)\s+([a-z0-9\-]+)", re.M)
tuple __regexPortRpc = re.compile("^([0-9]+)/([a-z]+)\s+([a-z]+)\s+([a-z0-9\-]+) \(([a-zA-Z0-9 \-]+)\)", re.M)
tuple __regexHost = re.compile("Host ([0-9a-z\.]+).*appears to be up.")
tuple __regexOs = re.compile("Running: (.+)")
list __nmapResult = []

Member Function Documentation

def initTestModule (   self  ) 

This function is expected to be overridden by the child class.

Reimplemented from TestModule.

Definition at line 179 of file NmapTest.py.

def run (   self  ) 

This method ist called after the start of the thread.

It runs nmap with the parameters set in the constructor. The nmap result [<process name>="">, <result code>="">, <timed out="" or="" not>="">] is written into the result list of the test case. If an error occurs (timed out or nmap returns error code) a log file including the output of the process is written into the working directory. The name of this log file has follwing structure: <test case="" description>="">_<process name>_<unix time stamp>.log

Reimplemented from TestModule.

Definition at line 193 of file NmapTest.py.


Member Data Documentation

list _arguments = [] [static, private]

Definition at line 153 of file NmapTest.py.

list __defaultArguments = ["--open", "-vv", "-d"] [static, private]

Definition at line 156 of file NmapTest.py.

string __command = "nmap" [static, private]

Definition at line 159 of file NmapTest.py.

int __retryTimer = 15 [static, private]

Definition at line 162 of file NmapTest.py.

tuple __regexSplitter = re.compile("Interesting ports on ") [static, private]

Definition at line 165 of file NmapTest.py.

tuple __regexHostAddress = re.compile("^([a-zA-Z0-9\.\-]+)") [static, private]

Definition at line 167 of file NmapTest.py.

tuple __regexPort = re.compile("^([0-9]+)/([a-z]+)\s+([a-z]+)\s+([a-z0-9\-]+)", re.M) [static, private]

Definition at line 169 of file NmapTest.py.

tuple __regexPortRpc = re.compile("^([0-9]+)/([a-z]+)\s+([a-z]+)\s+([a-z0-9\-]+) \(([a-zA-Z0-9 \-]+)\)", re.M) [static, private]

Definition at line 171 of file NmapTest.py.

tuple __regexHost = re.compile("Host ([0-9a-z\.]+).*appears to be up.") [static, private]

Definition at line 173 of file NmapTest.py.

tuple __regexOs = re.compile("Running: (.+)") [static, private]

Definition at line 175 of file NmapTest.py.

list __nmapResult = [] [static, private]

Definition at line 177 of file NmapTest.py.

__nmapResult [private]

Definition at line 180 of file NmapTest.py.

__command [private]

Definition at line 196 of file NmapTest.py.


The documentation for this class was generated from the following file:

Generated on Mon Aug 11 17:28:34 2008 for TestEnv by  doxygen 1.5.5