Hacknetics
  • Hacknetics
  • Active Directory Management
    • How to Join a Windows 11 PC to a Domain
    • Allow RDP in the domain
  • Active Directory AD Attacks
    • Bloodhound
      • Bloodhound Cypher Queries
    • Impacket-install
    • Kerberos cheatsheet
    • Domain Controllers
    • Overpass The Hash/Pass The Key (PTK)
    • Bloodhound Python
    • Rubeus to Ccache
    • Silver Ticket
    • Golden Ticket
    • Abusing GPO Permissions
    • AppLocker Bypasses
    • SharpView Enumeration
    • DonPapi
    • AD Overview
    • Enumerating Forests
    • NOPAC Priv esc
  • buffer-overflows
    • Buffer Overflows
  • c2-frameworks
    • Sliver
    • Powershell Empire
      • IronPython Empire
    • Metasploit
      • Metasploit Basics
      • Custom MSF Resource Scripts
      • Meterpreter Device Survey
      • Paranoid Mode
    • Pwncat-cs
    • Cobalt Strike
    • Dcrat
      • Modules
      • Builder
      • Dcrat AV Evasion
      • C2 Comms
    • FFM Documentation
  • covering-tracks
    • Evading Logging and Monitoring
    • Linux Logging
    • Tor
    • Windows Log Clearing
    • Ghost Writing Binaries
    • Backdoor Linux Commands
  • Data Exfiltration
  • Exploit Development
    • ROP Finding the vulnerable function
    • Useful Tools for Exploit Dev
    • ropeme
    • Obtaining MSFT Patches for Analysis
    • Mutiny Fuzzer
    • GDB
  • file-transfers
    • Transfering Files
  • lateral-movement
    • Pivoting Enumeration
      • Proxychains and FoxyProxy
      • SSH Tunneling and Port Forwarding
      • Plink.exe
      • socat
      • Chisel
      • SShuttle
  • lin-priv-esc
    • Linux Privilege Escalation
    • Bash Jails
    • ssh agent
  • Things I have Pwn'd before
    • Tomcat
    • Jenkins
  • persistence
    • Linux Persistence
    • Windows Persistence
      • Assign Group Memberships
      • Guest Windows Account Persistence
      • WMI Persist With Event Filters
      • SAM SYSTEM Exfil / Pass The Hash
      • Backdoor Executable
      • Special Privileges and Security Descriptors
      • RID Hijacking
      • Task Scheduler
      • Hijacking File Associations
      • Abusing Services
      • Logon Triggered Persistence
      • MSSQL Enabling xp cmdshell
      • Sticky Keys
      • Using Web Shells
  • recon-enumeration
    • Exploit Research
    • Pentesting DNS
    • Pentesting Kerberos
    • Pentesting FTP
    • Pentesting Email
    • Pentesting SMB
    • Pentesting Redis
    • Banner Grabbing
    • Pentesting Rsync
    • Pentesting MsSql
    • Scanning
    • Pentesting SNMP
    • Pentesting NFS
    • Pentesting LDAP
    • Pentesting Finger
    • User Recon
  • resources
    • resources
    • Youtube / Book List
    • CS/Software Engineer Resources
  • shells
    • Shells
    • web-shells
      • PHP Reverse Shell
      • wwwolf's PHP web shell
  • tool-guides
    • Asymmetric File Encrypt and Decrypt
    • Aws Buckets
    • cewl-crunch
    • Creating a Custom Wordlist
    • evil-winrm
    • Git
    • gobuster
    • Hashcat
    • Hydra User Guide
    • John
    • Linux Basics
    • Mimikatz
    • netcat
    • Nmap
    • nuclei
    • PowerView
    • r2
    • Resources
    • tcpdump
    • T-Shark User Guide
    • tmux
    • ssh
    • Vim
    • Wireshark
    • kwp
    • LAPS
    • KeePass KeeThief
    • FileCryptography.psm1
    • Impacket Pastable Commands
    • crackmapexec Pastable Commands
    • feroxbuster
    • NetExec
    • Ligolo-ng
    • gs-netcat
    • Scarecrow
  • Web Path
    • Testing for LFI
    • Testing for RFI
    • Testing for SQL
    • Testing for XSS
    • Authentication Bypass
    • Cmd Injection
    • Javascript Vulnerabilities
    • SSTI
    • Web Servers
    • JWT Tokens
    • Adobe Coldfusion
    • NoSQL Injection
    • vhost Enumeration
  • Wifi/Bluetooth/ZigBee/SDR/SmartCards
    • Wifi Capture Filters
    • Bluetooth Basics
    • Wifi Overview
    • Bettercap Bluetooth / Wifi
    • Aircrack-ng
    • Airdecap-ng
    • Aireplay-ng
    • RTL-SDR Radio
    • Bluetooth Low Energy
    • Smart Cards
    • Airodump-ng Airgraph-ng
    • gqrx
  • Windows
    • powershell-cheatsheet
    • Windows Privlage Escalation
    • Anti-Virus Evasion
    • Windows Registry
    • exploits
      • printspoofer
    • Windows Kernel Vulnerabilities
    • Windows Defender
    • AMSI Bypasses
    • pktmon Packet Capture Windows
    • Powershell Constrained Language Mode
    • Windows Survey
    • Windows Persistence
    • Windows World Writeable Dirs
  • firewalls
    • iptables
    • ufw
    • netsh advfirewall
  • Malware Analysis
    • Malware Analysis Fundamentals
    • Packer Identification by File section names
    • Analyzing Malicious Documents
    • In Depth Malware Analysis
    • Reversing Malicious Code
  • Infrastructure Development
    • SSL Cert Generation
    • Pfsense
      • OpenVPN Server on Pfsense
    • Proxmox OVA Import
  • Python3 Reference
    • Python3 Cheatsheet
    • Regex Python3
  • EDR
    • Velociraptor EDR
  • Host Forensics
    • Windows Host Forensics
    • Windows NT Versions
    • Windows Logs
  • Cloud
    • AWS
  • OSINT
    • Spiderfoot
    • Shodan Dorks
  • Phishing
  • Random
  • Linux
    • awk
    • cut
    • grep
    • sort
    • Cups CVE2024
  • Windows Malware Development
    • Win32 API
    • Processes Threads Handles
      • Message Box Example (Basic)
      • CreateProcess Example (Basic)
  • Golang
  • Mikrotik
    • Implementing a Password Reset Function for Persistent Access in MikroTik RouterOS
    • Cleaner Wrasse
  • Firmware Reversing
