What is code injection? Code injection is the exploitation of a computer bug that is caused by processing invalid data. Code injection can be used by.

Slides:



Advertisements
Similar presentations
Module XII Web Application Vulnerabilities
Advertisements

Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems © 2002, Predictive Systems.
Nick Feamster CS 6262 Spring 2009
PHP I.
Cross-Site Scripting (XSS) Vulnerability in AJAX and Adobe Flex Applications Danielle Cauthen 04/09/2010 COMS E6125 – Web enHanced Information Management.
Past, Present and Future By Eoin Keary and Jim Manico
Hossain Shahriar Mohammad Zulkernine. One of the worst vulnerabilities in web applications It involves the generation of dynamic HTML contents with invalidated.
Hands-on SQL Injection Attack and Defense HI-TEC July 21, 2013.
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
WebGoat & WebScarab “What is computer security for $1000 Alex?”
EECS 354 Network Security Cross Site Scripting (XSS)
Team Members: Brad Stancel,
Cross Site Scripting a.k.a. XSS Szymon Siewior. Disclaimer Everything that will be shown, was created for strictly educational purposes. You may reuse.
Server-Side vs. Client-Side Scripting Languages
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Lecture 16 Page 1 CS 236 Online Cross-Site Scripting XSS Many sites allow users to upload information –Blogs, photo sharing, Facebook, etc. –Which gets.
CROSS SITE SCRIPTING..! (XSS). Overview What is XSS? Types of XSS Real world Example Impact of XSS How to protect against XSS?
Injection Attacks by Example SQL Injection and XSS Adam Forsythe Thomas Hollingsworth.
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Chapter 6: Hostile Code Guide to Computer Network Security.
WEB SECURITY WORKSHOP TEXSAW 2013 Presented by Joshua Hammond Prepared by Scott Hand.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Workshop 3 Web Application Security Li Weichao March
Prevent Cross-Site Scripting (XSS) attack
Lets Make our Web Applications Secure. Dipankar Sinha Project Manager Infrastructure and Hosting.
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
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.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
Copyright 2007 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
1 Internet Browsing Vulnerabilities and Security ECE4112 Final Lab Ye Yan Frank Park Scott Kim Neil Joshi.
Security+ Guide to Network Security Fundamentals, Fourth Edition
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
By Sean Rose and Erik Hazzard.  SQL Injection is a technique that exploits security weaknesses of the database layer of an application in order to gain.
Presented By: Chandra Kollipara. Cross-Site Scripting: Cross-Site Scripting attacks are a type of injection problem, in which malicious scripts are injected.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Module: Software Engineering of Web Applications Chapter 3 (Cont.): user-input-validation testing of web applications 1.
Introduction of XSS:-- Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Web Applications Attacks A: SQL Injection Stored Cross Site Scripting Prof. Reuven Aviv Department of Computer Science Tel Hai Academic College Topics.
By Collin Donaldson. Hacking is only legal under the following circumstances: 1.You hack (penetration test) a device/network you own. 2.You gain explicit,
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
Database and Cloud Security
Group 18: Chris Hood Brett Poche
Web Application Security
Module: Software Engineering of Web Applications
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Introduction to Dynamic Web Programming
World Wide Web policy.
Static Detection of Cross-Site Scripting Vulnerabilities
Web Applications Security XSS
CSC 495/583 Topics of Software Security Intro to Web Security
Lecture 2 - SQL Injection
PHP Forms and Databases.
Protecting Against Common Web Application Vulnerabilities
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems
Exploring DOM-Based Cross Site Attacks
Web Application Development Using PHP
Cross-Site Scripting Attack (XSS)
Presentation transcript:

What is code injection? Code injection is the exploitation of a computer bug that is caused by processing invalid data. Code injection can be used by an attacker to introduce (or "inject") code into a computer program to change the course of execution. The results of a code injection attack can be disastrous

Code injection

Code injection can do Arbitrarily modify values in a database through a type of code injection called SQL injection. The impact of this can range from defacement of a web site to serious compromisation of sensitive data. Install malware on a computer by exploiting code injection vulnerabilities in a web browser or its plugins when the user visits a malicious site.

Install malware or execute malevolent code on a server, by PHP or ASP Injection. Privilege escalation to root permissions by exploiting Shell Injection vulnerabilities in a setuid root binary on UNIX. Privilege escalation to Local System permissions by exploiting Shell Injection vulnerabilities in a service on Windows. Stealing sessions/cookies from web browsers using HTML/Script Injection (Cross-site scripting). Code injection can do

Different types of Code injection SQL injection LDAP Injection OS Command Injection Cross-Site Scripting (XSS)

SQL injection SQL injection attack consists of injection of malicious SQL commands via input data from the client to the application that are later passed to an instance of a database for execution and aim to affect the execution of predefined SQL commands.

SQL injection

