Try Hack Me | Web Fundamentals |Walkthrough | By Mohit Damke

Try Hack Me | Web Fundamentals |Walkthrough | By Mohit Damke

How The Web Works | Web Fundamentals Walkthrough of Try Hack Me

How The Website Works

To become a better hacker it's vital to understand the underlying functions of the world wide web and what makes it work

  • DNS in detail

DNS stands for Domain Name System. It is a decentralized hierarchical naming system that is used to translate human-readable domain names, like "www.example.com," into IP addresses, which are the numerical addresses used by computers to identify each other on a network. In simpler terms, DNS helps you connect to websites and services using their user-friendly names instead of having to remember complex IP addresses.

Here's how DNS works:

  1. Request: When you type a domain name (e.g., "www.example.com") into your web browser's address bar or click on a link, your device sends a DNS query to a DNS server.

  2. Resolution: The DNS server, which could be provided by your ISP or a third-party DNS service, looks up the IP address associated with the domain name in its database.

  3. Response: The DNS server sends back the corresponding IP address to your device.

  4. Connection: Your device then uses the IP address to establish a connection with the web server hosting the website. This enables you to access the website's content.

DNS is a crucial component of the internet's infrastructure, as it allows us to use memorable domain names rather than memorizing numerical IP addresses for every website we want to visit. It also supports other functionalities like email routing and various network services. DNS operates in a hierarchical manner, with different levels of DNS servers responsible for different parts of the domain name system. The highest level, known as the root DNS servers, store information about top-level domains (TLDs) like ".com," ".org," ".net," etc.

In summary, DNS is like a phonebook for the internet, helping to translate human-friendly names into computer-friendly IP addresses so that we can easily access websites and online services.

QUESTIONS !!

Q : What does DNS stand for?

~ Domain Name System

  • Domain Hierarchy

Domain hierarchy refers to the way domain names are organized in a structured manner on the internet. It's a system that helps manage and categorize domain names, making it easier to find websites and services. Here's a short overview of the domain hierarchy:

  1. Top-Level Domains (TLDs): These are the highest level of domain names in the hierarchy. They come in two types:

    • Generic TLDs (gTLDs): Examples include ".com," ".org," ".net," ".info," and ".edu."

    • Country Code TLDs (ccTLDs): These are specific to individual countries or territories, like ".us" (United States), ".uk" (United Kingdom), and ".ca" (Canada).

  2. Second-Level Domains (SLDs): These come right after the TLD and are usually the main part of a website's address. For example, in "example.com," "example" is the SLD.

  3. Subdomains: These are prefixes added to the SLD, separated by dots. They allow further categorization or organization within a domain. For instance, "www" in "www.example.com" is a subdomain.

The hierarchy goes from broader categories (TLDs) to more specific identifiers (subdomains and hostnames). This structure helps organize the vast number of websites and services on the internet and makes it easier for users to navigate and access content.

QUESTIONS !!

Q : What is the maximum length of a subdomain?

~ 63

Q : Which of the following characters cannot be used in a subdomain ( 3 b _ - )?

~ _

Q: What is the maximum length of a domain name?

~ 253

Q: What type of TLD is .co.uk?

~ ccTLD

  • DNS Record Types

    Certainly, here's a brief overview of some common DNS record types:

    1. A Record (Address Record): Maps a domain name to an IPv4 address, allowing you to reach a website by its domain name.

    2. AAAA Record (IPv6 Address Record): Similar to the A record, but maps a domain name to an IPv6 address, used for IPv6 connectivity.

    3. CNAME Record (Canonical Name Record): Creates an alias for a domain name, allowing multiple names to resolve to the same IP address.

    4. MX Record (Mail Exchange Record): Specifies the mail server responsible for receiving email messages for a domain.

    5. TXT Record (Text Record): Stores text-based information associated with a domain, often used for verification or authentication purposes.

      These record types help manage various aspects of a domain's functionality, such as routing email, directing web traffic, and verifying domain ownership for security certificates.

QUESTIONS !!

Q : What type of record would be used to advise where to send email?

~ MX

Q: What type of record handles IPv6 addresses?

~ AAAA

  • Making A Request

Making a DNS request involves your computer or device asking a DNS server to provide the IP address associated with a domain name. Here's a simplified step-by-step process of making a DNS request:

  1. User Action: You type a domain name (e.g., "www.example.com") into your web browser's address bar or click on a link that includes a domain name.

  2. Local Cache Check: Your device checks its local DNS cache to see if it already knows the IP address associated with the domain name. If it finds a recent record, it can skip the rest of the process and use the cached IP address.

  3. DNS Resolver (Recursive DNS Server): If the IP address is not in the local cache or the cache has expired, your device sends a DNS query to a DNS resolver. This is typically provided by your ISP or configured manually in your network settings. The resolver is responsible for finding the IP address for you.

  4. Root DNS Servers: If the resolver doesn't have the IP address in its cache, it contacts one of the root DNS servers. These servers have information about top-level domains (TLDs) like ".com," ".org," etc.

  5. TLD DNS Servers: The root server responds with the IP address of the TLD's DNS server responsible for the requested domain extension (e.g., ".com").

  6. Authoritative DNS Servers: The TLD DNS server directs the resolver to the authoritative DNS servers for the specific domain (e.g., "example.com"). These authoritative servers have the most up-to-date information about the domain's IP address.

  7. Response: The authoritative server provides the IP address back to the resolver.

  8. Cache Update: The resolver caches the IP address for future use and sends the IP address back to your device.

  9. Connection: Your device now uses the IP address to establish a connection with the web server associated with the requested domain. This allows you to access the website's content.

Remember that DNS requests happen behind the scenes and very quickly, enabling you to access websites using their domain names without having to worry about the underlying IP addresses.

QUESTIONS !!

Practical

QUESTIONS !!

Q: What is the CNAME of shop.website.thm?

  • ~ shops.myshopify.com

    Q: What is the value of the TXT record of website.thm?

    ~ THM{7012BBA60997F35A9516C2E16D2944FF}

    Q: What is the numerical priority value for the MX record?

    ~ 30

    Q: What is the IP address for the A record of www.website.thm?

    ~ 10.10.10.10

    Your attention to this matter is greatly appreciated.

    Anticipating our future interactions, we eagerly await the opportunity to share new write-ups and insightful walkthroughs with you.

    To maintain a connection and receive updates

    We invite you to follow/connect with us through the following channels:

    Twitter : https://twitter.com/raeeee_s

    Warm regards, Mohit Damke