Changeset 834

Show
Ignore:
Timestamp:
06/18/07 21:43:33 (6 years ago)
Author:
ignotus21
Message:

Changes in NmapParser?.py

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branch/joao/umitCore/NmapParser.py

    r449 r834  
    362362                return host.comment 
    363363        else: 
    364             raise Exception("Comment could not be saved! Host not found at NmapParser!") 
     364            raise Exception("Comment could not be loaded! Host not found at NmapParser!") 
    365365 
    366366    def get_profile(self): 
     
    862862    def _parse_host_ipidsequence(self, attrs): 
    863863        self.host_info.set_ipidsequence(self._parsing(attrs, ['class', 'values'])) 
     864 
     865    # NOTE: Added by ignotus 
     866    def _parse_host_trace(self, attrs): 
     867        self.host_info.set_trace(self._parsing(attrs, ['port', 'proto'])) 
     868 
     869    # NOTE: Added by ignotus 
     870    def _parse_host_trace_hop(self, attrs): 
     871        self.list_hop.append(self._parsing(attrs, ['ttl', 'rtt', 'ipaddr', 'host'])) 
    864872 
    865873    def startElement(self, name, attrs): 
     
    923931            self._parse_host_ipidsequence(attrs) 
    924932 
     933        # Creating a traceroute condition 
     934        # NOTE: Added by ignotus 
     935        elif self.in_host and name == "trace": 
     936            self.in_trace = True 
     937            self.list_hop = [] 
     938            self._parse_host_trace(attrs) 
     939 
     940        elif self.in_trace and name == "hop": 
     941            self._parse_host_trace_hop(attrs) 
     942 
    925943 
    926944    def endElement(self, name): 
     
    949967            del(self.list_portused) 
    950968            del(self.list_osclass) 
     969 
     970        # Creating a traceroute condition 
     971        # NOTE: Added by ignotus 
     972        elif self.in_host and name == "trace": 
     973            self.in_trace = False 
     974            self.host_info.set_hops(self.list_hop) 
     975 
     976            del(self.list_hop) 
     977 
    951978 
    952979    def write_xml(self, xml_file):