SlideShare a Scribd company logo
HTTP Protocol & Streams
Security and Introduction
Protocol
HTTP(S) – 80/443
The HTTP Protocol
• Standard for transferring documents on the
World Wide Web (RFC 2616 – 1.1)
• TCP/IP based communications protocol
• The protocol is –
– connectionless
– media-independent
– stateless
– mostly all text
Sample HTTP exchange
• Browser = client, Web server = server
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
HTTP Request
HTTP/1.1 200 OK
Date: Thu, 14 Jul 2005 20:27:45 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Etag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes Content-Length: 438
Connection: close
Content-Type: text/html; charset=UTF-8
HTTP ResponseClient
Server
HTTP Request and Response
• Methods – GET, POST, HEAD
• New Methods in HTTP 1.1
• Header fields: Server, Host, Length, etc.
• Response codes – 200, 404, 500, etc.
HTTP Methods - Common
• The GET method
• The HEAD method
• The POST method
The GET Method
• retrieves entity identified by the Request-URI
• can be used to submit form data
– URL-encodes form data and appends to Request-
URI
• query length is limited
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
The POST method
• sends data block with request to server
• extra headers describe message body
• query length can be unlimited
POST http://example.com/cgi-bin/search.cgi HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0;
rv:1.7.3) Gecko/20040913 Firefox/0.10
Accept: text/xml, application/xml, application/xhtml+xml,
text/html;q=0.9, text/plain;q=0.8, image/png, */*;q=0.5
Keep-Alive: 300
Referer: http://example.com/
Content-Type: application/x-www-form-urlencoded
Content-Length: 17
search=searchtext
Analyzing HTTP traffic
• Security assessment needs sound knowledge
of HTTP analysis
• Tools and mind needed to analyze the traffic
• What to look for? – methods, cookie,
querysting etc.
• All part of HTTP – Response analysis is equally
important.
Other methods in HTTP/1.1
• Trace
– echoes back the received request
• used with Via: and Max-Forwards for debugging
• Put
– uploads a representation of specified resource
• Delete
– deletes the specified resource
• Options (Extensibility hook)
– returns HTTP methods supported by the server
HTTP Streams
Ajax
Ajax model
Transport layer
Browser
server-side systems
user interface
web server
Data stores,
backend processing,
legacy systems
HTTP request
HTML + CSS data
Browser
server-side systems
Ajax engine
web and/or XMLserver
Data stores,
backend processing,
legacy systems
HTTP request
XML Data
user interface
Classic web application model Ajax-enabled web application model
JavaScript call
HTML + CSS data
Ajax introduction
DOM
• Dynamic HTML
• Browser loads Document Object Model
• DOM can be manipulated by scripts in the
browser
• Components
– History
– Location
– Forms etc….
XHR object
• No Sockets in browser
• XHR – XMLHttpRequest Object provides
socket to browser.
• It has event model and async communication
setup
• XML easy data structures to access and
consume in browser
• JavaScript make a call and access it from
server through XHR
XHR - Ajax
function getajax()
{
var http;
if(window.XMLHttpRequest){
http = new XMLHttpRequest();
}else if (window.ActiveXObject){
http=new ActiveXObject("Msxml2.XMLHTTP");
if (! http){
http=new ActiveXObject("Microsoft.XMLHTTP");
}
}
http.open("GET", "./ajax.txt", true);
http.onreadystatechange = function()
{
if (http.readyState == 4) {
response = http.responseText;
document.getElementById('main').innerHTML = response;
}
}
http.send(null);
}
RIA
RIA
• Rich Internet Application can be created using
Flash technologies
• Various technologies through which
application can be created
• Supports various libraries
• Can make a call to Web Services or XML-RPC
calls etc.
Example
Silverlight
• Microsoft came up with similar framework
and player like flash
• It helps in building RIA
• It runs on .NET framework
• Easy to build applications and works across
platforms
• It may catch up down the line – still in very
early stage
Web 2.0 Data
Data structures
• Ajax is using various data streams
• Developers are innovating this field
• JavaScript can talk with back end sources
• Mashups application can be leveraged
• It is important to understand these streams
• It has significant security impact
JSON
• JSON (JavaScript Object Notation) - a
lightweight data-interchange format
• Based on JavaScript Programming Language
(Standard ECMA-262)
• Completely language independent
• C-family of languages, including C, C++, C#,
Java, JavaScript, Perl, Python, and many
others.
• Interchangeable is the Key.
JSON
• Example
{ "firstName": "John", "lastName": "Smith",
"address": { "streetAddress": "21 2nd Street",
"city": "New York", "state": "NY", "postalCode":
10021 }, "phoneNumbers": [ "212 732-1234", "646
123-4567" ] }
XML
• XML stream can be accessed by Ajax call
• It can be Web Services
• XML parsing done at browser end
• XHR object supports XML response handling
• XML nodes are extracted and injected in the
DOM
• XML is becoming popular with Web 2.0
applications
Script as data
• Developers are using script as data between
server and clients
• Information sent to the browser as variable
set
• These script get executed on the browser.
• This is another way of updating DOM context
• DOM manipulation needs eval()
Array serialization
• Array is another native JavaScript object
• It is possible to serialize this object over
application
• Browser extract the array from the server
• Inject information to the DOM
• DOM updates the browser
• Array is popular and easy to exchange
JS-Object serialization
• JS object are possible to serialize
• This way entire object can be sent to the
browser
• Object can contain both data and methods
• This is much easier for browser to process
• It just inject object to the DOM
• Once it is in the DOM it is easier to update the
browser content
Conclusion

More Related Content

PPT
Source Code Analysis with SAST
PPT
AppSec 2007 - .NET Web Services Hacking
PPT
XPATH, LDAP and Path Traversal Injection
PDF
RESTful web
PPTX
REST & RESTful Web Service
PPT
HTML5 hacking
PPTX
Overview of RESTful web services
PPT
Web 2.0 Application Kung-Fu - Securing Ajax & Web Services
Source Code Analysis with SAST
AppSec 2007 - .NET Web Services Hacking
XPATH, LDAP and Path Traversal Injection
RESTful web
REST & RESTful Web Service
HTML5 hacking
Overview of RESTful web services
Web 2.0 Application Kung-Fu - Securing Ajax & Web Services

What's hot (20)

PPTX
Introductiontowebarchitecture 090922221506-phpapp01
PPTX
Webservice for android ppt
PPT
Excellent rest using asp.net web api
PPTX
HTTP fundamentals for developers
PPTX
Rest & RESTful WebServices
ODP
Things I wish web graduates knew
PPTX
Http - All you need to know
PPTX
ASP.NET WEB API
KEY
Designing a RESTful web service
PPTX
01. http basics v27
PDF
Server-Side Programming Primer
PDF
Intoduction to php web services and json
PPTX
Restful web services ppt
PDF
OAuth: Trust Issues
PDF
Web Services Tutorial
PPTX
Basics of the Web Platform
PPTX
Soap and restful webservice
PDF
RESTful Web Services
PPT
Json-based Service Oriented Architecture for the web
PDF
SOAP-based Web Services
Introductiontowebarchitecture 090922221506-phpapp01
Webservice for android ppt
Excellent rest using asp.net web api
HTTP fundamentals for developers
Rest & RESTful WebServices
Things I wish web graduates knew
Http - All you need to know
ASP.NET WEB API
Designing a RESTful web service
01. http basics v27
Server-Side Programming Primer
Intoduction to php web services and json
Restful web services ppt
OAuth: Trust Issues
Web Services Tutorial
Basics of the Web Platform
Soap and restful webservice
RESTful Web Services
Json-based Service Oriented Architecture for the web
SOAP-based Web Services
Ad

Similar to HTTP protocol and Streams Security (20)

PPTX
Introduction to Web Architecture
PPTX
Evolution Of The Web Platform & Browser Security
PDF
Web 2.0 Patterns and Technologies - Lecture 07 - Web Information Systems (401...
PDF
CNIT 129S: Ch 3: Web Application Technologies
PDF
CNIT 129S - Ch 3: Web Application Technologies
PPTX
computer network introduction. psc notes . Assisant professor in cse.
PDF
Web architecturesWeb architecturesWeb architectures
PPT
Web Services 2009
PPT
Web Services 2009
ODP
PHP Training: Module 1
PPTX
World wide web architecture presentation
PPTX
Http
PDF
Unit v
ODP
Starting With Php
PPTX
Www and http
PPT
Ch-1_.ppt
PPTX
WEB TECHNOLOGY Unit-5.pptx
PPT
KMUTNB - Internet Programming 2/7
PPTX
http presentation 1.pptx
PDF
Communicating on the web
Introduction to Web Architecture
Evolution Of The Web Platform & Browser Security
Web 2.0 Patterns and Technologies - Lecture 07 - Web Information Systems (401...
CNIT 129S: Ch 3: Web Application Technologies
CNIT 129S - Ch 3: Web Application Technologies
computer network introduction. psc notes . Assisant professor in cse.
Web architecturesWeb architecturesWeb architectures
Web Services 2009
Web Services 2009
PHP Training: Module 1
World wide web architecture presentation
Http
Unit v
Starting With Php
Www and http
Ch-1_.ppt
WEB TECHNOLOGY Unit-5.pptx
KMUTNB - Internet Programming 2/7
http presentation 1.pptx
Communicating on the web
Ad

More from Blueinfy Solutions (18)

PDF
Mobile Application Scan and Testing
PDF
Mobile security chess board - attacks & defense
PPT
Mobile code mining for discovery and exploits nullcongoa2013
PPT
iOS Application Security Testing
PPT
Html5 on mobile
PPT
Android secure coding
PPT
Android attacks
PPT
Automation In Android & iOS Application Review
PPT
Web Services Hacking and Security
PDF
CSRF, ClickJacking & Open Redirect
PPT
XSS - Attacks & Defense
PPT
Defending against Injections
PPT
Blind SQL Injection
PPT
Application fuzzing
PPT
SQL injection basics
PPT
Applciation footprinting, discovery and enumeration
PPT
Assessment methodology and approach
PPT
Advanced applications-architecture-threats
Mobile Application Scan and Testing
Mobile security chess board - attacks & defense
Mobile code mining for discovery and exploits nullcongoa2013
iOS Application Security Testing
Html5 on mobile
Android secure coding
Android attacks
Automation In Android & iOS Application Review
Web Services Hacking and Security
CSRF, ClickJacking & Open Redirect
XSS - Attacks & Defense
Defending against Injections
Blind SQL Injection
Application fuzzing
SQL injection basics
Applciation footprinting, discovery and enumeration
Assessment methodology and approach
Advanced applications-architecture-threats

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
 
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
 
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
 
Chapter 3 Spatial Domain Image Processing.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A Presentation on Artificial Intelligence
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
CIFDAQ's Market Insight: SEC Turns Pro Crypto
 
Advanced methodologies resolving dimensionality complications for autism neur...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectral efficient network and resource selection model in 5G networks
Encapsulation_ Review paper, used for researhc scholars
The Rise and Fall of 3GPP – Time for a Sabbatical?
 
NewMind AI Monthly Chronicles - July 2025
Machine learning based COVID-19 study performance prediction
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Unlocking AI with Model Context Protocol (MCP)
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
 

HTTP protocol and Streams Security

  • 1. HTTP Protocol & Streams Security and Introduction
  • 3. The HTTP Protocol • Standard for transferring documents on the World Wide Web (RFC 2616 – 1.1) • TCP/IP based communications protocol • The protocol is – – connectionless – media-independent – stateless – mostly all text
  • 4. Sample HTTP exchange • Browser = client, Web server = server GET /index.html HTTP/1.1 Host: www.example.com User-Agent: Mozilla/5.0 HTTP Request HTTP/1.1 200 OK Date: Thu, 14 Jul 2005 20:27:45 GMT Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT Etag: "3f80f-1b6-3e1cb03b" Accept-Ranges: bytes Content-Length: 438 Connection: close Content-Type: text/html; charset=UTF-8 HTTP ResponseClient Server
  • 5. HTTP Request and Response • Methods – GET, POST, HEAD • New Methods in HTTP 1.1 • Header fields: Server, Host, Length, etc. • Response codes – 200, 404, 500, etc.
  • 6. HTTP Methods - Common • The GET method • The HEAD method • The POST method
  • 7. The GET Method • retrieves entity identified by the Request-URI • can be used to submit form data – URL-encodes form data and appends to Request- URI • query length is limited GET /index.html HTTP/1.1 Host: www.example.com User-Agent: Mozilla/5.0
  • 8. The POST method • sends data block with request to server • extra headers describe message body • query length can be unlimited POST http://example.com/cgi-bin/search.cgi HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; rv:1.7.3) Gecko/20040913 Firefox/0.10 Accept: text/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8, image/png, */*;q=0.5 Keep-Alive: 300 Referer: http://example.com/ Content-Type: application/x-www-form-urlencoded Content-Length: 17 search=searchtext
  • 9. Analyzing HTTP traffic • Security assessment needs sound knowledge of HTTP analysis • Tools and mind needed to analyze the traffic • What to look for? – methods, cookie, querysting etc. • All part of HTTP – Response analysis is equally important.
  • 10. Other methods in HTTP/1.1 • Trace – echoes back the received request • used with Via: and Max-Forwards for debugging • Put – uploads a representation of specified resource • Delete – deletes the specified resource • Options (Extensibility hook) – returns HTTP methods supported by the server
  • 12. Ajax
  • 13. Ajax model Transport layer Browser server-side systems user interface web server Data stores, backend processing, legacy systems HTTP request HTML + CSS data Browser server-side systems Ajax engine web and/or XMLserver Data stores, backend processing, legacy systems HTTP request XML Data user interface Classic web application model Ajax-enabled web application model JavaScript call HTML + CSS data
  • 15. DOM • Dynamic HTML • Browser loads Document Object Model • DOM can be manipulated by scripts in the browser • Components – History – Location – Forms etc….
  • 16. XHR object • No Sockets in browser • XHR – XMLHttpRequest Object provides socket to browser. • It has event model and async communication setup • XML easy data structures to access and consume in browser • JavaScript make a call and access it from server through XHR
  • 17. XHR - Ajax function getajax() { var http; if(window.XMLHttpRequest){ http = new XMLHttpRequest(); }else if (window.ActiveXObject){ http=new ActiveXObject("Msxml2.XMLHTTP"); if (! http){ http=new ActiveXObject("Microsoft.XMLHTTP"); } } http.open("GET", "./ajax.txt", true); http.onreadystatechange = function() { if (http.readyState == 4) { response = http.responseText; document.getElementById('main').innerHTML = response; } } http.send(null); }
  • 18. RIA
  • 19. RIA • Rich Internet Application can be created using Flash technologies • Various technologies through which application can be created • Supports various libraries • Can make a call to Web Services or XML-RPC calls etc.
  • 21. Silverlight • Microsoft came up with similar framework and player like flash • It helps in building RIA • It runs on .NET framework • Easy to build applications and works across platforms • It may catch up down the line – still in very early stage
  • 23. Data structures • Ajax is using various data streams • Developers are innovating this field • JavaScript can talk with back end sources • Mashups application can be leveraged • It is important to understand these streams • It has significant security impact
  • 24. JSON • JSON (JavaScript Object Notation) - a lightweight data-interchange format • Based on JavaScript Programming Language (Standard ECMA-262) • Completely language independent • C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. • Interchangeable is the Key.
  • 25. JSON • Example { "firstName": "John", "lastName": "Smith", "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": 10021 }, "phoneNumbers": [ "212 732-1234", "646 123-4567" ] }
  • 26. XML • XML stream can be accessed by Ajax call • It can be Web Services • XML parsing done at browser end • XHR object supports XML response handling • XML nodes are extracted and injected in the DOM • XML is becoming popular with Web 2.0 applications
  • 27. Script as data • Developers are using script as data between server and clients • Information sent to the browser as variable set • These script get executed on the browser. • This is another way of updating DOM context • DOM manipulation needs eval()
  • 28. Array serialization • Array is another native JavaScript object • It is possible to serialize this object over application • Browser extract the array from the server • Inject information to the DOM • DOM updates the browser • Array is popular and easy to exchange
  • 29. JS-Object serialization • JS object are possible to serialize • This way entire object can be sent to the browser • Object can contain both data and methods • This is much easier for browser to process • It just inject object to the DOM • Once it is in the DOM it is easier to update the browser content