Web Hacking 1. Overview Why web HTTP Protocol HTTP Attacks 2.

Slides:



Advertisements
Similar presentations
World Wide Web Basics Original version by Carolyn Watters (Dalhousie U. Computer Science)
Advertisements

HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
Hypertext Transfer Protocol Kyle Roth Mark Hoover.
1 HTTP – HyperText Transfer Protocol Part 1. 2 Common Protocols In order for two remote machines to “ understand ” each other they should –‘‘ speak the.
CS320 Web and Internet Programming Generating HTTP Responses
16-Jun-15 HTTP Hypertext Transfer Protocol. 2 HTTP messages HTTP is the language that web clients and web servers use to talk to each other HTTP is largely.
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
How the web works: HTTP and CGI explained
Data and Computer Communications Eighth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 23 – Internet Applications Internet Directory.
Definitions, Definitions, Definitions Lead to Understanding.
CS 142 Lecture Notes: HTTPSlide 1 HTTP Request GET /index.html HTTP/1.1 Host: User-Agent: Mozilla/5.0 Accept: text/html, */* Accept-Language:
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
Hypertext Transport Protocol CS Dick Steflik.
Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server yahoo.com/finance.html A text file named finance.html.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
Introduction to Web Programming Fall 2014/2015 Some slides are based upon Web Technologies course slides, HUJI, 2009 Extended System Programming Laboratory.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
HTTP and Server Security James Walden Northern Kentucky University.
COMP3016 Web Technologies Introduction and Discussion What is the Web?
FTP (File Transfer Protocol) & Telnet
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
HTTP Reading: Section and COS 461: Computer Networks Spring
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CSC 2720 Building Web Applications Getting and Setting HTTP Headers (With PHP Examples)
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
2: Application Layer1 CS 4244: Internet Software Development Dr. Eli Tilevich.
Application Layer 2 Figures from Kurose and Ross
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
Introduction 1 Lecture 6 Application Layer (HTTP) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Sistem Jaringan dan Komunikasi Data #9. DNS The Internet Directory Service  the Domain Name Service (DNS) provides mapping between host name & IP address.
WWW, HTTP, GET, POST, Cookies Svetlin Nakov Telerik Corporation
IT Engineering Instructor: Rezvan Shiravi
WebServer A Web server is a program that, using the client/server model and the World Wide Web's Hypertext Transfer Protocol (HTTP), serves the files that.
The HyperText Transfer Protocol. History HTTP has been in use since 1990 (HTTP/0.9) HTTP/1.0 was defined in RFC 1945 (May 1996) and included metainformation.
HyperText Transfer Protocol (HTTP) RICHI GUPTA CISC 856: TCP/IP and Upper Layer Protocols Fall 2007 Thanks to Dr. Amer, UDEL for some of the slides used.
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
Application Layer 2-1 Chapter 2 Application Layer 2.2 Web and HTTP.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
Application Layer 2-1 Lecture 4: Web and HTTP. Web and HTTP First, a review… web page consists of objects object can be HTML file, JPEG image, Java applet,
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
Advance Computer Networks Lecture#05 Instructor: Engr. Muhammad Mateen Yaqoob.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting HTTP.
Web Technologies Lecture 1 The Internet and HTTP.
HTTP Here, we examine the hypertext transfer protocol (http) – originally introduced around 1990 but not standardized until 1997 (version 1.0) – protocol.
Web Services. 2 Internet Collection of physically interconnected computers. Messages decomposed into packets. Packets transmitted from source to destination.
EE 122: Lecture 21 (HyperText Transfer Protocol - HTTP) Ion Stoica Nov 20, 2001 (*)
Overview of Servlets and JSP
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
Computer Networks with Internet Technology William Stallings Chapter 04 Modern Applications 4.1 Web Access - HTTP.
LURP Details. LURP Lab Details  1.Given a GET … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl.
COMP2322 Lab 2 HTTP Steven Lee Jan. 29, HTTP Hypertext Transfer Protocol Web’s application layer protocol Client/server model – Client (browser):
Web Caching. Why Caching? Faster browsing experience for users Cache hit rate Traffic Prioritization Reduce network bandwidth requirements significantly.
Data and Computer Communications Eighth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 23 – Internet Applications Internet Directory.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
INTRODUCTION Dr Mohd Soperi Mohd Zahid Semester /16.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
HTTP Protocol Amanda Burrows. HTTP Protocol The HTTP protocol is used to send HTML documents through the Internet. The HTTP protocol sends the HTML documents.
What’s Really Happening
HTTP – An overview.
The Hypertext Transfer Protocol
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
Hypertext Transfer Protocol
William Stallings Data and Computer Communications
Presentation transcript:

Web Hacking 1

Overview Why web HTTP Protocol HTTP Attacks 2

Why Web Attacks? HTTP is the largest fraction of Internet traffic Web (with ) is most common application service imported by local networks More and more devices web enabled or configured Wide range of web attacks available Attacks on other services (such as DNS) may make things worse 3

HTTP as a Protocol Protocol is simple Almost entirely stateless Client makes requests Server responds Originally intended to serve static web pages Lots of extensions and applications: dynamic content, forms, multipart pages, video, sound, device control, etc. 4

HyperText Transfer Protocol TCP/80 or TCP/8080 Request/Response Stateless (almost) – Cookies give context Requests: request-line headers (host) empty line optional message Request-line: ● GET url ● TRACE url ● PUT url ● OPTIONS ● HEAD url ● POST url ● DELETE url ● CONNECT Response: Status line (404, 200) Message (data) 5 5

Sample HTTP Request GET / HTTP/1.1\r\n Host: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: ) Gecko/ Ubuntu/9.04 (jaunty) Firefox/3.0.8\r\n Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n Accept-Language: en-us,en;q=0.5\r\n Accept-Encoding: gzip,deflate\r\n Accept-Charset: ISO ,utf-8;q=0.7,*;q=0.7\r\n Keep-Alive: 300\r\n Connection: keep-alive\r\n Cookie: PREF=ID=d4889c595edad968:U=3ee2d547a0ff8080:TM= :LM= :S=_-MsPCamw5andO8z; NID=25=Es3pZDrhYCrlhBGm5fJ1Qk7WRNj2gxN- pVzn9z71NGmvJlttvdGEBGbEbnWi10E9KS1AuTdcggT63Yqb9jXUjdnebA7ctOQy- rnY_kPv4WtmGGeDr7onrxKJfbadEW_o\r\n \r\n Start line Blank line Header lines 6 6

Sample HTTP Response HTTP/ OK\r\n Cache-Control: private, max-age=0\r\n Date: Wed, 29 Jul :19:14 GMT\r\n Expires: -1\r\n Content-Type: text/html; charset=UTF-8\r\n Content-Encoding: gzip\r\n Server: gws\r\n Content-Length: 3272\r\n \r\n Google window.google={kEI:"Qj5wSv3GEo yQ8gTKvr2qBQ",kEXPI:"17259,18167,20760",kCSIE:"17259,18167,2 0760",kCSI:{e…..etc. Start line Header lines Blank line Message body 7 7

HTTP Attacks Some use of HTTP as an after-attack carrier – Beaconing – Exfiltration – Command traffic Attacks – Information gathering – Script injection – CGI-bin – HTTP Response Splitting 8

Information Gathering Header fields Behavior analysis Directory traversal 9

Header fields Server fields: Server, Via, X-powered-by, version Client fields: Client, Referer, X-wap-profile Software Versions Formatting files Directory structures Common communication partners 10

Behavior Analysis Protocol is not identically supported by server software and operating system stack Particularly true for erroneous requests Can build understanding of which version of software, in some cases, which patch level 11

Directory traversal GET../../../../../../../../../etc/passwd HTTP/1.0\r\n After attacker finds useful binaries, execute them directly create new user shimeall”… Variety of different compromise and engineering attacks 12

Script Injection Placing special characters into input data Exploits inputs lacking validation checks SQL most common injection, attacking databases 13

Dangers of Script Injection Any site that uses database – Gain admin access – Modify existing data – Enter new data – Disclose data – Destroy data Also possible in HTTP GET/POST commands, some header fields 14

Doing Script Injection Put a single quote at end of input If application error, site is vulnerable Example URL and resulting query SELECT * FROM users WHERE username=‘admin’ and password=‘password’; Example malicious URL and resulting query or ‘1’=‘1&password=foo’ or ‘1’=‘1 SELECT * FROM users WHERE username=‘foo’ or ‘1’=‘1’ and password=‘foo’ or ‘1’=‘1’; – forces selection of valid username and password 15

CGI-bin Craft URLs that invoke support scripts for malicious effect ubject=“create new user shimeall”… Find scripts via directory traversal or examination of web page source Lots of technical and user-directed attacks possible 16

HTTP Response Splitting Can exist in any site that makes use of user input to generate the values of some headers in server responses Can be used for – Web cache poisoning target: reverse proxy – goal: internet-wide defacement target: intermediate cache server – goal: phishing – cross-user defacement target: single browser – goal: targeted phishing 17

Normal Redirection Page 18 Example redirection page at /redir_lang.jsp <% response.sendRedirect("/by_lang.jsp?lang="+ request.getParameter("lang")); %> Example snippet of a redirection response for /redir_lang.jsp?lang=English HTTP/ Moved Temporarily [CRLF] Date: Wed, 24 Dec :53:28 GMT [CRLF] Location: [CRLF] Server: WebLogic XMLX Module 8.1 SP1 Fri Jun 20 23:06:40 [CRLF] …  User input to the lang parameter is embedded in the Location header

Malicious Input 19 Example malicious input /redir_lang.jsp?lang=foobar%0d%0aContent- Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent- Type:%20text/html%0d%0aContent- Length:%2019%0d%0a%0d%0a Shazam  %0d%0a is URL-encoded CRLF  This would be funneled through the target along with a request to a resource that the attacker wants to control.

Example Split Response 20 HTTP/ Moved Temporarily [CRLF] Date: Wed, 24 Dec :26:41 GMT [CRLF] Location: [CRLF] Content-Length: 0 [CRLF] [CRLF] HTTP/ OK [CRLF] Content-Type: text/html [CRLF] Content-Length: 19 [CRLF] [CRLF] Shazam Server: WebLogic XMLX Module 8.1 SP1 Fri Jun 20 23:06:40 [CRLF] [Garbage…] /redir_lang.jsp?lang=foobar%0d%0aContent- Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK% 0d%0aContent- Type:%20text/html%0d%0aContent- Length:%2019%0d%0a%0d%0a Shazam

Summary Simple protocol Widest used protocol Growing in popularity among attackers – lots of opportunities – relatively easy to conduct – cookies, server configuration, client configuration, trust Hard to detect Effective 21