Hands-On with RailsGoat WEB APPLICATION SECURITY TESTING.

Slides:



Advertisements
Similar presentations
Webgoat.
Advertisements

Closing the Gap: Analyzing the Limitations of Web Application Vulnerability Scanners David Shelly Randy Marchany Joseph Tront Virginia Polytechnic Institute.
Hands on Demonstration for Testing Security in Web Applications
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?”
Vulnerability Assessment Course Applications Assessment.
Automating Bespoke Attack Ruei-Jiun Chapter 13. Outline Uses of bespoke automation ◦ Enumerating identifiers ◦ Harvesting data ◦ Web application fuzzing.
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.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
The OWASP Foundation Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under.
Sara SartoliAkbar Siami Namin NSF-SFS workshop July 14-18, 2014.
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
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 
W3af LUCA ALEXANDRA ADELA – MISS 1. w3af  Web Application Attack and Audit Framework  Secures web applications by finding and exploiting web application.
Introduction to Application Penetration Testing
Workshop 3 Web Application Security Li Weichao March
MIS Week 11 Site:
NOWASP Mutillidae 2.3.x An open-source web pen-testing environment for security training, practice, instruction, and you Jeremy Druin Information Security.
Web Security Overview Lohika ASC team 2009
OWASP Zed Attack Proxy Project Lead
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
+ 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.
Approaches to Application Security – DSM
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.
Ryan Dewhurst - 20th March 2012 Web Application (PHP) Security.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications 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 GNU Free Documentation.
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
Introduction To Web Application Security in PHP. Security is Big And Often Difficult PHP doesn’t make it any easier.
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.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
Web Applications Testing By Jamie Rougvie Supported by.
Building Secure Web Applications With ASP.Net MVC.
G CITRIXHACKIN. Citrix Presentation Server 4.5 New version is called XenApp/Server Common Deployments Nfuse classic CSG – Citrix Secure Gateway Citrix.
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.
Web2.0 Secure Development Practice Bruce Xia
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Copyright © The OWASP Foundation This work is available under the Creative Commons SA 2.5 license The OWASP Foundation OWASP Denver February 2012.
Introduction of XSS:-- Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted.
Defending Applications Against Command Insertion Attacks Penn State Web Conference 2003 Arthur C. Jones June 18, 2003.
MIS Week 5 Site:
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.
SECURE DEVELOPMENT. SEI CERT TOP 10 SECURE CODING PRACTICES Validate input Use strict compiler settings and resolve warnings Architect and design for.
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
Group 18: Chris Hood Brett Poche
Web Application Vulnerabilities
Web Application Bug Hunting
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
WEB APPLICATION TESTING
SQL Injection.
Penetration Testing following OWASP
Intro to Ethical Hacking
Lecture 2 - SQL Injection
Web Hacking: Beginners
HACKIN G CITRIX.
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Lecture 27 Security I April 4, 2018 Open news web sites.
Presentation transcript:

Hands-On with RailsGoat WEB APPLICATION SECURITY TESTING

ABOUT US – Security testing, run our testing company (ScotSTS) – Heavily involved in the OWASP community, run the Scotland chapter events – Rory has presented at Scottish Ruby Conf/Scotland on Rails since 2009 – Marion is an avowed Microsofty (spot the number of MS products!)

AGENDA Introduction to Web App Testing Introduction to Burp Suite Introduction to RailsGoat Hands-On!

INTRODUCTION TO WEB APP TESTING

WARNING!

SECURITY TESTING OVERVIEW Review the security of a system or systems against an established benchmark or “best practice” Carried out on a variety of levels – Network – OS – DB – Application Key Concept – Scope!

TESTING TYPES Black-Box – Automated – Manual White-Box – Automated – Manual

WEB APP TESTING VULNERABILITIES Wide variety of things to test for, where to start…. OWASP Top 10 – Good list of places to consider –

INTRODUCTION TO BURP

MORE THAN JUST A SILLY NAME Burp is a proxy-based web application testing tool De-facto standard for manual web app. Testing Free and paid-for versions available Other options are available – OWASP ZAP – upcoming Open Source alternative – Telerik Fiddler – Primarily windows based alternative

WHY PROXIES? Intercept and modify traffic between client and server Bypass any JavaScript restrictions Access hidden fields Modify headers Modify cookies

BURP TOUR – SITEMAP

BURP TOUR – SCOPE

BURP TOUR INTERCEPT

BURP TOUR – HTTP HISTORY

BURP TOUR - SPIDER

BURP TOUR - SCANNER

BURP TOUR - INTRUDER

BURP TOUR - REPEATER

BURP TOUR - SEQUENCER

BURP TOUR - DECODER

BURP TOUR – OPTIONS

INTRODUCTION TO RAILSGOAT

RAILSGOAT OWASP Project to provide a training application based on Ruby/Rails. Rails 3.2 application Has exercises covering the OWASP Top 10 vulnerabilities

SQL INJECTION - OVERVIEW One of the most serious security issues you are likely to see in web applications Impact can extend to the underlying operating system Have been examples of SQLi in underlying libraries (e.g. ActiveRecord) as well as application code.

