Skip to content

Commit 9ac2885

Browse files
committed
fixed serialization issue
1 parent d7b57a9 commit 9ac2885

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

libnmap/parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ def parse_fromdict(cls, rdict):
225225
slist.append(NmapService(portid=s[cname]['_portid'],
226226
protocol=s[cname]['_protocol'],
227227
state=s[cname]['_state'],
228+
owner=s[cname]['_owner'],
228229
service=s[cname]['_service']))
229230

230231
nh = NmapHost(starttime=h['__NmapHost__']['_starttime'],

libnmap/reportjson.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
#!/usr/bin/env python
22
import json
33
from libnmap.objects import NmapHost, NmapService, NmapReport
4+
from libnmap.objects.os import *
45
from libnmap.parser import NmapParser
56

67

78
class ReportEncoder(json.JSONEncoder):
89
def default(self, obj):
910
otype = {'NmapHost': NmapHost,
10-
'NmapOSFingerprint': NmapHost.NmapOSFingerprint,
11+
'NmapOSFingerprint': NmapOSFingerprint,
12+
'NmapOSMatch': NmapOSMatch,
13+
'NmapOSClass': NmapOSClass,
14+
'CPE': CPE,
15+
'OSFPPortUsed': OSFPPortUsed,
1116
'NmapService': NmapService,
1217
'NmapReport': NmapReport}
1318
if isinstance(obj, tuple(otype.values())):

0 commit comments

Comments
 (0)