HACK THE PLANET LABS 0 XP · New Recruit

Lab 01 · Beginner · 25–35 min · Web Fundamentals

HTTP Under the Hood

Every page you have ever opened started the same way: your browser asked a server for something, and the server answered. This lab opens that conversation up and shows you every word of it.

Mission Brief

Your mission

Understand how a browser and a web server communicate using HTTP — well enough to read a real request and explain every part of it.

By the end of this lab you will understand

  • What HTTP is, and what a client and a server are
  • How a request is structured — method, path, headers, body
  • How a response is structured — status line, headers, body
  • What GET and POST do, and when each is used
  • What status codes mean — 200, 301, 404, 500 and the rest
  • What cookies are, and how sessions remember you
  • How HTTPS differs from HTTP, and why it matters

Prerequisites: none. What you need: this page and a browser. Everything in this lab uses fictional training data — no real websites are contacted.

Module 1

What happens when you visit a website?

You type an address and press Enter. In less than a second, four things happen:

YOUR
BROWSER
You
REQUEST
“Send me this page”
SERVER
Finds the page
RESPONSE
Page comes back
BROWSER
Renders the page
1 · Browser builds a request 2 · Request travels to the server 3 · Server processes it 4 · Response returns — page renders

That is the whole web, in one loop: request, then response. HTTP — HyperText Transfer Protocol — is simply the agreed language of that conversation. The browser is the client (it asks), the machine holding the website is the server (it answers). Neither side improvises: both follow the same format, which is what the next module shows you.

Common misconception: the internet is not one big computer. It is millions of clients and servers having billions of tiny request–response conversations like this one, every second.

Module 2

Anatomy of an HTTP request

Here is a real, properly formatted request. Click any part of it to see what it does:

GET /search?q=cybersecurity HTTP/1.1 Host: training.local User-Agent: HTP-Lab-Browser/1.0 Accept: text/html Cookie: session=demo_session

Click a line above

Each line of a request has one job. Click one to see its explanation here.

The parts, in plain words

  • Method — what you want the server to do. GET means “send me this”.
  • Path — which resource you want: /search?q=cybersecurity. The ?q=… part is a query — data sent along with the request.
  • HTTP version — HTTP/1.1 says which dialect of the protocol you speak.
  • Host header — which website on that server you want. One server can host many sites, so this line is essential.
  • Headers — extra facts about the request: who is asking (User-Agent), what format you accept (Accept), and any cookies.
  • Body — data sent with the request. A GET has no body; a POST (a form, a login) carries its data here.

Module 3

HTTP methods

The method is the verb of the request. Five cover almost everything on the web:

MethodWhat it doesReal example
GETRetrieve something. Safe — it changes nothing on the server.Opening a blog post, searching, loading an image
POSTSubmit data to create something new.Logging in, posting a comment, uploading a file
PUTReplace a resource entirely with a new version.Updating your whole profile in one save
PATCHChange part of a resource.Editing just your display name
DELETERemove a resource.Deleting a post or an account photo

Security note: a GET request should never change anything — that is why links are safe to click. When a site changes data on a GET (for example, “delete” as a plain link), that is a design flaw, and attackers abuse it.

Module 4

The response — and status codes

The server answers with a status line, headers, and a body (usually the page itself). The most important part is the three-digit status code. Click one:

200 — OK

Everything worked. The server found what you asked for and is sending it back. This is the code you want to see.

HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 18412

<!DOCTYPE html>
<html>... the page ...

The groups are easy to remember: 2xx = success, 3xx = redirection (go elsewhere), 4xx = the client did something wrong, 5xx = the server failed. When a site breaks, the status code is the first thing a professional checks — it tells you which side of the conversation went wrong.

Module 5

Cookies & sessions

HTTP forgets everything. Every request is a fresh conversation — the server does not remember that you logged in a minute ago. Cookies are how it remembers.

1 · You log inBrowser sends your username & password
→
2 · Server replies“Here is your session cookie”
→
3 · Browser stores itCookie saved for this site
→
4 · Every next requestCookie sent automatically — server knows it is you
  • Session cookies — deleted when you close the browser. Your login for this visit.
  • Persistent cookies — stored with an expiry date. “Remember me” uses these.
  • Secure — the cookie is only sent over HTTPS, never over plain HTTP.
  • HttpOnly — JavaScript cannot read the cookie, so a cross-site scripting attack cannot steal it.
  • SameSite — limits when the cookie is sent to other sites, blocking cross-site request tricks.

Why this matters for security: a session cookie is your login. Anyone who steals it can use the site as you. That is why Secure and HttpOnly exist — and why you should never log in on a site without HTTPS.

Module 6

HTTP vs HTTPS

Same protocol, one difference: TLS encryption. HTTPS wraps the entire HTTP conversation in encryption, so nobody between you and the server can read or change it.

HTTP — port 80

Everything is readable in plain text. Anyone on the same network — a café Wi-Fi, a compromised router — can see the pages you visit, the data you submit, and your session cookie. Passwords travel in the open.

HTTPS — port 443

TLS encrypts the conversation before a single byte of HTTP is sent. Attackers see only that you connected to a server, not what you asked for or what came back. The padlock in your browser means this protection is on.

HTTPS does not mean the site is honest — a scam site can have HTTPS too. It means the connection is private, not that the destination is trustworthy.

Knowledge Check

Check what you learned

Six questions. You need 4 out of 6 to pass and earn 30 XP. Every answer explains itself — right or wrong.

Practical Challenge

The HTTP Request Inspector

A training browser sent this request to a fictional server. Identify the five parts: the method, the path, the host, the user-agent and the cookie. Click a part of the request, then click the label that matches it.

GET /account/profile HTTP/1.1 Host: training.local User-Agent: HTP-Lab-Browser Accept: text/html Cookie: session=demo_session

0 of 5 identified. Click a line in the request first.

Debrief

What you learned — and what comes next

The request you just inspected was a browser asking for a user’s account page:

GET /account/profile HTTP/1.1
Host: training.local
User-Agent: HTP-Lab-Browser
Accept: text/html
Cookie: session=demo_session

GET asks for the profile page at /account/profile on training.local. The browser identifies itself as HTP-Lab-Browser, says it accepts HTML, and proves it is logged in with the session cookie. The server will check that cookie, and if it is valid, return the page — with a 200 OK.

Defensive takeaway: every one of those lines can be abused — methods misused, paths probed, headers forged, cookies stolen. Knowing how the conversation is supposed to look is what lets you spot when it does not.

Complete the quiz and the challenge to finish this lab.

Completing this lab unlocks Lab 02 and the “First Steps” achievement. It also points you at the matching course on the main site — Ethical Hacking: From Basics to Advanced — as your next step after the labs. Course access itself is unchanged; this preview only demonstrates the recommendation.