Large-scale application security Charlie Eriksen.

Slides:



Advertisements
Similar presentations
Attention (your target market) !. Are you (their problem) ?
Advertisements

Test process essentials Riitta Viitamäki,
© 2008 All Right Reserved Fortify Software Inc. Hybrid 2.0 – In search of the holy grail… A Talk for OWASP BeNeLux by Roger Thornton Founder/CTO Fortify.
Engineering Secure Software. The Power of Source Code  White box testing Testers have intimate knowledge of the specifications, design, Often done by.
©2014 Bit9. All Rights Reserved Building a Continuous Response Architecture.
Fuzzing Dan Fleck CS 469: Security Engineering Sources:
Software Testing. Overview Definition of Software Testing Problems with Testing Benefits of Testing Effective Methods for Testing.
©2009 Justin C. Klein Keane PHP Code Auditing Session 6 Auditing Strategies & Demonstration Justin C. Klein Keane
1 Psych 5500/6500 The t Test for a Single Group Mean (Part 5): Outliers Fall, 2008.
Chapter 3.1 Teams and Processes. 2 Programming Teams In the 1980s programmers developed the whole game (and did the art and sounds too!) Now programmers.
Pertemuan Matakuliah: A0214/Audit Sistem Informasi Tahun: 2007.
Principle of Functional Verification Chapter 1~3 Presenter : Fu-Ching Yang.
Static Code Analysis and Governance Effectively Using Source Code Scanners.
BUILDING A SECURE STANDARD LIBRARY Information Assurance Project I MN Tajuddin hj. Tappe Supervisor Mdm. Rasimah Che Mohd Yusoff ASP.NET TECHNOLOGY.
Get Complete IT Compliance: Reduce Risk and Cost Jonathan CISO, Qualys Seth Automation Specialist, BMC.
Presenter Deddie Tjahjono.  Introduction  Website Application Layer  Why Web Application Security  Web Apps Security Scanner  About  Feature  How.
Terms: Test (Case) vs. Test Suite
Introduction Our Topic: Mobile Security Why is mobile security important?
Brad Baker CS526 May 7 th, /7/ Project goals 2. Test Environment 3. The Problem 4. Some Solutions 5. ModSecurity Overview 6. ModSecurity.
1. Topics to be discussed Introduction Objectives Testing Life Cycle Verification Vs Validation Testing Methodology Testing Levels 2.
Prepared By, Mahadir Ahmad. StopBadware makes the Web safer through the prevention, mitigation, and remediation of badware websites. partners include.
Information Systems Security Computer System Life Cycle Security.
Introduction Optimizing Application Performance with Pinpoint Accuracy What every IT Executive, Administrator & Developer Needs to Know.
Approaches to Application Security – DSM
A Framework for Automated Web Application Security Evaluation
Automatically Hardening Web Applications Using Precise Tainting Anh Nguyen-Tuong Salvatore Guarnieri Doug Greene Jeff Shirley David Evans University of.
Ryan Dewhurst - 20th March 2012 Web Application (PHP) Security.
ICAPRG301A Week 4Buggy Programming ICAPRG301A Apply introductory programming techniques Program Bugs US Navy Admiral Grace Hopper is often credited with.
Version 02U-1 Computer Security: Art and Science1 Penetration Testing by Brad Arkin Scott Stender and Gary McGraw.
DYNAMIC VALIDITY PERIOD CALCULATION OF DIGITAL CERTIFICATES BASED ON AGGREGATED SECURITY ASSESSMENT By Alexander Beck Jens Graupmann Frank Ortmeier.
Mark Aslett Microsoft Introduction to Application Compatibility.
© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. 1 RubyJax Brent Morris/
Application Security Testing A practitioner’s rambling advice & musings.
An Ad Hoc Writable Rule Language for White-Box Security Scanners Author:Sebastian Schinzel Referent:Prof. Dr. Alexander del Pino Korreferent:Prof. Dr.
Auditing IT Vulnerabilities IT vulnerabilities are weaknesses or exposures in IT assets or processes that may lead to a business risk or security risk.
Using BackTrack to Discover Cisco Vulnerabilities Brian Compton College of Technology – University of Houston Using BackTrack to Discover Cisco Vulnerabilities.
1 ITGD 2202 Supervision:- Assistant Professor Dr. Sana’a Wafa Al-Sayegh Dr. Sana’a Wafa Al-SayeghStudent: Anwaar Ahmed Abu-AlQumboz.
Knowing What You Missed Forensic Techniques for Investigating Network Traffic.
1 Security Penetration Testing Angela Davis Mrinmoy Ghosh ECE4112 – Internetwork Security Georgia Institute of Technology.
Web Applications Testing By Jamie Rougvie Supported by.
Legitimate Vulnerability Markets By: Jeff Wheeler.
Security Vulnerabilities Linda Cornwall, GridPP15, RAL, 11 th January 2006
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
1 Legacy Code From Feathers, Ch 2 Steve Chenoweth, RHIT Right – Your basic Legacy, from Subaru, starting at $ 20,295, 24 city, 32 highway.
1 Software Engineering and Security DJPS April 12, 2005 Professor Richard Sinn CMPE 297: Software Security Technologies.
1 CEN 4072 Software Testing PPT12: Fixing the defect.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Software Quality Assurance and Testing Fazal Rehman Shamil.
SQL Injection Josh Mann. What is SQL Injection  SQL injection is a technique for exploiting web applications that use client-supplied data in SQL queries.
TUF: Secure Software Updates Justin Cappos NYU Poly Computer Science and Engineering.
Final Project: Advanced Security Blade IPS and DLP blades.
Introduction SQL Injection is a very old security attack. It first came into existence in the early 1990's ex: ”Hackers” movie hero does SQL Injection.
Lecture 16 Page 1 CS 236 Online Evaluating Program Security What if your task isn’t writing secure code? It’s determining if someone else’s code is secure?
Vulnerability Management Programs & The Lessons Learned
Javascript worms By Benjamin Mossé SecPro
Security Testing Methods
Evaluating Existing Systems
^ About the.
Evaluating Existing Systems
Outline Introduction Characteristics of intrusion detection systems
A Security Review Process for Existing Software Applications
Evaluating Program Security
Figure 6-4: Installation and Patching
Sharing the good, the bad, the ugly & What can we do about it?
Risk Management CSCE 489/689 (Software Security) Fall 2018
CSC-682 Advanced Computer Security
CULLEN ACHESON Samuel Garcia Zachary Blum
White Box testing & Inspections
Software Development Techniques
V1.1 1.
Presentation transcript:

