How The Web Works tryhackme Flashcards

1
Q

What is DNS

A

DNS(Domain Name System) provides a simple way for us to communicate with devices on the internet without remembering complex numbers. Much like every house has a unique address for sending mail directly to it, every computer on the internet has its own unique address to communicate with it called an IP address. An IP address looks like the following104.26.10.229, 4 sets of digits ranging from 0 - 255 separated by a period.When you want to visit a website, it’s not exactly convenient to remember this complicated set of numbers, and that’s whereDNScan help. So instead of remembering104.26.10.229, you can remember tryhackme.com instead.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In terms of domain hierarchy, what is TLD

A

A TLD is the most righthand part of a domain name. So, for example, the tryhackme.com TLD is .com. There are two types of TLD, gTLD (Generic Top Level) and ccTLD (Country Code Top Level Domain). Historically a gTLD was meant to tell the user the domain name’s purpose; for example, a .com would be for commercial purposes, .org for an organisation, .edu for education and .gov for government. And a ccTLD was used for geographical purposes, for example, .ca for sites based in Canada, .co.uk for sites based in the United Kingdom and so on. Due to such demand, there is an influx of new gTLDs ranging from .online , .club , .website , .biz and so many more.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In terms of domain hierarchy, what is second-level domain.

A

Taking tryhackme.com as an example, the .com part is the TLD, and tryhackme is the Second Level Domain. When registering a domain name, the second-level domain is limited to 63 characters + the TLD and can only use a-z 0-9 and hyphens (cannot start or end with hyphens or have consecutive hyphens).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In terms of domain hierarchy, what is sub-domain

A

A subdomain sits on the left-hand side of the Second-Level Domain using a period to separate it; for example, in the name admin.tryhackme.com the admin part is the subdomain. A subdomain name has the same creation restrictions as a Second-Level Domain, being limited to 63 characters and can only use a-z 0-9 and hyphens (cannot start or end with hyphens or have consecutive hyphens). You can use multiple subdomains split with periods to create longer names, such as jupiter.servers.tryhackme.com. But the length must be kept to 253 characters or less. There is no limit to the number of subdomains you can create for your domain name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name the DNS Record types

A

A Record, AAAA Record, CName Record, MX Record, and Text Record

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In terms of DNS Record, what is the A Record.

A

These records resolve to IPv4 addresses, for example 104.26.10.229

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In terms of DNS Records, what is the AAAA Record

A

These records resolve to IPv6 addresses, for example 2606:4700:20::681a:be5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In terms of the DNS Record, what is the CNAME Record

A

These records resolve to another domain name, for example, TryHackMe’s online shop has the subdomain name store.tryhackme.com which returns a CNAME record shops.shopify.com. Another DNS request would then be made to shops.shopify.com to work out the IP address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In terms of the DNS Records, what is the MX Record

A

These records resolve to the address of the servers that handle the email for the domain you are querying, for example an MX record response for tryhackme.com would look something like alt1.aspmx.l.google.com. These records also come with a priority flag. This tells the client in which order to try the servers, this is perfect for if the main server goes down and email needs to be sent to a backup server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In terms of the DNS Records, what is the TXT Record

A

TXT records are free text fields where any text-based data can be stored. TXT records have multiple uses, but some common ones can be to list servers that have the authority to send an email on behalf of the domain (this can help in the battle against spam and spoofed email). They can also be used to verify ownership of the domain name when signing up for third party services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What happens when you make a DNS request

A

When you request a domain name, your computer first checks its local cache to see if you’ve previously looked up the address recently; if not, a request to your Recursive DNS Server will be made.

A Recursive DNS Server is usually provided by your ISP, but you can also choose your own. This server also has a local cache of recently looked up domain names. If a result is found locally, this is sent back to your computer, and your request ends here (this is common for popular and heavily requested services such as Google, Facebook, Twitter). If the request cannot be found locally, a journey begins to find the correct answer, starting with the internet’s root DNS servers.

The root servers act as the DNS backbone of the internet; their job is to redirect you to the correct Top Level Domain Server, depending on your request. If, for example, you request www.tryhackme.com, the root server will recognise the Top Level Domain of .com and refer you to the correct TLD server that deals with .com addresses.

The TLD server holds records for where to find the authoritative server to answer the DNS request. The authoritative server is often also known as the nameserver for the domain. For example, the name server for tryhackme.com is kip.ns.cloudflare.com and uma.ns.cloudflare.com. You’ll often find multiple nameservers for a domain name to act as a backup in case one goes down.

An authoritative DNS server is the server that is responsible for storing the DNS records for a particular domain name and where any updates to your domain name DNS records would be made. Depending on the record type, the DNS record is then sent back to the Recursive DNS Server, where a local copy will be cached for future requests and then relayed back to the original client that made the request. DNS records all come with a TTL (Time To Live) value. This value is a number represented in seconds that the response should be saved for locally until you have to look it up again. Caching saves on having to make a DNS request every time you communicate with a server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is HTTP

A

HTTP is what’s used whenever you view a website, developed by Tim Berners-Lee and his team between 1989-1991. HTTP is the set of rules used for communicating with web servers for the transmitting of webpage data, whether that is HTML, Images, Videos, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is HTTPS

A

HTTPS is the secure version of HTTP. HTTPS data is encrypted so it not only stops people from seeing the data you are receiving and sending, but it also gives you assurances that you’re talking to the correct web server and not something impersonating it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a URL

A

A URL is a Uniform Resource Locator. If you’ve used the internet, you’ve used a URL before. A URL is predominantly an instruction on how to access a resource on the internet. The below image shows what a URL looks like with all of its features (it does not use all features in every request).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In terms of a URL, what is a scheme

A

