Coach Beard Jr. Boring Notes
  • CONTRIBUTING
  • Multi Threading
  • Processes
  • README
  • Security Policy
  • Stack vs Heap Memory Allocation
  • What is it?
  • Mind Map
  • Azure
    • Table of contents
  • Azure
    • Resources
  • BATCH-Scripting
    • Gettng-Started
  • Cloudflare
    • Digital Certificates - What are Those
  • Cloudflare
    • Introduction to HTTPS and TLS
  • Cloudflare
    • Resources
  • DENO LAND
    • DENO - CLI
  • DENO LAND
    • Deno_index.docx
  • DENO LAND
    • Examples
  • DENO LAND
    • Starting Examples
  • DENO LAND
    • Working with Deno
  • DENO LAND
    • http_server.ts
  • Docker Notes
    • Commands
  • Docker Notes
    • Communication
  • Docker Notes
    • Containers
  • Docker Notes
    • Data in Docker
  • Docker Notes
    • Docker Compose
  • Docker Notes
    • Dockerfile
  • Docker Notes
    • Images and containers
  • Docker Notes
    • Practice Images
  • What and Why
  • Docker Notes
    • Table of contents
  • Docker Notes
    • Virtual Machines
  • Docker Notes
    • Volumes
  • Docker Notes
    • dockerignore
  • Garbage Collection
    • Introduction
  • Git and Github
    • GIT
  • Git and Github
    • Github
  • HackingHub.io
    • Mindmap
  • HackingHub.io
    • Start Here
  • JENKINS
    • JENKINS (Getting Started)
  • Java - A Headache
    • A Headache
  • Java - A Headache
    • Checked Exceptions
  • Java - A Headache
    • Concurrency In Java
  • Java - A Headache
    • ENUM
  • Java - A Headache
    • ThreadExceptions
  • Java - A Headache
    • Exception Handling
  • Java - A Headache
    • Java Memory Management
  • Java - A Headache
    • Lambda Expressions
  • Java - A Headache
    • LifeCycle and States of a Thread in Java
  • Java - A Headache
    • Memory Allocation by JVM
  • Java - A Headache
    • Multi-Threading in JAVA
  • Java - A Headache
    • Transient
  • JavaScript
    • Arrays
  • JavaScript
    • Behind the Scenes of JavaScript
  • JavaScript
    • Falsy-Truthy Values
  • JavaScript
    • Garbage Collection
  • JavaScript
    • Getters_Setters
  • JavaScript
    • Hoisting
  • JavaScript
    • How Code is Parsed and Compiled
  • JavaScript
    • Index.docs
  • JavaScript
    • Inside JS Engine
  • JavaScript
    • MindMap
  • JavaScript
    • Objects
  • JavaScript
    • this in javascript
  • Kubernetes
    • Kubernetes Architecture Overview
  • Linux & Unix
    • GRUB - Grand Unified Bootloader
  • Linux & Unix
    • Resources
  • Miscellaneous
    • CDN Architecture
  • Miscellaneous
    • JavaScript exec returns Undefined
  • NodeJS
    • Index.docs
  • Obsidian - Help
    • Resources
  • Pentester Notes
    • IP Address
  • Pentester Notes
    • LAN - Local Area Network
  • Pentester Notes
    • MAC Address
  • Pentester Notes
    • MindMap
  • Pentester Notes
    • Networking
  • Pentester Notes
    • Offensive Security
  • Pentester Notes
    • Ping
  • Pentester Notes
    • Subnetting
  • Spring-Security
    • Servlets & Filters
  • Spring-Security
    • default-configuration
  • TypeScript
    • Index.docs
  • TypeScript
    • TypeScript
  • Webpack
    • Concepts
  • .github
    • ISSUE_TEMPLATE
      • feature_request
  • Automation
    • Cucumber-Framework
      • Getting Started
  • Automation
    • Playwright
      • Introduction
  • Azure
    • AZ-104
      • Control Azure services with the CLI
  • Azure
    • AZ-104
      • Deploy Azure infrastructure by using JSON ARM templates
  • Azure
    • AZ-204
  • Azure
    • AZ-204
      • mindMap
  • Azure
    • Azure Policy
      • Azure-policies
  • Azure
    • Azure Policy
  • Azure
    • Azure-Fundamentals
  • Azure
    • Azure-Fundamentals
      • mindmap
  • Cloudflare
    • Docs
      • Cloudflare IPs
  • Cloudflare
    • Docs
      • Getting Started
  • Cloudflare
    • Docs
      • MindMap
  • DENO LAND
    • Basics
      • Basics
  • DENO LAND
    • Basics
      • Connecting to Database
  • DENO LAND
    • Basics
      • Environment Variables
  • DENO LAND
    • Basics
      • Imports
  • DENO LAND
    • Basics
      • Modules
  • DENO LAND
    • Basics
      • Permissions
  • DENO LAND
    • Basics
      • Standard Library
  • DENO LAND
    • Basics
      • Testing
  • Eager
    • Primes
      • Finding prime number - formula
  • Git and Github
    • Github-Actions
      • Auto Publish(Release) - GitHub Actions
  • Git and Github
    • Github-Actions
      • Continuous Integration (CI) - GitHub Actions
  • Git and Github
    • Github-Actions
      • Github-Actions Introduction
  • Java - A Headache
    • Garbage Collection
      • Garbage Collection
  • Java - A Headache
    • Garbage Collection
      • Types of Garbage Collection
  • Java - A Headache
    • Spring - Framework
      • annotation
  • Java - A Headache
    • Threads
      • Threads in JAVA
  • JavaScript
    • Basics
      • DataTypes_Variables
  • JavaScript
    • Basics
      • Null-Undefined-NaN
  • JavaScript
    • DOM
      • Fundamental data types
  • JavaScript
    • DOM
      • Learn to search Methods and attributes
  • JavaScript
    • DOM
      • What is DOM
  • JavaScript
    • DOM
      • Working With DOM
  • JavaScript
    • Functions
      • Functions in JavaScript
  • JavaScript
    • OOP
      • OOP in JS
  • Pentester Notes
    • DNS
      • DNS Records
  • Pentester Notes
    • DNS
      • Securing DNS
  • Pentester Notes
    • DNS
      • What is 1.1.1.1
  • Pentester Notes
    • DNS
      • What is DNS
  • Pentester Notes
    • OSI Model
      • Intro
  • Pentester Notes
    • Protocols
      • ARP Protocol
  • Pentester Notes
    • Protocols
      • DHCP Protocol
  • Azure
    • AZ-104
      • Azure-Administrators
        • automate-azure-tasks-using-scripts
  • Azure
    • AZ-104
      • Azure-Administrators
        • azure-resource-manager
  • Azure
    • AZ-104
      • Azure-Administrators
        • configure-azure-resources
  • Azure
    • AZ-104
      • Azure-Administrators
        • configure-resources-with-arm
  • Azure
    • AZ-104
      • Azure-Administrators
        • control-azure-services-cli
  • Azure
    • AZ-104
      • Azure-Administrators
        • deploy-azure-infra-using-arm-templates
  • Azure
    • AZ-104
      • Azure-Administrators
  • Azure
    • AZ-104
      • Configure and Manage VNet for Azure
        • Configure Azure DNS
  • Azure
    • AZ-104
      • Configure and Manage VNet for Azure
        • Configure Azure Virtual Network Peering
  • Azure
    • AZ-104
      • Configure and Manage VNet for Azure
        • Configure Network Security Groups
  • Azure
    • AZ-104
      • Configure and Manage VNet for Azure
        • Configure Network routing and endpoints
  • Azure
    • AZ-104
      • Configure and Manage VNet for Azure
        • Configure Virtual Networks
  • Azure
    • AZ-104
      • Deploy and Manage Azure compute resources
        • Configure Azure Container Instances
  • Azure
    • AZ-104
      • Deploy and Manage Azure compute resources
        • Configure Virtual Machines
  • Azure
    • AZ-104
      • Deploy and Manage Azure compute resources
        • Manage VM with Azure CLI
  • Azure
    • AZ-104
      • Deploy and Manage Azure compute resources
        • configure-azure-app-service-plans
  • Azure
    • AZ-104
      • Deploy and Manage Azure compute resources
        • configure-azure-app-service
  • Azure
    • AZ-104
      • Deploy and Manage Azure compute resources
        • configure-vm-availability
  • Azure
    • AZ-104
      • Implement and Manage Storage in Azure
        • Configure Azure Blob Storage
  • Azure
    • AZ-104
      • Implement and Manage Storage in Azure
        • Configure Azure Files and Azure File Sync
  • Azure
    • AZ-104
      • Implement and Manage Storage in Azure
        • Configure Azure Storage Security
  • Azure
    • AZ-104
      • Implement and Manage Storage in Azure
        • Configure Azure Storage with tools
  • Azure
    • AZ-104
      • Implement and Manage Storage in Azure
        • Configure Storage Accounts
  • Azure
    • AZ-104
      • Implement and Manage Storage in Azure
        • Control Access to Azure Storage with SAS
  • Azure
    • AZ-104
      • Implement and Manage Storage in Azure
        • Create Azure Storage Account
  • Azure
    • AZ-104
      • Implement and Manage Storage in Azure
        • Upload, download, manage data with Azure Storage Explorer
  • Azure
    • AZ-104
      • Manage identities and governance in Azure
        • Allow users to reset their password with Entra SSPR
  • Azure
    • AZ-104
      • Manage identities and governance in Azure
        • Configure Azure Policy
  • Azure
    • AZ-104
      • Manage identities and governance in Azure
        • Configure Microsoft Entra ID
  • Azure
    • AZ-104
      • Manage identities and governance in Azure
        • Configure RBAC
  • Azure
    • AZ-104
      • Manage identities and governance in Azure
        • Configure Subscriptions
  • Azure
    • AZ-104
      • Manage identities and governance in Azure
        • Configure user and group accounts
  • Azure
    • AZ-104
      • Manage identities and governance in Azure
        • Create Azure Users and Groups in Entra ID
  • Azure
    • AZ-104
      • Manage identities and governance in Azure
        • Secure Azure resources with Azure RBAC
  • Azure
    • AZ-104
      • Monitor and back up Azure resources
        • Configure Azure Alerts
  • Azure
    • AZ-104
      • Monitor and back up Azure resources
        • Configure Azure Monitor
  • Azure
    • AZ-104
      • Monitor and back up Azure resources
        • Configure Log Analytics
  • Azure
    • AZ-104
      • Monitor and back up Azure resources
        • Configure Network Watcher
  • Azure
    • AZ-104
      • Monitor and back up Azure resources
        • Configure Virtual Machine Backups
  • Azure
    • AZ-104
      • Monitor and back up Azure resources
        • Configure file and folder backups
  • Azure
    • AZ-104
      • Monitor and back up Azure resources
        • Improve incident response with alerting on Azure
  • Azure
    • AZ-204
      • Azure-AppService-WebApps
        • AppService-DeploymentSlots
  • Azure
    • AZ-204
      • Azure-AppService-WebApps
        • Azure-App-Services
  • Azure
    • AZ-204
      • Azure-AppService-WebApps
        • Configure-web-app-settings
  • Azure
    • AZ-204
      • Azure-AppService-WebApps
        • Scale-apps-Azure-AppService
  • Azure
    • AZ-204
      • Azure-AppService-WebApps
  • Azure
    • AZ-204
      • Azure-Cosmos-DB
        • cosmosDB-part1
  • Azure
    • AZ-204
      • Azure-Cosmos-DB
        • cosmosDB-part2
  • Azure
    • AZ-204
      • Azure-Cosmos-DB
  • Azure
    • AZ-204
      • Azure-Functions
        • Azure-Functions-2
  • Azure
    • AZ-204
      • Azure-Functions
        • Azure-Functions
  • Azure
    • AZ-204
      • Azure-Functions
  • Azure
    • AZ-204
      • Containerized-Solutions
        • implement-azure-container-apps
  • Azure
    • AZ-204
      • Containerized-Solutions
        • manage-container-images-in-container-registry
  • Azure
    • AZ-204
      • Containerized-Solutions
  • Azure
    • AZ-204
      • Containerized-Solutions
        • run-container-images-container-instances
  • Azure
    • AZ-204
      • Sols-using-blob-Storage
        • Azure-Blob-Storage-demo
  • Azure
    • AZ-204
      • Sols-using-blob-Storage
        • Azure-Blob-Storage-intro
  • Azure
    • AZ-204
      • Sols-using-blob-Storage
        • Azure-Blob-Storage-lifecycle
  • Azure
    • AZ-204
      • Sols-using-blob-Storage
        • mindmap
  • Azure
    • AZ-204
      • course-notes-udemy
        • Azure App Service
  • Azure
    • AZ-204
      • course-notes-udemy
        • Containers Service
  • Azure
    • AZ-204
      • course-notes-udemy
        • Create VM via Powershell
  • Azure
    • AZ-204
      • Course Notes - Udemy
  • Azure
    • Azure-Fundamentals
      • Architecture-Services
        • Azure Infrastructure
  • Azure
    • Azure-Fundamentals
      • Architecture-Services
        • Azure-identity-access-security
  • Azure
    • Azure-Fundamentals
      • Architecture-Services
        • Azure-storage-services
  • Azure
    • Azure-Fundamentals
      • Architecture-Services
  • Azure
    • Azure-Fundamentals
      • Architecture-Services
        • compute-and-network-services
  • Azure
    • Azure-Fundamentals
      • Architecture-Services
        • mindMap
  • Azure
    • Azure-Fundamentals
      • Cloud-Concepts
  • Azure
    • Azure-Fundamentals
      • Cloud-Concepts
        • cloud-concepts
  • Azure
    • Azure-Fundamentals
      • Management-Governance
        • Cost-management-Azure
  • Azure
    • Azure-Fundamentals
      • Management-Governance
        • Monitor-tools-in-auzre
  • Azure
    • Azure-Fundamentals
      • Management-Governance
  • Azure
    • Azure-Fundamentals
      • Management-Governance
        • azure-for-governance-and-compliance
  • Azure
    • Azure-Fundamentals
      • Management-Governance
        • features-tools-for-managing-and-deploying-resources
  • Azure
    • Azure-Fundamentals
      • Management-Governance
        • mindmap
