Skip to content

Commit 46b3463

Browse files
authored
Merge pull request #78 from dupouyleo/patch-1
Correct CPE retrieval from XML
2 parents 3c2246b + 1857cac commit 46b3463

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nmap3/nmapparser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ def parse_ports(self, xml_hosts):
173173

174174
if(port.find('service') is not None):
175175
open_ports["service"]=port.find("service").attrib
176-
176+
cpe_list = []
177177
for cp in port.find("service").findall("cpe"):
178-
cpe_list = []
178+
179179
cpe_list.append({"cpe": cp.text})
180-
open_ports["cpe"] = cpe_list
180+
open_ports["cpe"] = cpe_list
181181

182182
# Script
183183
open_ports["scripts"]=self.parse_scripts(port.findall('script')) if port.findall('script') is not None else []

0 commit comments

Comments
 (0)