Security issues. Unit 27 Web Server Scripting Extended Diploma in ICT 2016 Lecture: Phil Smith

Similar documents
Learning outcome LO1. 1. Understand the concepts of web application development. (Assignment 1)

Web Application Security. Philippe Bogaerts

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

CSCE 813 Internet Security Case Study II: XSS

The security of Mozilla Firefox s Extensions. Kristjan Krips

Web Security. Jace Baker, Nick Ramos, Hugo Espiritu, Andrew Le

CIS 4360 Secure Computer Systems XSS

Lecture 4. Wednesday, January 27, 2016

Application vulnerabilities and defences

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11

John Coggeshall Copyright 2006, Zend Technologies Inc.

Application Security through a Hacker s Eyes James Walden Northern Kentucky University

Web insecurity Security strategies General security Listing of server-side risks Language specific security. Web Security.

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH

Configuring User Defined Patterns

Webapps Vulnerability Report

This slide shows the OWASP Top 10 Web Application Security Risks of 2017, which is a list of the currently most dangerous web vulnerabilities in

Web Application & Web Server Vulnerabilities Assessment Pankaj Sharma


PHP Security. Kevin Schroeder Zend Technologies. Copyright 2007, Zend Technologies Inc.

Web Security. Attacks on Servers 11/6/2017 1

P2_L12 Web Security Page 1

IS 2150 / TEL 2810 Introduction to Security

NET 311 INFORMATION SECURITY

Building a Web-based Health Promotion Database

CSCD 303 Essential Computer Security Fall 2017

Creating Better Forms; an article for developers 2010

IERG 4210 Tutorial 07. Securing web page (I): login page and admin user authentication Shizhan Zhu

Some Facts Web 2.0/Ajax Security

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang

CSE 127 Computer Security

PHP-security Software lifecycle General Security Webserver security PHP security. Security Summary. Server-Side Web Languages

INF 102 CONCEPTS OF PROG. LANGS ADVERSITY. Instructors: James Jones Copyright Instructors.

Ruby on Rails Secure Coding Recommendations

W e b A p p l i c a t i o n S e c u r i t y : T h e D e v i l i s i n t h e D e t a i l s

Reflected XSS Cross-Site Request Forgery Other Attacks

I n p u t. This time. Security. Software. sanitization ); drop table slides. Continuing with. Getting insane with. New attacks and countermeasures:

Excerpts of Web Application Security focusing on Data Validation. adapted for F.I.S.T. 2004, Frankfurt

Book IX. Developing Applications Rapidly

The Ultimate Windows 10 Hardening Guide: What to Do to Make Hackers Pick Someone Else

Managing User Account Passwords

EasyCrypt passes an independent security audit

MTAT Research Seminar in Cryptography The Security of Mozilla Firefox s Extensions

R (2) Implementation of following spoofing assignments using C++ multi-core Programming a) IP Spoofing b) Web spoofing.

HTML 5 Form Processing

How to perform the DDoS Testing of Web Applications

CSCE 548 Building Secure Software SQL Injection Attack

Lecture 3: Web Servers / PHP and Apache. CS 383 Web Development II Monday, January 29, 2018

Security and Privacy. SWE 432, Fall 2016 Design and Implementation of Software for the Web

A (sample) computerized system for publishing the daily currency exchange rates

WEB SECURITY: XSS & CSRF

GUI based and very easy to use, no security expertise required. Reporting in both HTML and RTF formats - Click here to view the sample report.

Finding Vulnerabilities in Web Applications

SECURE CODING ESSENTIALS

Web Application Threats and Remediation. Terry Labach, IST Security Team

Chapter 2. Switch Concepts and Configuration. Part II

CONTENTS IN DETAIL INTRODUCTION 1 THE FAQS OF LIFE THE SCRIPTS EVERY PHP PROGRAMMER WANTS (OR NEEDS) TO KNOW 1 2 CONFIGURING PHP 19

Activity 1.1: Indexed Arrays in PHP

Web Security: Vulnerabilities & Attacks

Computer Forensics: Investigating Network Intrusions and Cyber Crime, 2nd Edition. Chapter 3 Investigating Web Attacks

WEBD 236 Lab 5. Problem

READSPEAKER BLACKBOARD BUILDING BLOCK

CNIT 129S: Securing Web Applications. Ch 10: Attacking Back-End Components

Hackveda Training - Ethical Hacking, Networking & Security

CSE361 Web Security. Attacks against the server-side of web applications. Nick Nikiforakis

This is CS50. Harvard College Fall Quiz 1 Answer Key

Integrity attacks (from data to code): Malicious File upload, code execution, SQL Injection

OWASP Top 10 Risks. Many thanks to Dave Wichers & OWASP

C1: Define Security Requirements

Is Browsing Safe? Web Browser Security. Subverting the Browser. Browser Security Model. XSS / Script Injection. 1. XSS / Script Injection

