Skip to content

Commit 1970bb4

Browse files
authored
Merge pull request #2 from cr8ivecodesmith/master
Temporary fix on pip install issue and added service banners in the scan result
2 parents b8e3f84 + 3879379 commit 1970bb4

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

masscan/masscan.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@
4343
url='https://github.com/MyKings/python-masscan',
4444
bugtrack_url='https://github.com/MyKings/python-masscan',
4545
description='This is a python class to use masscan and access scan results from python2',
46-
long_description=open('README.md').read() + "\n" + open('CHANGELOG.md').read(),
46+
# long_description=open('README.md').read() + "\n" + open('CHANGELOG.md').read(),
4747
)

0 commit comments

Comments
 (0)