14
Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer Engineering JavaScript Injection and Web Hacking Techniques

Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Embed Size (px)

Citation preview

Page 1: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

Juan O’ConnellJustin Rand

ECE 4112 Group 19May 1, 2007

Georgia Institute of TechnologyCollege of Engineering

School of Electrical and Computer Engineering

JavaScript Injection and Web Hacking Techniques

Page 2: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

•Motivation

•To learn more about web security

•Analyze rather than double click

•There is no set path to assess vulnerabilities

•JavaScript is used in millions of web pages

•Supplement from Lab 9

•It is easy to learn!

Page 3: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

•What is JavaScript?

•JavaScript is a dynamic scripting language that supports prototype based object construction

•Developed by Netscape

•Adds additional interaction between the web site and its visitors

•JavaScript is the most popular scripting language on the internet.

Page 4: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

• PkCrack – Cracking PkZip Encryption• Known plaintext attack

– Need unencrypted file

• Command line program– \PkCrack> pkcrack -C -c -P -p -d

» -C <encrypted .ZIP>

» -c <encrypted file>

» -P <plaintext .ZIP>

» -p <plaintext file>

» -d <cracked .ZIP>

Page 5: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

•Lab Layout

•Section 0: Setup

•Section 1: JavaScript

•Section 1.1 – The Basics: JavaScript Tutorial

•Section 1.2 – JavaScript Injection

•Section 1.3 – Vulnerability Assessment of Guest Books

•Section 2 - “Realistic” Web Hack

Page 6: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

•Section 1.2 Demo

•Variable change

•http://www.prism.gatech.edu/~gtg131v/4112/

•The code <javascript:c=5;>

•Grandma’s Cookie

•http://www.prism.gatech.edu/~gtg131v/4112/

•The code<javascript:void:(document.cookie=”Authorized=true”);javascript:alert(document.cookie);>

Page 7: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

•Section 1.3 Real Demo

•Guest Book

•http://www.legacy.com/Atlanta/Obituaries.asp

•Assessment code <u> some text </u> <plaintext>

•Injection<img src="asdf" onerror="alert('Welcome!')"/>

•Get Creative!<img src="asdf" onerror=" void(window.location=('http://www.ece.gatech.edu'))"/>

Page 8: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

•Solutions

•JavaScript Injection•Always validate the input received against a white list •Do not rely on client side validation to validate the user input

•Validate the input every time

•Guest Books•Use a code filter!

Page 9: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

• Section 2 – “Realistic” Web Hack• Search page source for hidden directory

• Download critical file

• Exploit using PkCrack

• From here?

Page 10: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

Page 11: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

Page 12: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

• Solution• Limit Directory access

• Apache can use .htaccess and .htpasswd– Must change httpd.conf

» AllowOverride AuthConfig

– Create .htaccess in the directory you want to protect» Will reference .htpasswd and ask for authorization

Page 13: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

• References– [1] http://www.hackthissite.org

Page 14: Group 19 Juan O’Connell Justin Rand ECE 4112 Group 19 May 1, 2007 Georgia Institute of Technology College of Engineering School of Electrical and Computer

Group 19

?Questions