class documentation

class NmapService(object): (source)

View In Hierarchy

NmapService represents a nmap scanned service. Its id() is comprised of the protocol and the port. Depending on the scanning options, some additional details might be available or not. Like banner or extra datas from NSE (nmap scripts).

Method __eq__ Compares two NmapService objects to see if they are the same or if one of them changed.
Method __hash__ Undocumented
Method __init__ Constructor
Method __ne__ Compares two NmapService objects to see if they are different if one of them changed.
Method __repr__ Undocumented
Method changed Checks if a NmapService is different from another.
Method diff Calls NmapDiff to check the difference between self and another NmapService object.
Method get_dict Return a python dict representation of the NmapService object.
Method open Tells if the port was open or not
Property banner Accessor for the service's banner. Only available if the nmap option -sV or similar was used.
Property banner_dict Accessor for the service's banner. Only available if the nmap option -sV or similar was used.
Property cpelist Accessor for list of CPE for this particular service
Property id Accessor for the id() of the NmapService.
Property owner Accessor for service owner if available
Property port Accessor for port.
Property protocol Accessor for protocol
Property reason Accessor for service's state reason (syn-ack, filtered,...)
Property reason_ip Accessor for service's state reason ip
Property reason_ttl Accessor for service's state reason ttl
Property scripts_results Gives a python list of the nse scripts results.
Property service Accessor for service name.
Property service_dict Accessor for service dictionary.
Property servicefp Accessor for the service's fingerprint if the nmap option -sV or -A is used
Property state Accessor for service's state (open, filtered, closed,...)
Property tunnel Accessor for the service's tunnel type if applicable and available from scan results
Instance Variable _cpelist Undocumented
Instance Variable _owner Undocumented
Instance Variable _portid Undocumented
Instance Variable _protocol Undocumented
Instance Variable _reason Undocumented
Instance Variable _reason_ip Undocumented
Instance Variable _reason_ttl Undocumented
Instance Variable _service Undocumented
Instance Variable _service_extras Undocumented
Instance Variable _servicefp Undocumented
Instance Variable _state Undocumented
Instance Variable _tunnel Undocumented
def __eq__(self, other): (source)

Compares two NmapService objects to see if they are the same or if one of them changed. :param other: NmapService :return: boolean

def __hash__(self): (source)

Undocumented

def __init__(self, portid, protocol='tcp', state=None, service=None, owner=None, service_extras=None): (source)

Constructor :param portid: port number :type portid: string :param protocol: protocol of port scanned (tcp, udp) :type protocol: string :param state: python dict describing the service status :type state: python dict :param service: python dict describing the service name and banner :type service: python dict :param service_extras: additional info about the tested service like scripts' data

def __ne__(self, other): (source)

Compares two NmapService objects to see if they are different if one of them changed. :param other: NmapService :return: boolean

def __repr__(self): (source)

Undocumented

def changed(self, other): (source)

Checks if a NmapService is different from another. :param other: NmapService :return: boolean

def diff(self, other): (source)

Calls NmapDiff to check the difference between self and another NmapService object. Will return a NmapDiff object. This objects return python set() of keys describing the elements which have changed, were added, removed or kept unchanged. :return: NmapDiff object

def get_dict(self): (source)

Return a python dict representation of the NmapService object. This is used to diff() NmapService objects via NmapDiff. :return: dict

def open(self): (source)

Tells if the port was open or not :return: boolean

Accessor for the service's banner. Only available if the nmap option -sV or similar was used. :return: string

@property
banner_dict = (source)

Accessor for the service's banner. Only available if the nmap option -sV or similar was used. :return: dictionary

Accessor for list of CPE for this particular service

Accessor for the id() of the NmapService. This is used for diff()ing NmapService object via NmapDiff. :return: tuple

Accessor for service owner if available

Accessor for port. :return: integer or -1

Accessor for protocol :return: string

Accessor for service's state reason (syn-ack, filtered,...) :return: string or empty if not applicable

Accessor for service's state reason ip :return: string or empty if not applicable

Accessor for service's state reason ttl :return: string or empty if not applicable

@property
scripts_results = (source)

Gives a python list of the nse scripts results. The dict key is the name (id) of the nse script and the value is the output of the script. :return: dict

Accessor for service name. :return: string or empty

@property
service_dict = (source)

Accessor for service dictionary. :return: dict or None

Accessor for the service's fingerprint if the nmap option -sV or -A is used :return: string if available

Accessor for service's state (open, filtered, closed,...) :return: string

Accessor for the service's tunnel type if applicable and available from scan results :return: string if available

_cpelist: list = (source)

Undocumented

Undocumented

Undocumented

_protocol = (source)

Undocumented

Undocumented

_reason_ip = (source)

Undocumented

_reason_ttl = (source)

Undocumented

_service = (source)

Undocumented

_service_extras = (source)

Undocumented

_servicefp = (source)

Undocumented

Undocumented

Undocumented