Powered by GitBook
On this page
Edit on GitHub
  1. Pentester Notes
  2. DNS

Securing DNS

Why does DNS need additional layers of security??

By default, DNS queries and responses are sent in plaintext via UDP which means they can be read by networks, ISPs or anyone able to monitor transmissions. Even if a website uses HTTPS the DNS query required to navigate to that website is exposed.

DNS over TLS and DNS over HTTPS are two standards developed for encrypting plaintext DNS traffic in order to prevent malicious parties, advertisers and ISPs and other from being able to interpret the data.

DNS over TLS

Also called DoT is a standard for encrypting DNS queries to keep them secure and private. DoT uses the same security protocol, TLS that HTTPS websites uses to encrypt and authenticate communications. DoT adds TLS encryption on top of the UDP which is used for DNS queries.

DNS over HTTPS

DNS over HTTPS or DoH is an alternative to DoT. With DoH, DNS queries and responses are encrypted, but they are sent via HTTP or HTTP/2 protocol instead of directly over UDP. DoH traffic looks like other HTTPS traffic

Browsers also support DoH, although it is not turned on by default.

DoT uses port 853, while DoH uses port 443, which is the port that all other HTTPS traffic uses as well.

DNS was not designed with security in mind.

DNS Security

Common DNS attacks

  1. DNS spoofing/Cache poisoning

    1. This is an attack where forged DNS data is introduced into a DNS resolvers cache, resulting in the resolver returning an incorrect IP address for a domain.

  2. DNS Tunneling

    1. This attack uses other protocols to tunnel through DNS queries and responses. Attackers can use SSH, TCP, HTTP to pass malware or stolen information into DNS queries, undetected by most firewalls

  3. DNS hijacking

    1. the attacker redirects queries to a different domain name server. This can be done either with malware or with the unauthorized modification of a DNS server. Although the result is similar to that of DNS spoofing, this is a fundamentally different attack because it targets the DNS record of the website on the nameserver rather than a resolvers cache.

  4. NXDOMAIN attack

    1. Type of DNS flood attack where an attacker inundates a DNS server with requests asking for records that do not exists, in an attempt to cause a denial-of-service for legitimate traffic.

  5. Phantom domain attack

    1. has similar result to an NXDOMAIN attack on a DNS resolver. The attacker sets up a bunch of phantom domain servers that either respond to requests very slowly or not at all. The resolver is then hit with a flood requests to these domains and the resolver gets tied up waiting for responses leading to slow performance and denial-of-service

  6. Random subdomain attack

    1. the attacker sends DNS queries for several random, non-existent subdomains of one legitimate site. The goal is to create a denial-of-service for the domains authoritative nameserver, making it impossible to lookup the website from the nameserver. As a side effect the ISP serving the attacker may also be impacted, as their recursive resolvers cache will be loaded with bad requests.

  7. Domain lock-up attack

    1. attackers orchestrate this form of attack by setting up special domains and resolvers to create TCP connections with other legitimate resolvers. When the targeted resolvers send requests, these domains send back slow streams of random packets tying up the resolvers resources.

  8. Botnet-based CPE attack

    1. These attacks are carried out using CPE devices(Customer Premise Equipment, this is hardware given out by service providers for use by their customers such as modems, routers, etcc) The attackers compromise the CPEs and the devices become the part of botnet, used to perform random subdomain attacks against one site or domain.