SQL injection consists of direct insertion of code into user-input variables which are concatenated with SQL commands and executed. A less direct attack injects malicious code into strings that are destined for storage in a table or as metadata. When the stored strings are subsequently concatenated into a dynamic SQL commands, the malicious code is then executed.

SQL injection A successful SQL injection exploit can Access sensitive data in the database, Modify database data, Execute administrative operations within the database (e.g. shutdown the DBMS), Recover the content of a given file present on the DBMS file system And in some cases issue commands to the operating system.

Sample SQL injection

Examples of SQL injection These attacks noted on the Eastern European website started early in March and by Wednesday March 12, 2008, 10,000 Web pages were compromised. Here is a diagram of how it is done

Examples of SQL injection Here is a diagram of how to protect against it

Examples of SQL injection * At BIDMC, we chose to implement Third Brigade's Host Based Intrusion Protection software, the Cool Technology of the Week. Third Brigades SQL Injection smart filter provides generic protection against SQL Injection attacks. * In addition, Third Brigade has released a specific exploit filter which identifies if a Web Site has been compromised and is serving malicious content to unsuspecting users. *Third Brigade provides protection against these Web Site attacks that are highly sophisticated and in some cases encoded using evasive techniques like URI encoding, double encoding, mixed case and non minimal UTF-8 encoding. * Install filters for known vulnerabilities in Browsers, Operating Systems and ActiveX Plugins * Install filters which prevent the user from accessing sites serving malicious pages. In this case, we released a specific protection which detects if the user visits a site that has malicious javascript in it. * Install filters which block domains which download the malware on the target machine. * Install filters detecting existence of known malware on the machine.

LDAP Injection LDAP is Lightweight Directory Access Protocol. LDAP injection is an attack technique of exploiting web applications that use client- supplied data in LDAP statements without first stripping potentially harmful characters from the request.

LDAP Injection

LDAP Injection ? When a web application fails to properly sanitise user-supplied input, it is possible for an attacker to alter the construction of an LDAP statement. Once an attacker is able to modify an LDAP statement, the process will run with the same permissions as the component that executed the command.(e.g. Database server, Web application server, Web server, etc.).

This can cause serious security problems where the permissions grant the rights to query, modify or remove anything inside the LDAP tree. The same advanced exploitation techniques available in SQL Injection can also be similarly applied in LDAP Injection. LDAP Injection?

Examples of LDAP Injection

OS Command Injection OS Command Injection also called as Shell Injection. OS command injection is also known as Improper Sanitisation of Special Elements used in an OS Command and is a technique used via a web interface in order to execute OS commands on a web server.

OS Command Injection? The user supplies all or part of malformed OS command through a web interface. If the web interface that is not properly sanitised the input is vulnerable to this exploit. With the ability to execute OS commands, the user can inject unexpected and dangerous commands, upload malicious programs or even obtain passwords directly from the operating system.

Examples of OS Command Injection

Cross-Site Scripting (XSS) Cross-site Scripting (XSS) is a type of injection attack, in which malicious scripts are introduced into the trusted websites. This exploitation would occur when a web application uses user-supplied inputs as an output without validating or encoding it.

Cross-Site Scripting (XSS)

The malicious content sent to the web browser can takes several forms including JavaScript, VBScript, ActiveX, HTML, Flash or any other type of code that the browser may execute. XSS attacks can generally be categorised into three types: - Stored, - Reflected and - Document Object Mode based (DOM- Based).

Cross-Site Scripting (XSS) Stored XSS (Persistent) – Stored XSS attacks means that the injected malicious code is permanently stored on a target server such as a bulletin board, a visitor log, or a comment field, blogs, discussion boards. When interacting with the target server, an end-user inadvertently retrieves and executes the malicious code from the server.

Cross-Site Scripting (XSS) Sample Stored XSS

Cross-Site Scripting (XSS) Reflected XSS (Non-Persistent) – Reflected XSS attacks are those where the injected code is sent to a vulnerable web server that directs the crosssite attack back to the users browser. This type of attacks aims to trick the users by clicking on a malicious link or submitting a specially crafted form. The users browser then executes the malicious code, assuming it comes from a trusted server.

Cross-Site Scripting (XSS) Sample reflected XSS

Cross-Site Scripting (XSS) DOM (Document Object Model) Based XSS – Unlike the previous two, DOM based XSS does not require the web server to receive the malicious XSS payload. Instead, in a DOM-based XSS, the attack payload is embedded in the DOM object in the victims browser used by the original client side script, so that the client side code runs in an unexpected manner.

That means, the page itself (HTTP response) does not change, but the client side code contained in the page executes differently due to the malicious modifications that have occurred in the local DOM environment. This attack is usually achieved by sending malicious URL to the users. Cross-Site Scripting (XSS)

Sample DOM XSS

References:

Questions ?