MCPcopy
hub / github.com/eldraco/domain_analyzer / dns_request

Function dns_request

domain_analyzer.py:627–954  ·  view source on GitHub ↗

This function takes the domain and ask for several related dns information

(domain)

Source from the content-addressed store, hash-verified

625
626
627def dns_request(domain):
628 """
629 This function takes the domain and ask for several related dns information
630 """
631 global debug
632 global domain_data
633 global check_common_hosts_names
634 global use_common_list
635 global common_list_path
636 global zone_transfer
637 global net_block
638 global output_file
639 global output_directory
640 global not_store_nmap
641 global subdomains_found
642 global not_subdomains
643 global common_hostnames
644 global output_file_handler
645 global countrys
646
647 try:
648 hosttype={}
649 reverseDNS={}
650 hostname={}
651 ip_registry=[]
652
653
654 if check_common_hosts_names==False:
655 common_hostnames=[]
656
657
658 elif use_common_list == True:
659 common_hostnames=[]
660 external_dns_file_name = os.path.join(os.getcwd(), common_list_path)
661 ins = open ( external_dns_file_name , "r" )
662 for line in ins:
663 common_hostnames.append( line.rstrip() )
664 else:
665 common_hostnames=['www','ftp','vnc','fw','mail' ,'dba' ,'db' ,'mssql' ,'sql' ,'ib','secure','oracle' ,'ora' ,'oraweb' ,'sybase' ,'gw' ,'log' ,'logs' ,'logserver' ,'backup' ,'windows' ,'win' ,'nt' ,'ntserver' ,'win2k' ,'mswin' ,'msnt' ,'posnt' ,'server' ,'test' ,'firewall' ,'cp' ,'cpfw1' ,'cpfw1ng' ,'fw' ,'fw1' ,'raptor' ,'drag' ,'dragon' ,'pix' ,'ciscopix' ,'nameserver' ,'dns' ,'ns' ,'ns1' ,'ns2' ,'mx' ,'webmail' ,'mailhost' ,'smtp' ,'owa' ,'pop' ,'notes' ,'proxy' ,'squid' ,'imap' ,'www1' ,'www2' ,'www3' ,'corp' ,'corpmail' ,'print' ,'printer' ,'search' ,'telnet' ,'tftp' ,'web' ,'bgp' ,'citrix' ,'pcanywhere' ,'ts' ,'terminalserver' ,'tserv' ,'tserver' ,'keyserver' ,'pgp' ,'samba' ,'linux' ,'redhat' ,'caldera' ,'openlinux' ,'conectiva' ,'corel' ,'corelinux' ,'debian' ,'mandrake' ,'linuxppc' ,'bastille' ,'stampede' ,'suse' ,'trinux' ,'trustix' ,'turbolinux' ,'turbo' ,'tux' ,'slack' ,'slackware' ,'bsd' ,'daemon' ,'darby' ,'beasty' ,'beastie' ,'openbsd' ,'netbsd' ,'freebsd' ,'obsd' ,'fbsd' ,'nbsd' ,'solaris' ,'sun' ,'sun1' ,'sun2' ,'sun3' ,'aix' ,'tru64' ,'hp-ux' ,'hp' ,'lynx' ,'lynxos' ,'macosx' ,'osx' ,'minix' ,'next' ,'nextstep' ,'qnx' ,'rt' ,'sco' ,'xenix' ,'sunos' ,'ultrix' ,'unixware' ,'multics' ,'zeus' ,'apollo' ,'hercules' ,'venus' ,'pendragon' ,'guinnevere' ,'lancellot' ,'percival' ,'prometheus' ,'ssh' ,'time' ,'nicname' ,'tacacs' ,'domain' ,'whois' ,'bootps' ,'bootpc' ,'gopher' ,'http' ,'kerberos' ,'hostname' ,'pop2' ,'pop3' ,'nntp' ,'ntp' ,'irc' ,'imap3' ,'ldap' ,'https' ,'nntps' ,'ldaps' ,'webster' ,'imaps' ,'ircs' ,'pop3s' ,'login' ,'router' ,'netnews' ,'ica' ,'radius' ,'hsrp' ,'mysql' ,'amanda' ,'pgpkeyserver' ,'quake' ,'kerberos_master' ,'passwd_server' ,'smtps' ,'swat' ,'support' ,'afbackup' ,'postgres' ,'fax' ,'hylafax' ,'tircproxy' ,'webcache' ,'tproxy' ,'jetdirect' ,'kamanda' ,'fido','old']
666
667
668 #
669 # Here we obtain the NS servers for the domain
670 #
671 get_NS_records(domain)
672
673 #
674 # Here we obtain the MX servers for the domain
675 #
676 get_MX_records(domain)
677
678
679 #
680 # Here we check if wildcard is activated
681 #
682 try:
683 wildcard_detect = dns.resolver.resolve('asdf80a98vrnwe9ufrcsajd90awe8ridsjkd.'+domain, 'A')
684 logging.warning('\t\tWARNING!! This domain has wildcards activated for hostnames resolution. We are checking "www" anyway, but perhaps it doesn\'t exists!')

Callers 1

analyze_domainFunction · 0.85

Calls 8

get_NS_recordsFunction · 0.85
get_MX_recordsFunction · 0.85
check_SPF_recordFunction · 0.85
check_A_recordsFunction · 0.85
check_PTR_recordFunction · 0.85
formatMethod · 0.80
printoutFunction · 0.70
lookupMethod · 0.45

Tested by

no test coverage detected