mirror of
https://github.com/lgandx/Responder.git
synced 2025-08-14 02:27:12 -07:00
Don't answer DNS queries from localhost.
This commit is contained in:
parent
2ae4ed011f
commit
12eb95c491
1 changed files with 9 additions and 3 deletions
12
Responder.py
12
Responder.py
|
@ -948,7 +948,9 @@ class DNS(BaseRequestHandler):
|
|||
def handle(self):
|
||||
req, soc = self.request
|
||||
data = req
|
||||
if ParseDNSType(data):
|
||||
if self.client_address[0] == "127.0.0.1":
|
||||
pass
|
||||
elif ParseDNSType(data):
|
||||
buff = DNSAns()
|
||||
buff.calculate(data)
|
||||
soc.sendto(str(buff), self.client_address)
|
||||
|
@ -960,10 +962,14 @@ class DNSTCP(BaseRequestHandler):
|
|||
def handle(self):
|
||||
try:
|
||||
data = self.request.recv(1024)
|
||||
if ParseDNSType(data):
|
||||
if self.client_address[0] == "127.0.0.1":
|
||||
pass
|
||||
elif ParseDNSType(data):
|
||||
buff = DNSAns()
|
||||
buff.calculate(data)
|
||||
self.request.send(buff)
|
||||
self.request.send(str(buff))
|
||||
print "DNS Answer sent to: %s "%(self.client_address[0])
|
||||
logging.warning('DNS Answer sent to: %s'%(self.client_address[0]))
|
||||
|
||||
except Exception:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue