The Basics
Hypertext Transfer Protocol And More.
History Of HTTP
Specified in the early 90s.
Very simple text-based protocol.
Designed for transferring text-based documents.
How It Is Built
A request and a response.
Request/response line, headers and a body.
Lines delimited by the CRLF characters (0x0d, 0x0a)
Typical HTTP Request
GET /path/to/something HTTP/1.1
Host: hostname
User-Agent: Mozilla/5.0 ...
Accept: text/html,application/xhtml+xml,/;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://i/came/from/here
Typical HTTP Response
HTTP/1.1 200 OK
Date: Wed, 23 Nov 2013 10:10:10 GMT
Server: Some Server
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 1337
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html;charset=UTF-8
body
Browser → Server
Specify the method: GET, POST, HEAD, OPTIONS, etc.
Specify the location: a URL/URI(Unified Resource Locator/Identifier).
Tell the server more stuff how you want the data: headers.
Provide optional body.
Browser ← Server
The server responds with status code: 2xx(ok), 3xx, 4xx, 5xx(not ok).
It is followed by extra information: headers.
There is also optional body.
HTTP Request Deconstructed
METHOD location VERSION
Header1: Value1
Header2: Value2
body
HTTP Response Deconstructed
VERSION code MESSAGE
Header1: Value1
Header2: Value2
body
In Summary
Plain text format made of lines.
Lines are segmented by the CRLF characters.
Each part made of initial line, headers and a body.
Guarantees simple implementation across different technologies.
Some Observations
No authentication!
No encryption!
No sessions!
No streaming!
HTTP Develops
The spec is extended with HTTP/1.0and later HTTP/1.1.
Streaming, Authentication, Sessions, Virtual Hosts and more.
HTTP Authentication
There are several kinds: basic, digest, ntlm.
Basic auth is based around base64 encoding.
Digest is based around challange/response.
NTLM is proprietary protocol developed by Microsoft.
HTTP Encryption
A layer underneath HTTP called SSL.
SSL stands for Secure Socket Layer.
It works as a wrapper around sockets.
HTTP Sessions
The HTTP protocol is completely stateless.
Sessions enable state typically stored as cookies.
Cookies are a simple storage provided by the browser.
Cookies are restricted byte SOP (Same Origin Policies).
Cookies also have various security flags: httpOnlyand secure.
Enough?
There is so much more to learn.
Virtual Hosts
Initially one HTTP server per box.
This used to be very wasteful pre-virtualization era.
The hostheader was introduced to enable multiple sites per box.
Transport Mechanisms
Content-Length: <size>- the body has a length.
Transfer-Encoding: chunked- the body is made of chunks.
Transport Encodings
application/x-www-form-urlencodedis used for sending forms.
multipart/form-datais used for submitting files.
application/jsonis used for uploading/downloading json.
application/xmlis used for uploading/downloading xml.
Data Encodings
URL encoding: %followed by the hex representation of a character.
Entity encoding also known as XML encoding: &<entity>;.
Base64 encoding: everything is represented by 64 characters ASCII.
GET vs. POST
Here is a GETrequest where parameters are in the URL:
GET /path/delete.php?username=guest HTTP/1.1
Here is a POSTrequest where parameters are in the body:
POST /path/delete.php HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 14
username=guest
Sometimes GETand POSTare substitutable.
REST
Architectural style of programming predominately for APIs.
DELETE /username/guest HTTP/1.1
HTML
Hyper Text Markup Language
<html><head></head><body></body></html>
XML
Extensible Markup Language
<doc><element></element></doc>
JSON
JavaScript Object Notation
{"key": "value"}
Lab
We will learn how to apply all of this.
Simple Challenges
1. Make a simple GETrequest .
2. Make a simple POSTrequest .
⇢
⇢
Moderate Challenges
1. Make an authenticated request with basic auth .
2. Make an authenticated request with cookies .
3. Make a form data (file upload) request .
⇢
⇢
⇢
Advanced Challenges
1. Make a proxy request .⇢

More Related Content

PDF
SMB3 Offload Data Transfer (ODX)
PDF
Smb 3-odx-traffic
PDF
Nginx cheat sheet
PPTX
Charles guide sharing
PPTX
Metodologias de Programação IV - Aula 4, Secção 1 - Suporte para cache no pro...
PDF
Usint Charles Proxy to understand REST
PPT
Using MongoDB With Groovy
PPTX
SMB3 Offload Data Transfer (ODX)
Smb 3-odx-traffic
Nginx cheat sheet
Charles guide sharing
Metodologias de Programação IV - Aula 4, Secção 1 - Suporte para cache no pro...
Usint Charles Proxy to understand REST
Using MongoDB With Groovy

What's hot (20)

