@@ -349,6 +349,7 @@ def analyse_masscan_xml_scan(self, masscan_xml_output=None, masscan_err='', mass
349349 <host endtime="1490242775"><address addr="10.0.9.6" addrtype="ipv4"/><ports><port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/></port></ports></host>
350350 <host endtime="1490242775"><address addr="10.0.9.12" addrtype="ipv4"/><ports><port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/></port></ports></host>
351351 <host endtime="1490242776"><address addr="10.0.9.28" addrtype="ipv4"/><ports><port protocol="tcp" portid="80"><state state="open" reason="syn-ack" reason_ttl="64"/></port></ports></host>
352+ <host endtime="1498802982"><address addr="10.0.9.29" addrtype="ipv4"/><ports><port protocol="tcp" portid="80"><state state="open" reason="response" reason_ttl="48"/><service name="title" banner="401 - Unauthorized"></service></port></ports></host>
352353 <runstats>
353354 <finished time="1490242786" timestr="2017-03-23 12:19:46" elapsed="13" />
354355 <hosts up="10" down="0" total="10" />
@@ -414,16 +415,24 @@ def analyse_masscan_xml_scan(self, masscan_xml_output=None, masscan_err='', mass
414415 state = dport .find ('state' ).get ('state' )
415416 reason = dport .find ('state' ).get ('reason' )
416417 reason_ttl = dport .find ('state' ).get ('reason_ttl' )
418+ services = []
417419
418420 if not proto in list (scan_result ['scan' ][host ].keys ()):
419421 scan_result ['scan' ][host ][proto ] = {}
420422
421423 scan_result ['scan' ][host ][proto ][port ] = {
422424 'state' : state ,
423425 'reason' : reason ,
424- 'reason_ttl' : reason_ttl
426+ 'reason_ttl' : reason_ttl ,
425427 }
426428
429+ for service in dhost .findall ('ports/port/service' ):
430+ services .append ({
431+ 'name' : service .get ('name' ),
432+ 'banner' : service .get ('banner' ),
433+ })
434+ scan_result ['scan' ][host ][proto ][port ]['services' ] = services
435+
427436 self ._scan_result = scan_result
428437 return scan_result
429438
0 commit comments