SQL INJECTION – BLACKBOX TESTING BASICS Test form fields, form field names, cookies, headers (basically any data that could be used in a query) Test strings – ‘ – single quote character can show up problems if an error is returned – ‘ OR ‘1’=‘1 – logical true statement – ‘ AND ‘1=‘0 – Logical false statement – Str’ || ’ing – string concatenation (depends on underlying DB) – +1 – numerical addition Observe responses

EXERCISE 1 – SQL INJECTION Set-up the proxy to intercept Update a user account Try modifying the user_id parameter…

COMMAND INJECTION Another input validation/sanitization issue Possible wherever the application interfaces to the underlying system Calls to things like system()

COMMAND INJECTION – BLACK BOX TESTING | character Sample commands e.g. ‘cat /etc/passwd’ Underlying platform matters (different commands and paths on windows)

EXERCISE 2 – COMMAND INJECTION Intercepting proxy again Testing in the benefits upload section Where to look for the created directory?

INFORMATION DISCLOSURE Information gathering is a key piece of testing Build up a picture for later attacks

INFORMATION GATHERING – BLACK BOX Mainly look for known areas to get information – Username enumeration – Error messages (version info/path info) – Default files

EXERCISE 3 – USERNAME ENUMERATION Enter an incorrect username Now enter a correct username with an incorrect password Could you automate this process? What can you do with a list of usernames?

PASSWORD WEAKNESSES Passwords are the sole authentication mechanism on almost all sites Weak passwords cause breaches Standard part of testing

PASSWORD WEAKNESSES – BLACK BOX Can be very straightforward (disclosed password policy) Still worth checking – Length – Complexity – Truncation(?) – Reset process

EXERCISE 4 – PASSWORD STRENGTH Easy to test – Try setting your password to some standard values P Abc123 Password.. Ties into the username enumeration from the last exercise

CROSS SITE SCRIPTING Very common issue, results from user supplied input being returned to the browser without appropriate encoding/sanitization 3 Main variants – Reflected – Stored – DOM-based Can have quite serious impacts (see the beef project for examples)

CROSS-SITE SCRIPTING – BLACK BOX Insert test strings into fields on the page – “> alert(‘lorem’) <“ – ‘); alert(‘lorem’) ; Look at output for all locations where the output appears. – Is it encoded? – Is it sanitized?

EXERCISE 5 - XSS Register a new user – Try out some vectors in various fields… Added Bonus! – DOM XSS – Not an intended exercise in the app. – Vulnerability in the Jquery Snippet library used. – May not work depending on your browser

INSECURE DIRECT OBJECT REFERENCE Terrible name! It basically refers to places where there’s a weakness in how the application checks authorisation and the object reference is exposed Rails (and other REST style frameworks are particularly susceptible)

INSECURE DIRECT OBJECT REFERENCE – BLACK BOX Usually pretty easy. Wherever you see a numeric parameter (e.g /users/1) try 2 or 3 etc Look for paramters in the URL, in hidden fields or cookies. Watch out for Obfuscated (e.g. base64 encoded) parameters. – Burp encoder comes in handy for these

EXERCISE 6 – INSECURE DIRECT OBJECT REFERENCE Try going to the Work Info section of the application while logged in Any way to change the Object being referenced?

SENSITIVE DATA EXPOSURE A “Know it when you see it” vulnerability Not really findable with automated tools Covers different types of data – Password (cleartext or hashed) – Credit Card numbers – …

DATA EXPOSURE – BLACK BOX Review the application for exposed sensitive data! Watch out for areas where data hiding is done client-side – (e.g. hidden fields, Javascript used to obfuscate data)

EXERCISE – DATA EXPOSURE The application has an API We need to authenticate to it – Token header – Authorization: Token token=1- 01de24d75cffaa66db205278d1cf900bf087a737 Lets see what they store for users /api/v1/users

AUTHORISATION FLAWS Two general classes of problem – Failure to check that a user is authenticated before providing information – Failure to check that an authenticated user has the right authorisation to the information before providing it Second one is more common

AUTHORISATION FLAWS – BLACK BOX Build up a map of functions (spidering, rake routes) Try all functions unauthenticated Try privileged functions as low-privileged users

EXERCISE 8 – AUTHORISATION FLAW Easily exploited – Unprotected admin interface – /admin/1/dashboard/ If you didn’t have the URL how could you find it?

UNVALIDATED REDIRECTS Quite a specific problem but pretty common Application takes a URL as a parameter (e.g. for redirect after logon) Doesn’t validate that the location is within the app. Useful for phishing attacks.

UNVALIDATED REDIRECT – BLACK BOX Keep an eye out for URL parameters Hidden fields, cookies, URL Modify to another value and see where it takes you

EXERCISE 9 – UNVALIDATED REDIRECT url parameter for logins…

WHITE BOX TESTING As mentioned not all vulnerabilities are findable using black box techniques Automated Scanning or manual code review required

CONFIGURATION OPTIONS If you have access to source code always worth checking N.B. testers/attackers will often check for config. Errors as part of reconnaissance

QUESTIONS? CONTACT