DNSSEC. ?

DNS Security Extensions is a security protocol, protects against attacks by digitally signing data to help ensure its validity. In order to ensure a secure lookup, the signing must happen at every level in the DNS lookup process.

DNSSEC implements a hierarchical signing policy across all layers of DNS.

DNSSEC is designed to be backwards compatible to ensure that traditional DNS lookups still resolve correctly, albeit without the added security.

DNSSEC creates a parent-child train of trust that travels all the way up to the root zone. This chain of trust cannot be compromised at any layer of DNS, or else the request will become open to an on-path attack,

To close the chain of trust, the root zone itself needs to be validated, and this is actually done using human intervention. Interestingly, in what's called Root Zone Signing Ceremony, selected individuals from around the globe meet to sign the root DNSKEY RRset in a public and audited way.

DNS resolvers can also be configured to provide security solutions for their end users. Some DNS resolvers provide features such as content filtering, which can block sites known to distribute malware and spam, and botnet protection, which blocks communication with known botnets.

DNS Cache poisoning | DNS Spoofing

Attackers can poison a DNS cache by tricking DNS resolvers into caching false information, with the result that the resolver sends the wrong IP address to clients, and users attempting to navigate to a website will be directed to the wrong place.

It is the act of entering false information into a DNS cache, so that DNS queries return an incorrect response and users are directed to wrong websites.

