forked from punk-security/dnsReaper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
finding.py
31 lines (28 loc) · 884 Bytes
/
finding.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from os import linesep
class Finding(object):
def __init__(
self,
domain,
signature,
info,
confidence,
):
self.domain = domain.domain
self.signature = signature
self.info = info.replace("\n", " ").replace("\r", "").rstrip()
self.confidence = confidence.name
self.a_records = domain.A
self.aaaa_records = domain.AAAA
self.cname_records = domain.CNAME
self.ns_records = domain.NS
def populated_records(self):
resp = ""
if self.a_records:
resp += f"A: {self.a_records},"
if self.aaaa_records:
resp += f"AAAA: {self.aaaa_records},"
if self.cname_records:
resp += f"CNAME: {self.cname_records},"
if self.ns_records:
resp += f"NS: {self.ns_records},"
return resp.rstrip(",")