The Pentesting Guide
TwitterBlog
  • The Pentesting Guide
  • ℹ️0 - Pre-Engagement
  • 🔍1 - Information Gathering
  • Passive (OSINT)
  • Active
    • 🕵️HUMINT
    • WIFI
    • IP & Port Scanning
    • Services
      • 21 - FTP
      • 22 - SSH
      • 25 - SMTP
      • 53 - DNS
      • 80,443 - WEB
      • 88 - Kerberos
      • 110 - POP3
      • 111 - rpcbind
      • 161 - SNMP
      • 389 - LDAP
      • 139,445 - SMB
      • Active Directory
  • 💣2 - Exploitation
  • Brute Forcing
  • WEB
    • Apache Tomcat
    • Authentication
    • Broken Access Control
    • Cache poisoning
    • Clickjacking
    • CORS
    • CSRF
    • File Inclusion
    • Host Header Injection
    • HTTP Request Smuggling
    • Information disclosure
    • JWT
    • OS command injection
    • PHP deserialisation
    • SQLi
    • SSRF
    • SSTI
    • Shellshock
    • Unrestricted File Upload
    • XSS
    • XXE
  • Web (OWASP Test cases)
    • 4.1 Information Gathering
    • 4.2 Configuration and Deployment Management Testing
    • 4.3 Identity Management Testing
    • 4.4 Authentication Testing
    • 4.5 Authorization Testing
    • 4.6 Session Management Testing
    • 4.7 Input Validation Testing
    • 4.8 Testing for Error Handling
    • 4.9 Testing for Weak Cryptography
    • 4.10 Business Logic Testing
    • 4.11 Client-side Testing
    • 4.12 API Testing
  • WIFI
  • HUMINT
    • 🎣Gophish (Phishing)
    • Malicious Phishing Files
    • Phishing Evaluation
  • BoF - Windows(x86)
  • Active Directory
    • Kerberos
    • GPOs
    • Certificates
    • LAPS
    • Domain Trusts
  • 👿3 - Post Exploitation
  • File transfer
  • Shells
  • Situational Awareness
    • Containers and VMs
    • Linux
    • Windows
      • Dumping Credentials
      • Countermeasure Evasion
    • Active Directory
      • BloodHound & SharpHound
  • General
    • Linux
    • Windows
  • Local Privilege Escalation
    • Linux
    • Windows
  • Persistance
    • Windows
  • Cracking
  • Pivoting
    • Tunnelling & Port Forwarding
  • Lateral Movement
  • WIFI
  • 📓4 - Report
  • 🧹5 - House cleaning
Powered by GitBook
On this page
  • Introduction
  • Enumeration
  • References
  1. Active
  2. Services

53 - DNS

Introduction

Port: 53 (TCP/UDP) There are two main reasons why Domain Name System (DNS) enumeration is essential. First, enumerating the number of domains and sub-domains can reveal how large or small the organisation is. Secondly, virtual routing may be enabled in the company's web server, responding to different web pages depending on the accessed domain.

Enumeration

There will typically be a dedicated DNS server inside an enterprise environment. In order to identify it, search for TCP or UDP port 53 on the network hosts.

nmap -n -sT -p53 <NETWORK>/<MASK>
nmap -n -sU -p53 <NETWORK>/<MASK>

Then, you can use the following commands to retrieve domains and subdomains based on IPs.

dig -x <IP> @<DNS_SERVER_IP>       # Reverse lookup
dig ANY @<DNS_SERVER_IP> <DOMAIN>  # Any information
dig axfr @<DNS_SERVER_IP> <DOMAIN> # zone transfer 
# Subdomain brute forcing
gobuster dns -d <DOMAIN> [ -r <DNS_SERVER_IP>] -w <WORDLIST.TXT>  [ -t <NUMBER_THREADS>] 
dnsrecon -t brt -d <DOMAIN> [-n <DNS_SERVER_IP>] -D <WORDLIST.txt> [ --threads <NUMBER_THREADS>]

If you want to obtain domains but you do not have an internal DNS server, you can use the tools on the OSINT section or the following commands.

dnsrecon -n 8.8.8.8 -d <DOMAIN>
dnsrecon -d <IP> -t zonewalk
dnsrecon -d <DOMAIN> -t axfr # Zone transfer
dnsrecon -r <IP>             # Reverse lookup

References

Last updated 2 years ago

Back to Basics: DNS Enumeration
Pentesting DNS
DNS Reconnaissance – DNSRecon