Large-scale application security Charlie Eriksen

Agenda Define the problem space Testing and auditing techniques Step 1 – Define target Step 2 – Understand the target Step 3 – Find critical/high-risk code paths to review Step 4 – Review and test Step 5 – Asses your findings and iterate Future challenges ▫Locating the absence of CSRF protection ▫Real-time alerting

Goals The ability to take a large amount of code and audit it for vulnerabilities Prioritize time spent in an audit based on risk Spend as little time as possible to find as many vulnerabilities as possible

Inspiration

Problem space

Vulnerability classes and mitigation Systematic vulnerabilities Framework Code review Manual/Automatic testing Business/design logic Code review Manual testing

What we’re not trying to solve Reviewing business logic Pin-point accuracy of vulnerabilities (Not really) reviewing for the absence of… ▫We’ll look at my attempt at reviewing for the absence of CSRF protection later!

Testing techniques White box Black box The sweet spot

White box Black box Pros ▫Not restricted by your discovery phase ▫Gets you straight to where interesting things happen Cons ▫Some code can be too hard to statically analyze ▫Things may hide in plain sight Pros ▫Some parts can be automated ▫Allows you to observe behavior ▫Will uncover the most obvious flaws Cons ▫Uncovering some bugs can be expensive ▫Special code-paths may never be executed

Testing techniques

Audit ROI This is probably true for most companies ▫Large number of applications ▫Lots of legacy ▫Not enough time to audit all thoroughly Consider: ▫What do you not know/Are there risks you’re not aware of? ▫What is your vulnerability tolerance? ▫What vulnerabilities have the highest impact? ▫What vulnerabilities are most likely to be discovered?

Audit ROI Hard Easy High Low $$$ Good! Are you google? If not, wasted time/money

