Passion
  • What is this GitBook about ?
  • Privilege Escalation
    • Linux
    • Windows
  • Network Security
    • Port Scanning
    • DNS Enumeration
    • FTP Enumeration
    • SSH Enumeration
    • SMB Enumeration
    • SMTP Enumeration
    • POP3 Enumeration
  • Checklists
    • Active Directory Security
    • OS Command Injection
    • Buffer Overflow
    • Broken Access Control
    • Local File Inclusion
    • SSRF
    • XXE Attacks
    • SQL Injection
    • XSS
  • WebApp Security
    • Local File Inclusion
    • File Upload Attacks
      • IIS Server File Upload
      • Escaping Sandbox via File Upload
    • Broken Access Control
      • Vertical PrivEsc
      • Horizontal PrivEsc
      • Horizontal => Vertical
    • OS Command Injection
    • SSTI
      • Finding the Injection Point
      • Indentification
      • Exploitation
    • XXE Attacks
      • XXE to LFI
      • XXE to SSRF
      • XXE via File upload
      • XInclude Attacks
      • Blind XXE Attacks
        • Identification
        • Exploitation
        • Blind XXE to LFI
        • Blind XXE by defining Local DTD
    • SQL Injection
    • Server Side Request Forgery
      • Various Attack Methods
      • Exploiting Blind SSRF
    • OAuth Attacks
      • In Password-Based Logins
    • XSS
      • Reflected XSS
      • Stored XSS
      • DOM XSS
      • Blind XSS
      • Perfecting our Payload
      • Exploiting Blind XSS
  • WebApp Mitigations
    • SSTI
  • Docker Security
    • Configuration
    • Ngnix Deployment
  • ☁️Cloud Security
    • AWS
      • Cloud Breach S3
      • IAM PrivEsc - RollBack
      • IAM PrivEsc - Attachment
Powered by GitBook
On this page
  • Enumerating DNS Records ?
  • Zone Transfer ?
  1. Network Security

DNS Enumeration

The goal is to gather more detailed information on both devices and resources attached to the network. This includes account names, misconfigured services and so on !

Enumerating DNS Records ?

host -t ns <domain name>    // Enumerates name servers.
host -t mx <domain name>    // Enumerates mail servers.

nslookup -type=ns <domain name>    
nslookup -type=mx <domain name>
nslookup -type=any <domain name>    // Enumerates anything possible.

If suppose, we have a list of domains. Use this Bash command in the terminal.

for ip in $<cat list.txt>; do host $<domain>; done

Zone Transfer ?

DNS Zone Transfer is the process where a DNS server passes a copy of part of its Database to another DNS Server.

Okay so in Simple Words !

There is a Master DNS Zone Server and there could be one or more slave DNS Servers, The Slave Servers asks the Master Server for a copy of that records for that zone.

If the DNS Server is misconfigured, the Attacker pretends to be the slave and ask the master to send the copy of the DNS records.

Then he gets all the list of domains registered for the particular zone, Then the Attacker gathers all the information about all domains and try to attack the domain, if its vulnerable. So its necessary to check whether the zone transfer is enabled in the name servers.

host -l <domain name> <@nameserver>
                                      // Checks for Zone transfers.                                                                                                                                                                              
dig axfr <domain name> <@name server>

Some Automating in-built tools in Kali

dnsenum <domain name>

dnsrecon -d <domain name>

fierce -dns <domain name>

While pentesting a box or an application, we get to see port 53 is open. The first thing that should strike us is :

Add host to /etc/hosts

nslookup 
> server 10.10.10.7
> 10.10.10.7
. . . .     ns1.cronos.htb

dig axfr cronos.htb @10.10.10.7
. . . . . 
admin.cronos.htb
ns1.cronos.htb
cronos.htb

dig the subdomains using ffuf or sublist3r, get new subdomains and dig again.
(Don't forget to add the newly found subdomains in your /etc/hosts file).
PreviousPort ScanningNextFTP Enumeration

Last updated 1 year ago