ms innovation day: a lap around web application vulnerabilities by mvp walter wong

36
Lap Around Web Application Vulnerabilities Walter Wong MVP – Visual Developer (Security) [email protected] http://spaces.live.com/ walterwws

Upload: quek-lilian

Post on 14-May-2015

670 views

Category:

Technology


1 download

DESCRIPTION

A live hacking session demonstrating the different tools and techniques used by hackers and an in-depth understanding of the problems of insecure application and the solutions to solve the vulnerability.

TRANSCRIPT

Page 1: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Lap Around Web Application Vulnerabilities

Walter WongMVP – Visual Developer (Security)[email protected]://spaces.live.com/walterwws

Page 2: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Top 10 Web Application vulnerabilities in 2007

•Cross-site Scripting (XSS)

1

•Injection Flaws

2

•Malicious File Execution

3

•Insecure Direct Object Reference

4

•Cross Site Request Forgery

5

•Information Leakage and Improper Error Handling

6

•Broken Authentication and Session Management

7

•Insecure Cryptographic Storage

8

•Insecure Communications

9

•Failure to Restrict URL Access

10

Source: http://www.owasp.org/index.php/top_10_2007

Page 3: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Agenda

The foundation of attackAdvance attack techniquesObfuscationAutomated Testing

Page 4: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Foundation of attack

Application attack also known as “layer 7 attack”Program is just a set of instruction.Developer is the key protectorAll input is evil (Writing Secure Code by Michael Howard and David LeBlanc)

Page 5: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

3 basic techniques

Path Traversal

Cross-site Scripting

SQL Injection

Page 6: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

SQL Injection

Build SQL statement using string concatenationAttacker change the semantics of SQL queryDeveloper prefer string concatenation because is easy but they also known the safer method but requires more thought

Page 7: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Scenario #1

Attacker submit specially crafted input when performing search

Page 8: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

SQL Injection

Page 9: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Date : 12 June 2008

http://www.lowyat.net

Page 10: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

3 basic techniques

Path Traversal

Cross-site Scripting

SQL Injection

Page 11: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Cross-site Scripting (XSS)

How it works?1. Take input from user2. Fails to validate input3. Echoes input directly to web page4. Done!

Page 12: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Scenario #2

When developer using

<%# DataBinder.Eval(Container.DataItem, “Column1”) %>

to bind data in Datalist.

Page 13: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Cross-Site Scripting (XSS)

Page 14: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

3 basic techniques

Path Travers

al

Cross-site

Scripting

SQL Injectio

n

Page 15: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Path Traversal

Access files that application not intend to accessTo read any files in the systemUsing “dot-dot-slash” to backtrack the folder

Example:http://app.com/GetImage.aspx?file=..\..\windows\repair\sam

Page 16: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Scenario #3

To prevent “Resource cannot be found”, developer create a page to check whether the picture file it exist or not. If doesn’t exist it will show the generic image.

Page 17: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Path Traversal

Page 18: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Advance Technique

Utilizing the basic attack techniquesAble to unveil a lot of privacy information of serversExample:

WMI AttackHost File Hijacking

Page 19: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

WMI Attack

WMI = Windows Management InstrumentationWMI is a essential tools for IT Administrator to manage the servers and workstationsDamages:

Retrieve server’s information Remotely uninstall application

Page 20: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Scenario #4

Attack retrieve the software installed in web server and uninstall the software.

Page 21: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

WMI Attack

Page 22: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Host File Hijacking

Windows rely on DNS and Host file to resolve the target IP addressHost file location : %windir%\system32\drivers\etc\hostsDamages:

Corrupt the host file so it can redirect the data to malicious server

Page 23: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Scenario #5

Attacker redirect the traffic for www.abc.com to different IP address. Imagine a antivirus application refer the wrong IP address to download the latest signature file.

Page 24: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Host File Hijacking

Page 25: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Obfuscation

The default .Net assembly format allow developer to disassemble and decompile.Obfuscate is a process to rebuilds the .Net assembly into a new format that is impossible to dissemble, decompile and difficult to understand.Prevent competitors and hackers from getting your source code.

Page 26: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Scenario #6

Attacker download the .Net assembly through Path Traversal attack. He successfully dissemble and decompile the assembly. Attacker now able to view all the logic behind the source code.

Page 27: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Obfuscator

Page 28: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Automated Testing

Develop your own testing tools Automate your testing processVisual Studio Tester Edition have a capability to do automated testing

Page 29: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

The Dark Side……

Brutal Force attack are using the same techniqueIt is a common attack to “try” out passwordTo prevent such attack, identify the source.

MAC AddressIP AddressLogin username

Page 30: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Scenario #7

Develop a simple application to automate the brutal force attack on wireless router.

Page 31: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Automate the task

Page 32: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

Steps to Defense Against Attackers

Validate both client-side and server-side inputDuplicated the validation functions in both client-side and server sideNO SQL Injection – use Parameter class in .NetNO XSS – Validate Input, Validate Output (VIVO)Obfuscate your code TODAY!Be innovative and creative in testing

Page 34: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

ResourcesRequired slide

Visit My Blog athttp://spaces.live.com/walterwws

Page 35: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

ResourcesRequired slide

Visit My Pagecast athttp://www.pageflakes.com/walterw

Page 36: MS Innovation Day: A Lap Around Web Application Vulnerabilities by MVP Walter Wong

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED

OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.