Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/sslstrip-work-2019/sslstrip/DnsCache.py
1306 views
1
2
class DnsCache:
3
4
'''
5
The DnsCache maintains a cache of DNS lookups, mirroring the browser experience.
6
'''
7
8
_instance = None
9
10
def __init__(self):
11
self.cache = {}
12
13
def cacheResolution(self, host, address):
14
self.cache[host] = address
15
16
def getCachedAddress(self, host):
17
if host in self.cache:
18
return self.cache[host]
19
20
return None
21
22
def getInstance():
23
if DnsCache._instance == None:
24
DnsCache._instance = DnsCache()
25
26
return DnsCache._instance
27
28
getInstance = staticmethod(getInstance)
29
30