Because there is typically no way for DNS resolvers to verify the data in their caches, incorrect DNS information remains in the cache until the TTL expires, or until it is removed manually.

How does DNS caching work?

DNS resolver will save response to IP address queries for a certain amount of time. In this way, the resolver can respond to future queries much more quickly, without needing to communicate with the many servers involved in the typical DNS resolution process.

Process of DNS Spoofing

Attackers can poison DNS caches by impersonating DNS nameservers, making a request to a DNS resolver and then forging the reply when the DNS resolver queries a nameserver.

This is possible because DNS servers use UDP instead of TCP and because currently there is no verification for DNS information.

DNS resolver does actually query the authoritative nameserver, attackers have only a few milliseconds to send the fake reply before the real reply from the authoritative nameserver arrives.

Attackers also have to either know or guess a number of factors to carry out DNS spoofing attacks

  1. which DNS queries are not cached by the targeted DNS resolver

  2. what port the DNS resolver using

  3. the request ID number

  4. which authoritative nameserver the query will go to.

DNS Fast Flux

Way of rapidly swapping out the IP addresses associated with a domain so that malicious domain used for phishing attacks and other criminal activity are harder to block

Is a technique that involves associating multiple IP addresses with a single domain name and changing out these IP addresses rapidly. Sometimes, hundreds or even thousands of IP addresses are used.

This technique is commonly used by botnets

With DNS fast flux, malicious domain have more uptime and are harder to block, enabling cyber criminals to carry out more attacks.

An IP address will be registered and then deregistered and replaced with a new IP address ever few minutes or seconds. Attackers are able to do this by exploiting a load balancing technique called round robin DNS and by setting a very short TTL for each IP address. Often some or all the IP addresses are used will be web hosts that the attackers have compromised. The machines at these IP addresses will act as proxies for the attackers origin server.

Round robin DNS is a way of associating multiple redundant web servers, each with their own IP address, with a domain. When the authoritative nameserver for that domain receives a query, it hands out a different IP address each time and as a result no one web server gets overwhelmed with traffic(theoretically). While load balancing is the legitimate, intended use of round robin DNS, attackers can use this feature to obfuscate their malicious activity.

The most effective way to stop DNS fast fluxing is to simple take down the domain name. Network administrators can also require users within their network to use DNS servers they control and to blackhole or discard, queries for malicious domains. This may malicious domains are not resolved and users are unable to access them. This is called DNS Filtering

PreviousDNSNextPentester Notes

Last updated 1 year ago