Candidate point strategy Fastest way to identify a lot of vulnerabilities Starts with identifying: ▫Points with side effects ▫Known vulnerable patterns Then back-tracing

Step 1 – Define target Find a target ▫In-house? ▫Public projects?  Plugins! Obtain source code

Wordpress example

Step 2 - Understand the target Learn the language Internalize OWASP top 10 Observe the framework and language ▫Dangerous functions ▫Mitigation techniques Find commonly vulnerable code patterns

PHP/Wordpress important functions A good list exists here for PHP: ploitable-php-functions ploitable-php-functions Highlights: ▫include/require ▫system/exec/shell_exec ▫eval Wordpress specific: ▫wpdb

Step 3 – Find critical/high-risk code paths to review Higher risk code paths is where you’ll want to spend more time Determine your critical functionality and assets Examples might be: ▫System calls ▫Database access ▫File system access ▫Web-specific things, forms, markup output ▫Encoding(base64) ▫Cryptographic usage(md5!?) These will be our candidate points

Good PHP regexes (include|require).*\$_(POST|GET|REQUEST) file_get_contents.*\$_(POST|GET|REQUEST) (eval|exec|system|shell_exec).*\$_(POST|GET|REQ UEST) SELECT.* FROM.* \$_(POST|GET|REQUEST) (echo|print).*\$_(POST|GET|REQUEST)

Step 4 – Review and test Start by casting the net wide on a project As you learn more about it, start being more specific and reduce noise Learn to review code at a glance High risk vulnerabilities are usually easily seen at a glance

Example 1

Example 1 – Cryptographic md5\s?\(.*\$_(GET|POST|REQUEST)

Example 1 – Cryptographic exploit

Example 2

Example 2 – File inclusion (include|require).*\$_(POST|GET|REQUEST)

Example 2 – File inclusion /wordpress/wp-content/plugins/zingiri-web- example.com/

Example 3

Example 3 – SQL Injection SELECT.* FROM.* \$_(POST|GET|REQUEST)

Example 3 – SQL Injection /wordpress/wp-content/plugins/all-video- gallery/xml/playlist.php?vid=2 UNION SELECT 1, 2, user(), 5, 6, 7, 8, 9, 10, database(), 12, 13, 14, 15, 16, 17, 18

Example 4

Example 4 – File disclosure file_get_contents.*\$_(POST|GET|REQUEST)

Example 4 – File disclosure /wordpress/wp-content/plugins/google-document- embedder/libs/pdf.php?fn=lol.pdf&file=../../../../wp- config.php

Step 5 – Asses your findings and iterate Steps to take ▫Assess risk ▫Do root cause analysis ▫Consider if there is likely to be more vulnerabilities of this type ▫Find out if there are steps that can be taken to mitigate the class of vulnerability at large Find next steps to improve your ROI ▫Are you coming close to your risk tolerance? ▫Are there still unknowns? ▫Are there other higher-risk areas(ROI?) ▫Have you addressed the most discoverable bugs?

Methodology All vulnerabilities found using this method All vulnerabilities submitted to Secunia SVCRP ▫Sweet program, check it out Data based on their advisories ▫Download numbers pulled manually

Research findings 24 plugins ~2 million downloads 66 vulnerabilities

Downloads

Vulnerabilities

Time to patch 6 advisories without patch 34 days to patch on average

Future challenges – Locate the absence of mitigation Simple question: How do you accurately pin- point for the absence of a vulnerability mitigation? Secure by default helps, but can’t be assumed

Locating the absence of CSRF protection

Results 30 plugins downloads

Plugin downloads 455k downloads on average

Future challenges – Vulnerability alerting We know how to look for vulnerabilities You have to keep up with current development Reviewing the same code over and over again stops paying off How do we make a machine look for things to review in real-ish time?

Conclusions Intelligent grep use can uncover vulnerabilities Using your understanding of a language and framework serves as a great starting point for code reviews By reviewing critical code-paths for mechanical vulnerabilities, you can cover a lot of ground in short time Systematic vulnerabilities exist and can be uncovered en masse quite trivially Use root cause analysis appropriately and fix the problem rather than the symptom

Bonus example!

array_merge\(.*\$_(POST|GET|REQUEST)

Press button, receive answers