Powered by GitBook
On this page
  • Whois
  • Nslookup
  • nslookup information leakage
  • Host
  • Zone Transfers
  • Dig
  • Fierce
  • DNSenum
  • DNSrecon
  • Sublist3r
  • The Harvester
  • crt.sh to Find domains
  • Subdomain Takeover

Was this helpful?

Edit on GitHub
  1. recon-enumeration

Pentesting DNS

Whois

  • Whois lookup is used to get general information about the domain such as the registrar, domain owner, contact info, and DNS Server used

whois [domain]
whois cisco.com

Nslookup

  • Stands for name server lookup used for querying the dns in order to obtain records

nslookup [domain]
nslookup cisco.com
  • May have to install the dnsutils package

sudo apt-get install dnsutils -y

Query the DNS records

nslookup -type=[record type] [domain]
nslookup -type=any cisco.com

nslookup information leakage

  • You can often get a computer with dns open to disclose its hostname to you by getting it to query itself.

nslookup
> server <ip of target>
> 127.0.0.1
> 127.0.0.2
> <ip of target>

Host

  • Another application to perform DNS lookups.

host [domain]

Zone Transfers

  • DNS servers need to be highly available, when one goes down another steps in. In order to have this setup function properly we have to make sure that both DNS servers have the same data, they need to synchronize data with each other on a regular basis.

  • A mechanism to replicate DNS databases is called a zone transfer, and the replicated database is called a DNS zone.

  • Zone transfer is when one DNS server -> transfers information to another DNS server

  • Contains potentially a complete list of all hosts for a given zone

  • Testing for Zone Transfers

  • First you need to retrieve name servers for this domain with the Host tool. Then we will use Host again to test for zone transfers on the name server

  • To retrieve the name servers for cisco.com domain name we use:

