Sun, 13 Oct 2013

Brute Forcing DNS with python .:.permalink.:.

Often DNS is helpful in telling you what's out there without scanning. No one allows DNS zone transfers anymore so simply brute-force resolving dns is a quick workaround.

Here's a simple python script to resolve a range of IP addresses to their hostname (if available):

import sys
import netaddr
import socket

for ip in list(net):
        if hostname:
            print("%s %s"%(ip,hostname))

I call it and use it thusly: somehostname1 someotherhostname2

Since it used the netaddr module it can accept cidr masks or individual IPs.

Posted at: Sun, 13 Oct 2013 | category: /itsec