This instructs on what protocol to use for accessing the resource such as HTTP, HTTPS, FTP (File Transfer Protocol).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In terms of a URL, what is a user

A

Some services require authentication to log in, you can put a username and password into the URL to log in.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

In terms os a URL what is a Host

A

The domain name or IP address of the server you wish to access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

In terms of a URL, what is a port

A

The Port that you are going to connect to, usually 80 for HTTP and 443 for HTTPS, but this can be hosted on any port between 1 - 65535.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

In terms of a URL, what is a path

A

The file name or location of the resource you are trying to access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

In terms of a URL, what is a query string

A

Extra bits of information that can be sent to the requested path. For example, /blog?id=1 would tell the blog path that you wish to receive the blog article with the id of 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

In terms of a URL, what is a fragment

A

This is a reference to a location on the actual page requested. This is commonly used for pages with long content and can have a certain part of the page directly linked to it, so it is viewable to the user as soon as they access the page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is a HTTP method

A

HTTP methods are a way for the client to show their intended action when making an HTTP request. There are a lot of HTTP methods but we’ll cover the most common ones, although mostly you’ll deal with the GET and POST method.

23
Q

What is a HTTP GET Request

A

This is used for getting information from a web server.

24
Q

What is a HTTP POST Request

A

This is used for submitting data to the web server and potentially creating new records

25
Q

What is a HTTP PUT Request

A

This is used for submitting data to the web server and potentially creating new records

26
Q

What is a HTTP DELETE Request

A

This is used for deleting information/records from a web server.

27
Q

What is the HTTP Status code 100-199 - Information Response

A

These are sent to tell the client the first part of their request has been accepted and they should continue sending the rest of their request. These codes are no longer very common.

28
Q

What is the HTTP Staus code
200-299 - Success

A

This range of status codes is used to tell the client their request was successful.

29
Q

What is the HTTP Status code
300-399 - Redirection

A

These are used to redirect the client’s request to another resource. This can be either to a different webpage or a different website altogether.

30
Q

What is the HTTP Status Code
400-499 - Client Errors

A

Used to inform the client that there was an error with their request.

31
Q

What is the HTTP Status code
500-599 - Server Errors

A

reserved for errors happening on the server-side and usually indicate quite a major problem with the server handling the request.

32
Q

What is the common HTTP Status code 200 - OK

A

The request was completed successfully.

33
Q

What is the common HTTP Status code 201 - Created

A

A resource has been created (for example a new user or new blog post).

34
Q

What is the common HTTP Status code 201 - Created

A

A resource has been created (for example a new user or new blog post).

35
Q

What is the common HTTP Staus code 301 - Moved Permanently

A

This redirects the client’s browser to a new webpage or tells search engines that the page has moved somewhere else and to look there instead.

36
Q

What is the common HTTP Staus code 302 - Found

A

Similar to the above permanent redirect, but as the name suggests, this is only a temporary change and it may change again in the near future.

37
Q

What is the common HTTP Staus code 400 - Bad Request

A

This tells the browser that something was either wrong or missing in their request. This could sometimes be used if the web server resource that is being requested expected a certain parameter that the client didn’t send.

38
Q

What is the common HTTP Staus code 400 - Bad Request

A

This tells the browser that something was either wrong or missing in their request. This could sometimes be used if the web server resource that is being requested expected a certain parameter that the client didn’t send.

39
Q

What is the common HTTP Status code 401 - Not Authorised

A

You are not currently allowed to view this resource until you have authorised with the web application, most commonly with a username and password.

40
Q

What is the common HTTP Status code 403 - Forbidden

A

You do not have permission to view this resource whether you are logged in or not.

41
Q

What is the common HTTP Status code 405 - Method Not Allowed

A

The resource does not allow this method request, for example, you send a GET request to the resource /create-account when it was expecting a POST request instead.

42
Q

What is the common HTTP Status code 404 - Page Not Found

A

The page/resource you requested does not exist.

43
Q

What is the common HTTP Status code 500 - Internal Service Error

A

The server has encountered some kind of error with your request that it doesn’t know how to handle properly.

44
Q

What is the common HTTP Status code 503 - Service Unavailable

A

This server cannot handle your request as it’s either overloaded or down for maintenance.

45
Q

What is the common HTTP Status code 503 - Service Unavailable

A

This server cannot handle your request as it’s either overloaded or down for maintenance.

46
Q

What is the common request header Host

A

Some web servers host multiple websites so by providing the host headers you can tell it which one you require, otherwise you’ll just receive the default website for the server.

47
Q

What is the HTTP common request header User-Agent

A

This is your browser software and version number, telling the web server your browser software helps it format the website properly for your browser and also some elements of HTML, JavaScript and CSS are only available in certain browsers.

48
Q

What is the HTTP common request header Content-Length

A

When sending data to a web server such as in a form, the content length tells the web server how much data to expect in the web request. This way the server can ensure it isn’t missing any data.

49
Q

What is the HTTP common request header Accept-Encoding

A

Tells the web server what types of compression methods the browser supports so the data can be made smaller for transmitting over the internet.

50
Q

What is the HTTP common request header Cookie

A

Data sent to the server to help remember your information (see cookies task for more information).

51
Q

What is the HTTP common response header Set-Cookie

A

Information to store which gets sent back to the web server on each request (see cookies task for more information).

52
Q

What is the HTTP common response header Cache-Control

A

How long to store the content of the response in the browser’s cache before it requests it again.

53
Q

What is the HTTP common response header Content-Type

A

This tells the client what type of data is being returned, i.e., HTML, CSS, JavaScript, Images, PDF, Video, etc. Using the content-type header the browser then knows how to process the data.

54
Q

What is the HTTP common response header Content-Encoding

A

What method has been used to compress the data to make it smaller when sending it over the internet.