CS 161 Computer Security

Embedding Medial Media Library Videos in Blackboard or a Web Page. Version 5

COMP9321 Web Application Engineering

Developing ASP.NET MVC 5 Web Applications. Course Outline

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Quiz I Solutions

IronWASP (Iron Web application Advanced Security testing Platform)

Avoiding Web Application Flaws In Embedded Devices. Jake Edge LWN.net URL for slides:

Joomla 3.X Global Settings Part III Server Settings

Change My Password User Guide

CS 161 Computer Security

Developing Online Databases and Serving Biological Research Data

HTML5 a clear & present danger

Checklist for Testing of Web Application

Developing ASP.Net MVC 4 Web Application

Lecture 6: More Arrays & HTML Forms. CS 383 Web Development II Monday, February 12, 2018

COURSE 20486B: DEVELOPING ASP.NET MVC 4 WEB APPLICATIONS

Web Security II. Slides from M. Hicks, University of Maryland

Progress Exchange June, Phoenix, AZ, USA 1

CS 161 Computer Security

Web Penetration Testing

Secure Programming Techniques

Developing ASP.NET MVC 4 Web Applications

sottotitolo System Security Introduction Milano, XX mese 20XX A.A. 2016/17 Federico Reghenzani

6.170 Tutorial 7 - Rails Security. Prerequisites. Goals of this tutorial. Resources

LECT 8 WEB SECURITY BROWSER SECURITY. Repetition Lect 7. WEB Security

Web Application Attacks

Protect My Ministry Integrated Background Checks for Church Community Builder

Advanced Web Technology 10) XSS, CSRF and SQL Injection

CIS 3308 Logon Homework

Help Contents. Custom Query Builder Functionality Synopsis

Transcription:

Security issues Unit 27 Web Server Scripting Extended Diploma in ICT 2016 Lecture: Phil Smith

Criteria D3 D3 Recommend ways to improve web security when using web server scripting Clean browser input Don t put everything in the web directory on the server Use POST instead of GET Validate on the server Specify the mode when opening a file Log suspicious errors

Clean browser input The problem: Input containing special characters such as! and & could cause the web server to execute an operating system command or have other unexpected behaviour User input stored on the server, such as comments posted to a web discussion program, could contain malicious HTML tags and scripts. When another user views the input, that user's web browser could execute the HTML and scripts.

Clean browser input The solution: never trust any input from a browser. strip unwanted characters, invisible characters and HTML tags from user input

Example <?php if(!filter_has_var(input_post, "url")) { echo("input type does not exist"); } else { $url = filter_input(input_post, "url", FILTER_SANITIZE_URL); }?> Check if the "url" input of the "POST" type exists If the input variable exists, sanitise (take away invalid characters) and store it in the $url variable http://www.w3ååschøøools.com/ becomes http://www.w3schools.com/

Don t put everything in the html directory on the server The problem Every file in the HTML directory can be accessed by a web browser if the URL is known If you had a file called dbconnect.php that contained the login details for the database, the name could be easily guessed and then a hacker could navigate directly to it The solution Put all data files in a directory outside the html directory or its subfolders

Use POST instead of GET The problem GET sends all form input to the web application as part of the URL If this is a user name or password it can be read http://www.example.com/cgibin/cart.cgi?username=jsmith&password=pu ppy The solution POST method sends form input in a data stream The data is not visible in the browser location window and is not recorded in web server log files

Validate on the server A hacker can save an HTML form, disable the embedded Javascript which does validation use the modified form to submit bad data back to the web application. the application expects all input validation to have already been done by the web browser and therefore doesn't double check the input

Validate on the server The solution Make sure the server script validates all input This example checks for a valid integer <?php $int = 123; if(!filter_var($int, FILTER_VALIDATE_INT)) { echo("integer is not valid"); } else { echo("integer is valid"); }?>

Specify the mode when opening a file The problem If a file, such as a configuration file, is opened, the defaults may be read/write This leaves the file vulnerable to malicious updates The solution Explicitly open the file with a specified mode, such as read-only

Log suspicious errors The problem web applications are frequently attacked by hackers Without error logging, you may not know you are being attacked The solution trap and recover from errors, but also log events that may indicate an attack

Log suspicious errors Evidence of attack attempts to access a non-existent file or one the browser doesn't have privileges to read Detect if a form is submitted with GET instead of POST Forms submitted without required fields (hacker may be using a false copy of the form) Input with.. suggests an attacker is trying to access files with a relative path Requests from multiple IP addresses suggest a denial of service attack

Further reading cross-site scripting SQL injection we did some of this See http://php.net/manual/en/function.htmlen tities.php http://www.php.net/manual/en/security.database. sql-injection.php

Summary We have learned several problem with web site/page security and their potential solutions.