host -t ns cisco.com
  • Output:

Cisco.com name server ns1.cisco.com
  • Now that we know the name server we can supply it as an argument in the following command

host -t axfr -l cisco.com ns1.cisco.com

Dig

-Short for Domain Information Groper, is another tool for DNS servers.

  • To query a specific record type you can use the -t option (just like with Host). The following command retrieves the mx records for the google.com domain:

dig -t mx google.com
  • Or you can request all records

dig -t any google.com
  • Can also test for zone transfers:

dig axfr @nsztm1.digi.ninja zonetransfer.me [@name server domain]

Fierce

  • Fierce is a recon tool written in perl to locate non contiguous IP space and hostnames using DNS.

  • This tool helps locate targets inside and out of the corporate network.

fierce -h  
fierce -dns google.com
  • Fierce will first list DNS Servers, attempt a zone transfer on every name server, checks for wildcard DNS record and attempts to brute force subdomains using an internal wordlist.

  • By default fierce has its own wordlist but you can also use your own word list:

fierce -dns google.com -wordlist [path to wordlist]

DNSenum

  • DNSenum is a perl script that can be used to enumerate the DNS information of a domain and to discover non contiguous IP blocks. This tool will also attempt zone transfers.

dnsenum [domain name]

DNSrecon

  • DNSrecon is another automated tool that can be used to query DNS records, check for zone transfers and other tasks.

dnsrecon -d google.com
user@slingshot:~$ dnsrecon -n 8.8.8.8 -d clifbar.com  -w
[*] Performing General Enumeration of Domain: clifbar.com
[-] DNSSEC is not configured for clifbar.com
[*]      SOA ns-1288.awsdns-33.org 205.251.197.8
...trimmed for brevity...
[*]      SRV _sip._tls.clifbar.com pulsip.clifbar.com 87.246.98.42 443 0
[+] 9 Records Found
[*] Performing Whois lookup against records found.
[*] The following IP Ranges where found:
[*]      0) 205.251.192.0-205.251.255.255 Amazon.com, Inc.
[*]      1) 205.251.192.0-205.251.199.255 Amazon Data Services NoVa
[*]      2) 67.231.144.0-67.231.159.255 Proofpoint, Inc.
[*]      3) 13.200.0.0-13.239.255.255 Amazon Technologies Inc.
[*]      4) 13.224.0.0-13.227.255.255 Amazon.com, Inc.
[*]      5) 213.128.224.0-213.128.255.255 UK-SOL-20020703
[*]      6) 87.246.76.32-87.246.76.63 pulsant15311
[*]      7) 87.246.98.0-87.246.98.127 pulsant1880
[*] What Range do you wish to do a Revers Lookup for?
[*] number, comma separated list, a for all or n for none
  • -w is for a more in depth enumeration.

Sublist3r

  • Sublist3r is a DNS meta-query spider that uses an extensive wordlist to enumerate DNS records and subdomains.

  • In attempting large numbers of entries Subbrute uses open resolvers to circumvent rate limiting issues

  • To install:

apt update && apt -y install sublist3r
  • Default scan without subbrute:

sublist3r -d google.com
  • To apply brute forcing with subbrute we add the -b option to the command and can specify the number of threads to use with the -t option

sublist3r -d google.com -b -t 100

The Harvester

  • Example: we want to find any email address for the cisco.com domain using Yahoo.

  • We will specify the domain to search for with -d, the data source with -b and limit the results to 100 by adding -l 100:

theharvester -d cisco.com -b yahoo -l 100

crt.sh to Find domains

  • Certificate Transparency site can reveal hosts that are not public yet

  • https://crt.sh

Subdomain Takeover

  • Validate with

PreviousExploit ResearchNextPentesting Kerberos

Last updated 9 months ago

Was this helpful?

https://0xpatrik.com/takeover-proofs/
https://punksecurity.co.uk/dnsreaper/
https://github.com/EdOverflow/can-i-take-over-xyz