INTLPOL 268: Hack Lab
Week 3 · Part 1
Web Applications
Week 3 · Part 1
What will we learn today?
Today, we will…
- Discuss how browsers communicate intent to websites
- See how websites remember who you are
- Learn to watch, and change, every request yourself
- Pull off our first attack: asking the server for what we want
Part one
How the web talks
Before 1991
The pre-web world


Text, menus, and one protocol per job.
- FTP to move files
- Usenet for discussion
- Telnet and BBSes to log in somewhere else
- Gopher to browse menus of documents
Nothing linked between them, and nothing ran code on your machine.
CERN · 1989–1993
Enter Tim Berners-Lee
- 1989“Information Management: A Proposal” circulates at CERN. His boss writes “vague but exciting” on it.
- 1990On a NeXT cube he writes the first browser-editor and the first server — and HTML, HTTP and the URL.
- 1991info.cern.ch goes live outside CERN. The first page explains how to make your own.
- 1993CERN puts the software in the public domain. Mosaic ships, and the web leaves the physics lab.

CERN. (1994). Tim Berners-Lee at CERN [Photograph]. CERN Document Server. · CERN. (n.d.). The birth of the Web. home.cern/science/computing/birth-web
HTTP
A very simple website
Hello World!
<!DOCTYPE html> <html> <body> <h1>Hello World!</h1> </body> </html>
HTTP · the request line
HyperText Transfer Protocol (HTTP) request
HTTP · request
A real HTTP request
GET / HTTP/1.1 Host: store.hacklab.internal User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Connection: keep-alive Upgrade-Insecure-Requests: 1 (blank line — end of headers)
HTTP · response
A real HTTP response
HTTP/1.1 200 OK Server: nginx Date: Fri, 09 Oct 2026 20:31:07 GMT Content-Type: text/html; charset=utf-8 Content-Length: 18422 Connection: keep-alive Vary: Cookie Set-Cookie: session=eyJjYXJ0IjpbXX0.aOf1Qw.3kZl7bq2w; HttpOnly; Path=/ <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Home · Cardinal HackLab Store</title> <link rel="stylesheet" href="/static/css/store.css"> </head> <body> … 18 KB of product listings …
HTTP · methods
Common HTTP methods / verbs
The GET method requests a representation of the specified resource. Requests using GET should only retrieve data.
The HEAD method asks for a response identical to that of a GET request, but without the response body.
The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.
Also PUT, DELETE, PATCH, OPTIONS — and the server is free to ignore the verb and do whatever it likes.
MDN Web Docs. (n.d.). HTTP request methods. Mozilla. developer.mozilla.org/en-US/docs/Web/HTTP/Methods
HTTP · request with a body
A real POST
POST /login HTTP/1.1 Host: store.hacklab.internal User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Referer: https://store.hacklab.internal/login Content-Type: application/x-www-form-urlencoded Content-Length: 37 Origin: https://store.hacklab.internal Cookie: session=eyJjYXJ0IjpbXX0.aOf1Qw.3kZl7bq2w Upgrade-Insecure-Requests: 1 username=student&password=studentpass
HTTP · response
A real response
HTTP/1.1 302 FOUND Server: nginx Date: Fri, 09 Oct 2026 20:31:19 GMT Content-Type: text/html; charset=utf-8 Content-Length: 207 Location: /profile/2 Vary: Cookie Set-Cookie: session=eyJjYXJ0IjpbXSwiaXNfYWRtaW4iOmZhbHNlLCJ1c2VyX2lkIjoyLCJ1c2VybmFtZSI6InN0dWRlbnQifQ.aOf1Rw.Qm7vU0pYc; HttpOnly; Path=/ Connection: keep-alive <!doctype html> <html lang=en> <title>Redirecting...</title> <h1>Redirecting...</h1> <p>You should be redirected automatically to the target URL: <a href="/profile/2">/profile/2</a>.
Part two
What is state?
State
A very simple website — stateless
Hello World!
…and again, identically, for everyone, forever.
State
A very simple website — stateful
A is equal to 2!
<!DOCTYPE html> <html> <body> <h1>A is equal to 2</h1> </body> </html>
Part three
Cookies
Cookies
Review: how the server remembers you
Secret stuff
Cookies · attributes
Set-Cookie
MDN Web Docs. (n.d.). Set-Cookie. Mozilla. developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie
Browsers · the one rule that matters
Who can see a cookie? The Same-Origin Policy
TL;DR: the browser tries* to keep websites from messing with one another. *Tries, but sometimes fails.
https://store.hacklab.internal/cartSame originCan read the page, its cookies, its datahttp://store.hacklab.internal/Different originScheme changed — and no TLShttps://evil.example/Different originCan send requests to the Store, cannot read the answersPart four
Seeing it for yourself
Web apps
A more modern website
Web apps · tools
How do you understand and attack web apps?
Tools · inside the browser
Debugger

- Network: every request the page made, in order, with timing
- Inspector: the live HTML — including hidden form fields
- Storage: the cookies this origin can see
- Console: run your own JavaScript as the page
Press F12. It is already on every computer you own.
Tools · between the browser and the world
Proxy

- HTTP history: the raw request and response, byte for byte
- Intercept: pause a request and edit it before it leaves
- Repeater: send the same request again, changed however you like
The browser sends what the page tells it to. The proxy sends what you tell it to.
Part five · our first attack
Asking the app to do what you want
Web app attacks
Three big types of web app attacks
Asking the app to do what you want.
Change what the browser sends — a number, a cookie, a hidden field — and see whether the server checks.
TodayUsing the web app to get code running in somebody else’s browser.
Cross-site scripting: your input becomes part of a page another person loads.
Next weekInjecting commands to be run directly by the web app.
SQL injection: your input becomes part of a command the server runs on your behalf.
Next weekInsecure direct object reference
IDOR: asking the server to do what you want it to do
Logged in as the owner of account 1234
Money moved!
<!DOCTYPE html> <html> <body> <h1>Ok, money moved</h1> ...
Insecure direct object reference
IDOR: asking the server to do what you want it to do
Still logged in as the owner of account 1234
Money moved!
<!DOCTYPE html> <html> <body> <h1>Ok, money moved</h1> ...
IDOR
Wait, that’s it?
Yup.
Imagine you are a web server. What do you know about the person making requests? What are they sending you?
Are you checking that everything they say matches their identity?
Hands on · Lab 3: Web Application Foundations
Lab
- What the browser sees: set up Burp and the Store
- HTTP headers: read the two halves of a conversation
- One page, many requests: resources and application data
- HTTP methods: follow a search, a login, and a cart action
- How the Store remembers you: cookies and sessions
- Routes, origins, and your first trip through Repeater
Lab instructions and your assigned systems are in the course console: console.hacklab.info