PPT
Java Development with MongoDB (James Williams)
PDF
sbt-ethereum: a terminal for the world computer
PPT
Introduction to redis
PPT
Lightweight DAS components in Perl
PDF
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
ODP
An Introduction to REDIS NoSQL database
PPTX
Maintaining Strong Consistency Semantics in a Horizontally Scalable and Highl...
PPTX
redis basics
PDF
API Design Workshop
PDF
PHP Streams: Lucky Dip
PDF
Ruby on embedded devices rug::b Aug 2014
PDF
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
PPTX
Redis Introduction
PDF
Relayd: a load balancer for OpenBSD
PPTX
Introduction to redis
PPTX
Redis/Lessons learned
PPTX
Webinar: Building Your First App
PPTX
PDF
Virtual host examples_-_apache_http_server
PPTX
Codable routing
Java Development with MongoDB (James Williams)
sbt-ethereum: a terminal for the world computer
Introduction to redis
Lightweight DAS components in Perl
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
An Introduction to REDIS NoSQL database
Maintaining Strong Consistency Semantics in a Horizontally Scalable and Highl...
redis basics
API Design Workshop
PHP Streams: Lucky Dip
Ruby on embedded devices rug::b Aug 2014
Briefly Rust - Daniele Esposti - Codemotion Rome 2017
Redis Introduction
Relayd: a load balancer for OpenBSD
Introduction to redis
Redis/Lessons learned
Webinar: Building Your First App
Virtual host examples_-_apache_http_server
Codable routing
Ad

Similar to Web Application Security 101 - 02 The Basics (20)

PDF
Communicating on the web
PPT
Http
PDF
HTTP In-depth
ODP
Starting With Php
PPTX
PPT
Http VS. Https
PPT
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
PPTX
Http-protocol
PPTX
PPTX
Http - All you need to know
PPT
HTTP.ppt
PPT
Hypertext Transfer Protocol Hypertext Transfer Protocol
PPT
HTTP_2.ppt
PPT
HTTP.ppt
PPT
HTTP (syper text transfer protocol)(6).ppt
PPTX
http presentation 1.pptx
PPT
Juglouvain http revisited
PPT
Http request&response session 1 - by Vignesh.N
PPT
KMUTNB - Internet Programming 2/7
PPT
Http request&response by Vignesh 15 MAR 2014
Communicating on the web
Http
HTTP In-depth
Starting With Php
Http VS. Https
HTTPProtocol HTTPProtocol.pptHTTPProtocol.ppt
Http-protocol
Http - All you need to know
HTTP.ppt
Hypertext Transfer Protocol Hypertext Transfer Protocol
HTTP_2.ppt
HTTP.ppt
HTTP (syper text transfer protocol)(6).ppt
http presentation 1.pptx
Juglouvain http revisited
Http request&response session 1 - by Vignesh.N
KMUTNB - Internet Programming 2/7
Http request&response by Vignesh 15 MAR 2014
Ad

More from Websecurify (12)

PDF
Security Challenges in Node.js
PDF
Secure Coding - Web Application Security Vulnerabilities and Best Practices
PDF
Unicode - Hacking The International Character System
PDF
Next Generation of Web Application Security Tools
PDF
Web Application Security 101 - 14 Data Validation
PDF
Web Application Security 101 - 12 Logging
PDF
Web Application Security 101 - 10 Server Tier
PDF
Web Application Security 101 - 07 Session Management
PDF
Web Application Security 101 - 06 Authentication
PDF
Web Application Security 101 - 05 Enumeration
PDF
Web Application Security 101 - 04 Testing Methodology
PDF
Web Application Security 101 - 03 Web Security Toolkit
Security Challenges in Node.js
Secure Coding - Web Application Security Vulnerabilities and Best Practices
Unicode - Hacking The International Character System
Next Generation of Web Application Security Tools
Web Application Security 101 - 14 Data Validation
Web Application Security 101 - 12 Logging
Web Application Security 101 - 10 Server Tier
Web Application Security 101 - 07 Session Management
Web Application Security 101 - 06 Authentication
Web Application Security 101 - 05 Enumeration
Web Application Security 101 - 04 Testing Methodology
Web Application Security 101 - 03 Web Security Toolkit

Recently uploaded (20)

PDF
E-Commerce Website Development Companyin india
PPTX
most interesting chapter in the world ppt
PPTX
MLforCyber_MLDataSetsandFeatures_Presentation.pptx
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PPTX
Computer Software - Technology and Livelihood Education
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PPTX
Introduction to Windows Operating System
PDF
MCP Security Tutorial - Beginner to Advanced
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
AI Guide for Business Growth - Arna Softech
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PDF
iTop VPN Crack Latest Version Full Key 2025
PPTX
Cybersecurity: Protecting the Digital World
E-Commerce Website Development Companyin india
most interesting chapter in the world ppt
MLforCyber_MLDataSetsandFeatures_Presentation.pptx
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Computer Software - Technology and Livelihood Education
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
Introduction to Windows Operating System
MCP Security Tutorial - Beginner to Advanced
Autodesk AutoCAD Crack Free Download 2025
DNT Brochure 2025 – ISV Solutions @ D365
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
How to Use SharePoint as an ISO-Compliant Document Management System
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
Advanced SystemCare Ultimate Crack + Portable (2025)
AI Guide for Business Growth - Arna Softech
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
iTop VPN Crack Latest Version Full Key 2025
Cybersecurity: Protecting the Digital World

Web Application Security 101 - 02 The Basics