Update dns.py

Added Zone Transfer plugin for DNS.
This commit is contained in:
Tib3rius 2021-08-18 15:36:16 -04:00
parent 31b306d8ab
commit a2d90e423d
1 changed files with 17 additions and 0 deletions

View File

@ -12,3 +12,20 @@ class DNS(ServiceScan):
async def run(self, service):
await service.execute('nmap {nmap_extra} -sV -p {port} --script="banner,(dns* or ssl*) and not (brute or broadcast or dos or external or fuzzer)" -oN "{scandir}/{protocol}_{port}_dns_nmap.txt" -oX "{scandir}/xml/{protocol}_{port}_dns_nmap.xml" {address}')
class ZoneTransfer(ServiceScan):
def __init__(self):
super().__init__()
self.name = "Zone Transfer"
self.tags = ['default', 'dns']
def configure(self):
self.match_service_name('^domain')
self.add_option('domain', help='The domain name to perform a zone transfer on.')
async def run(self, service):
if self.get_option('domain') is None:
await service.execute('dig AXFR -p {port} @{address}', outfile='{protocol}_{port}_dns_zone-transfer.txt')
else:
await service.execute('dig AXFR ' + self.get_option('domain') + ' -p {port} @{address}', outfile='{protocol}_{port}_dns_zone-transfer.txt')