mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-07-30 11:48:27 -07:00
Fixed bug in DNS resolving logic
This commit is contained in:
parent
cd9a16de55
commit
c85fd2b5f3
3 changed files with 98 additions and 61 deletions
|
@ -1232,6 +1232,7 @@ class LLMNR(BaseRequestHandler):
|
|||
if RespondToIPScope(RespondTo, self.client_address[0]):
|
||||
if RespondToSpecificName(RespondToName) == False:
|
||||
buff = LLMNRAns(Tid=data[0:2],QuestionName=Name, AnswerName=Name)
|
||||
DnsCache.getInstance().setCustomRes(Name.lower())
|
||||
buff.calculate()
|
||||
for x in range(1):
|
||||
soc.sendto(str(buff), self.client_address)
|
||||
|
@ -1253,6 +1254,7 @@ class LLMNR(BaseRequestHandler):
|
|||
|
||||
if RespondToSpecificName(RespondToName) and RespondToNameScope(RespondToName.upper(), Name.upper()):
|
||||
buff = LLMNRAns(Tid=data[0:2],QuestionName=Name, AnswerName=Name)
|
||||
DnsCache.getInstance().setCustomRes(Name.lower())
|
||||
buff.calculate()
|
||||
for x in range(1):
|
||||
soc.sendto(str(buff), self.client_address)
|
||||
|
@ -1275,6 +1277,7 @@ class LLMNR(BaseRequestHandler):
|
|||
if Analyze(AnalyzeMode) == False and RespondToSpecificHost(RespondTo) == False:
|
||||
if RespondToSpecificName(RespondToName) and RespondToNameScope(RespondToName.upper(), Name.upper()):
|
||||
buff = LLMNRAns(Tid=data[0:2],QuestionName=Name, AnswerName=Name)
|
||||
DnsCache.getInstance().setCustomRes(Name.lower())
|
||||
buff.calculate()
|
||||
Message = "LLMNR poisoned answer sent to this IP: %s. The requested name was : %s."%(self.client_address[0],Name)
|
||||
for x in range(1):
|
||||
|
@ -1294,6 +1297,7 @@ class LLMNR(BaseRequestHandler):
|
|||
pass
|
||||
if RespondToSpecificName(RespondToName) == False:
|
||||
buff = LLMNRAns(Tid=data[0:2],QuestionName=Name, AnswerName=Name)
|
||||
DnsCache.getInstance().setCustomRes(Name.lower())
|
||||
buff.calculate()
|
||||
Message = "LLMNR poisoned answer sent to this IP: %s. The requested name was : %s."%(self.client_address[0],Name)
|
||||
for x in range(1):
|
||||
|
|
|
@ -223,13 +223,13 @@ class ClientRequest(Request):
|
|||
real = self.urlMonitor.real
|
||||
|
||||
if 'wwww' in host:
|
||||
logging.debug("Resolving %s for HSTS bypass" % (host))
|
||||
logging.debug("Resolving %s for HSTS bypass (Twisted)" % (host))
|
||||
host = host[1:]
|
||||
elif 'web' in host:
|
||||
logging.debug("Resolving %s for HSTS bypass" % (host))
|
||||
logging.debug("Resolving %s for HSTS bypass (Twisted)" % (host))
|
||||
host = host[3:]
|
||||
elif host in real:
|
||||
logging.debug("Resolving %s for HSTS bypass" % (host))
|
||||
logging.debug("Resolving %s for HSTS bypass (Twisted)" % (host))
|
||||
host = real[host]
|
||||
|
||||
hostparts = host.split(':')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue