Lecture 1 - Intro to Web Technologies
Lecture 1 - Intro to Web Technologies
Excerpts and concepts taken from the Web Application Hacker’s Handbook 2nd Edition License: Creative Commons
Stuttard & Pinto, Wiley Press
2
About Me
MSc Computer Science Offensive Security Certified
@UOIT Professional (OSCP)
Protocol: HTTP
§ Stateless and plaintext protocol
protocol://hostname[:port]/[path/]file[?param=value]
https://example.com:8080/user.php?id=1&name=me
/user.php?id=2&name=you
https://example.com:8080/user/id/2/name/you
6
1. HTTP Verb
The method used to communicate with
the server. For example: GET, POST,
OPTIONS, TRACE, etc..
6. Referrer (Optional)
The URL of the originating server (i.e. the
page you were on when you clicked a link).
8
7. Cookie(s)
One or more (hopefully) random values
used to uniquely identify a client or
store session data.
8. Other Headers
A variety of other components can be
added, including custom headers used
for authentication, authorization, or to
enforce client-side security mechanisms.
See: https://mzl.la/2QWIuND
9
4. Server Header
An optional, (semi) unique string identifying
the server software used to render the
response.
5. Other Headers
A variety of other headers may be added to
a response, including Set-Cookie, Pragma,
security settings, and other functionality we
will see later.
13
7. Content Body
The actual content of the response. For
example, the web page’s HTML, an API JSON
response, etc..
<!doctype html>
<html>
<head>
<title>ontariotechu.ca</title>
<META HTTP-EQUIV="Refresh" CONTENT="1;URL=https://ontariotechu.ca/">
</head>
[snip]
15
§ Examples:
GET / HTTP/1.0
GET /index.php HTTP/2.0
GET /blog.php?user=bob HTTP/1.1
16
§ Example:
§ 200 OK
§ 301 Moved Permanently
§ 302 Found
§ 304 Not Modified
§ 400 Bad Request
§ 401 Unauthorized
§ 403 Forbidden
§ 404 Not Found
§ 500 Internal Service Error
21
HTTP Cookies
§ Cookies are used to exchange persistent data
between a client and server
HTTP Cookies
§ Once a cookie is set by the server, all
subsequent client requests automatically
include the cookie value in the request
header:
Cookie: username=admin&authed=true
HTTP Authentication
§ Three mechanisms are built into the HTTP protocol
to authenticate clients, all of which can also occur
over HTTPS!
1. Basic Authentication
User credentials are base64 encoded and sent to
the server for processing
2. NTLM Authentication
The Windows NTLM challenge-response mechanism
is used to verify credentials without sending them
3. Digest Authentication
A MD5 challenge-response mechanism is used to
verify credentials without sending them
24
S e r v e r- s i d e Te c h n o l o g i e s
25
Data Structures
31
§ Example:
{
“firstName”: “john”,
“lastName”: “doe”,
}
33
K e y C l i e n t- s i d e Te c h n o l o g i e s
34
Encoding
42
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopq
rstuvwxyz0123456789+/
Let’s break!
S e e Yo u N e x t T i m e