Security Khaled Al-Sham’aa. What Is Security? Security is a measurement, not a characteristic. Security must be balanced with expense. Security must be.

Slides:



Advertisements
Similar presentations
PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
Advertisements

Web Security Never, ever, trust user inputs Supankar.
PHP Hypertext Preprocessor Information Systems 337 Prof. Harry Plantinga.
-Ajay Babu.D y5cs022.. Contents Who is hacker? History of hacking Types of hacking Do You Know? What do hackers do? - Some Examples on Web application.
9/9/2005 Developing "Secure" Web Applications 1 Methods & Concepts for Developing “Secure” Web Applications Peter Y. Hammond, Developer Wasatch Front Regional.
Introduction The concept of “SQL Injection”
Into the Mind of the Hacker: Hands-On Web Application Hacking Adam Doupé University of California, Santa Barbara 4/23/12.
By Brian Vees.  SQL Injection  Username Enumeration  Cross Site Scripting (XSS)  Remote Code Execution  String Formatting Vulnerabilities.
Misc. Announcements Backup your work! Document team members’ contributions (so that if there is any dispute …) More Bonus credits: Create screencasts for.
CS144: Security. Smart Card OTP card Buffer Overflow Attack main() { if (login()) start_session(); return 0; } login() { char passwd[10]; gets(passwd);
Injection Attacks by Example SQL Injection and XSS Adam Forsythe Thomas Hollingsworth.
1 SQL injection: attacks and defenses Dan Boneh CS 142 Winter 2009.
{ Code Injection Cable Johnson.  Overview  Common Injection Types  Developer Prevention Code Injection.
PHP-MySQL By Jonathan Foss. PHP and MySQL Server Web Browser Apache PHP file PHP MySQL Client Recall the PHP architecture PHP can communicate with a MySQL.
Preventing SQL Injection ~example of SQL injection $user = $_POST[‘user’]; $pass = $_POST[‘pass’]; $query = DELETE FROM Users WHERE user = ‘$user’ AND.
Check That Input Preventing SQL Injection Attacks By Andrew Morton For CS 410.
PHP Security.
Cosc 4765 Server side Web security. Web security issues From Cenzic Vulnerability report
PHP Security Computer Security. overview  Xss, Css  Register_globals  Data Filtering  Sql Injection  Session Fixation.
Securing Ruby on Rails CIS 6939 Web Engineering with Ruby on Rails University of North Florida Stephen Jones 8 July 2007.
PHP Data Object (PDO) Khaled Al-Sham’aa. What is PDO? PDO is a PHP extension to formalise PHP's database connections by creating a uniform interface.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
Lecture 16 Page 1 CS 236 Online SQL Injection Attacks Many web servers have backing databases –Much of their information stored in a database Web pages.
Accessing MySQL with PHP IDIA 618 Fall 2014 Bridget M. Blodgett.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
School of Computing and Information Systems CS 371 Web Application Programming Security Avoiding and Preventing Attacks.
PHP Workshop ‹#› PHP Security. PHP Workshop ‹#› Two Golden Rules 1.FILTER external input Obvious.. $_POST, $_COOKIE, etc. Less obvious.. $_SERVER 2.ESCAPE.
PHP2010/11 : [‹#›] PHP Security. PHP2010/11 : [‹#›] Two Golden Rules 1.FILTER external input Obvious.. $_POST, $_COOKIE, etc. Less obvious.. $_SERVER.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Accessing Your MySQL Database from the Web with PHP (Ch 11) 1.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Web Security.
SecurityPHPApril 2010 : [‹#›] PHP Security. SecurityPHPApril 2010 : [‹#›] Two Golden Rules 1.FILTER external input Obvious.. $_POST, $_COOKIE, etc. Less.
Misc. Announcements Pre-Test2 (with past test questions!) and Final Milestone are posted! Which teams to go first? 2 options Any volunteers for the first.
Web system security issues: A developer's perspective Morrison, P. Jason 9 December 2004 BAD Information Security Web system security issues:
Cloud = Web, Web = Hacked! Fabio Viggiani. Why Web Apps? Every organization exposes web apps Most common entry point Image source:
Lecture 19 Page 1 CS 236 Online Advanced Research Issues in Security: Web Security and Privacy CS 236 On-Line MS Program Networks and Systems Security.
WEB SECURITY WEEK 2 Computer Security Group University of Texas at Dallas.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Form Handling IDIA 618 Fall 2014 Bridget M. Blodgett.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Module: Software Engineering of Web Applications Chapter 3 (Cont.): user-input-validation testing of web applications 1.
EECS 354: Network Security Group Members: Patrick Wong Eric Chan Shira Schneidman Web Attacks Project: Detecting XSS and SQL Injection Vulnerabilities.
Secure Authentication. SQL Injection Many web developers are unaware of how SQL queries can be tampered with SQL queries are able to circumvent access.
Defending Applications Against Command Insertion Attacks Penn State Web Conference 2003 Arthur C. Jones June 18, 2003.
Data Validation. 2 Objective : To ensure that the application is robust against all forms of input data, whether obtained from the user, infrastructure,
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Chapter 13 Security Methods Part 2. xss.php Script 13.4 on page 419 ss.php
10 Tips for Building a Secure PHP Application. Tip 1: Use Proper Error Reporting/Handling  The development process of the application can become very.
SQL Injection. Who Am I? Sean Taylor Computer Science major Software developer Web developer Amateur hacker.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
UKUUG Linux 2008 Introduction to Web Application Security Flaws Jake Edge LWN.net URL for slides:
CSE509 System Security Attacks against the server-side of web applications Nick Nikiforakis
Module: Software Engineering of Web Applications
SQL Primer Boston University CS558 Network Security Fall 2015
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Introduction to Dynamic Web Programming
World Wide Web policy.
CS 371 Web Application Programming
SQL Injection Attacks Many web servers have backing databases
Computer Security Fundamentals
Web Systems Development (CSC-215)
PHP: Security issues FdSc Module 109 Server side scripting and
ارايه دهنده:شهره مرجاني مركز آپاي دانشگاه فددوسي مشهد
Chapter 13 Security Methods Part 2.
Chapter 13 Security Methods Part 3.
Using PHP with MySQL Part 2
Web Programming Language
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Presentation transcript:

Security Khaled Al-Sham’aa

What Is Security? Security is a measurement, not a characteristic. Security must be balanced with expense. Security must be balanced with usability. Security must be part of the design.

Basic Steps Consider illegitimate uses of your application. Educate yourself. If nothing else: FILTER ALL INPUT DATA ESCAPE ALL OUTPUT DATA

Register Globals (1)

Register Globals (2)

Filtering (1)

Filtering (2)

Filtering (3)

Form Processing (1)

Form Processing (2)

Cross-Site Scripting (XSS)

Cross-Site Scripting (XSS) 1

Cross-Site Scripting (XSS) 2

Cross-Site Scripting (XSS) 3 htmlentities() strip_tags() utf8_decode()

Session Hijacking

SQL Injection (example 1)

SQL Injection (example 1) con. SELECT `id` FROM `logins` WHERE `username` = '$user' AND `password` = '$pwd' $user = “Khaled”; $pwd = “anything' OR 'x'='x”; SELECT `id` FROM `logins` WHERE `username` = 'Khaled' AND `password` = 'anything' OR 'x'='x'

SQL Injection (example 2) $query = “UPDATE usertable SET pwd='$pwd' WHERE uid='$uid' ”; $pwd = “abc”; $uid = “anything' or uid='admin'; -- ”; $query = “UPDATE usertable SET pwd='abc' WHERE uid= 'anything' or uid='admin'; -- ' ”;

Avoiding SQL Injection mysql_real_escape_string() for PHP version < use addslashes() Prepared Statements

Questions