SQL Injection: From Basics To Botnet-Based Attack Automation

Similar documents
SQL Injection SPRING 2018: GANG WANG

SQL Injection. EECS Introduction to Database Management Systems

Buffer Overflow Attack. CS4264 Fall 2016

NET 311 INFORMATION SECURITY

Copyright The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License.

Web Security: Web Application Security [continued]

Code Injection Attacks

Securing Cloud Applications with a Distributed Web Application Firewall Riverbed Technology

Network Security Issues and New Challenges

The Realities of Data Security and Compliance: Compliance Security

Security of Web Applications

Securing Your Web Application against security vulnerabilities. Alvin Wong, Brand Manager IBM Rational Software

June 2 nd, 2016 Security Awareness

CSE 127 Computer Security

Security. CSC309 TA: Sukwon Oh

Injection. CSC 482/582: Computer Security Slide #1

THREAT MODELING IN SOCIAL NETWORKS. Molulaqhooa Maoyi Rotondwa Ratshidaho Sanele Macanda

Computer Security: Cyber Essentials KAMI VANIEA 1

Data Security and Privacy : Compliance to Stewardship. Jignesh Patel Solution Consultant,Oracle

The Bots Are Coming The Bots Are Coming Scott Taylor Director, Solutions Engineering

SO YOU THINK YOU ARE PROTECTED? THINK AGAIN! NEXT GENERATION ENDPOINT SECURITY

Kishin Fatnani. Founder & Director K-Secure. Workshop : Application Security: Latest Trends by Cert-In, 30 th Jan, 2009

Top 10 Database Security Threats and How to Stop Them. Rob Rachwald Director of Security Strategy

MOBILE THREAT LANDSCAPE. February 2018

Security+ Guide to Network Security Fundamentals, Fourth Edition. Chapter 5 Host, Application, and Data Security

HOW TO CHOOSE A NEXT-GENERATION WEB APPLICATION FIREWALL

Chapter 6 Network and Internet Security and Privacy

4 Information Security

Secure Programming. Course material Introduction. 3 Course material. 4 Contents

Secure Programming. Introduction. Ahmet Burak Can Hacettepe University

ENDPOINT SECURITY WHITE PAPER. Endpoint Security and the Case For Automated Sandboxing

SYMANTEC ENTERPRISE SECURITY. Symantec Internet Security Threat Report September 2005 Power and Energy Industry Data Sheet

What are PCI DSS? PCI DSS = Payment Card Industry Data Security Standards

EFFECTIVELY TARGETING ADVANCED THREATS. Terry Sangha Sales Engineer at Trustwave

Copyright

Provide you with a quick introduction to web application security Increase you awareness and knowledge of security in general Show you that any

90% of data breaches are caused by software vulnerabilities.

SINGLE COURSE. NH9000 Certified Ethical Hacker 104 Total Hours. COURSE TITLE: Certified Ethical Hacker

Standard Categories for Incident Response (definitions) V2.1. Standard Categories for Incident Response Teams. Definitions V2.1.

Web Application Security. Philippe Bogaerts

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11

The SANS Institute Top 20 Critical Security Controls. Compliance Guide

Combating Cyber Risk in the Supply Chain

John Coggeshall Copyright 2006, Zend Technologies Inc.

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

6 Vulnerabilities of the Retail Payment Ecosystem

Perimeter Defenses T R U E N E T W O R K S E C U R I T Y DEPENDS ON MORE THAN

Cyber fraud and its impact on the NHS: How organisations can manage the risk

Mobile Security / Mobile Payments

Large-Scale Internet Crimes Global Reach, Vast Numbers, and Anonymity

SOLUTION BRIEF FPO. Imperva Simplifies and Automates PCI DSS Compliance

NEVIS Smart Solutions against sophisticated attackers

Securing the Modern Data Center with Trend Micro Deep Security

Table of Content Security Trend

Learning from a breach

KASPERSKY FRAUD PREVENTION FOR ENDPOINTS

Application Security. Doug Ashbaugh CISSP, CISA, CSSLP. Solving the Software Quality Puzzle

The emerging battle between Cyber Defense and Cybercrime: How Technology is changing to keep Company and HR data safe

Getting over Ransomware - Plan your Strategy for more Advanced Threats

SOLUTION BRIEF. Enabling and Securing Digital Business in API Economy. Protect APIs Serving Business Critical Applications

OWASP TOP Release. Andy Willingham June 12, 2018 OWASP Cincinnati

5 Trends That Will Impact Your IT Planning in Layered Security. Executive Brief

Certified Cyber Security Analyst VS-1160

Trusted Identities. Foundational to Cloud Services LILA KEE CHIEF PRODUCT OFFICER GLOBALSIGN

Jeff Wilbur VP Marketing Iconix

Security Best Practices. For DNN Websites

Dissecting Data Breaches. What Keeps Going Wrong?

Zero Trust on the Endpoint. Extending the Zero Trust Model from Network to Endpoint with Advanced Endpoint Protection

PCI Compliance. What is it? Who uses it? Why is it important?

CONTENTS. Recommendations. Prize Q & A


MEMORY AND BEHAVIORAL PROTECTION ENDPOINT SECURITY NETWORK SECURITY I ENDPOINT SECURITY I DATA SECURITY

Students should have an understanding and a working knowledge in the following topics, or attend these courses as a pre-requisite:

Chapter 10: Security. 2. What are the two types of general threats to computer security? Give examples of each.

IS 2150 / TEL 2810 Introduction to Security

Application and Data Security with F5 BIG-IP ASM and Oracle Database Firewall

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

Security Trend of New Computing Era

The Honest Advantage

Personal Cybersecurity

Cyber Vigilantes. Rob Rachwald Director of Security Strategy. Porto Alegre, October 5, 2011

Review Kaspersky Internet Security - multi-device 2015 online software downloader ]

CHAPTER 3. Information Systems: Ethics, Privacy, and Security

Positive Security Model for Web Applications, Challenges. Ofer Shezaf OWASP IL Chapter leader CTO, Breach Security

SECURITY TESTING. Towards a safer web world

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

Security+ SY0-501 Study Guide Table of Contents

Web Applications Security. Radovan Gibala F5 Networks

Cybersecurity The Evolving Landscape

Application vulnerabilities and defences

Securing Your Microsoft Azure Virtual Networks

SECURITY IN MICROSOFT AZURE. Marija Strazdas Sr. Solutions Engineer

Ritz Camera Leverages Whitelisting for Picture Perfect Security

CHAPTER 8 SECURING INFORMATION SYSTEMS

Service Provider View of Cyber Security. July 2017

Account Takeover: Why Payment Fraud Protection is Not Enough

Securing Your Amazon Web Services Virtual Networks

Application Layer Security

THE BUSINESS CASE FOR OUTSIDE-IN DATA CENTER SECURITY

Detecting Insider Attacks on Databases using Blockchains

Transcription:

SQL Injection: From Basics To Botnet-Based Attack Automation http://y Neil Daswani June 2008

Is the sky falling? ( 2007 TJX (March owns TJ Maxx, Marshalls, and other dept stores attacks exploited WEP used at branches over 47 million credit card (CC) #s dating back to 2002 ( 2005 CardSystems (June credit card payment processing company: out of business 263,000 CC #s stolen from database via SQL Injection 43 million CC #s stored unencrypted / compromised Enter sql injection on news.google.com for more... Additional Data Theft: www.privacyrights.org/ar/chrondatabreaches.htm

Why Should I Care? Compliance SOX, PCI, HIPPA, etc Data Breach Laws Social responsibility Reputation / Revenue Expense per lost or stolen record Credit monitoring Lawsuits

Cybercriminal Goals End goal: $$$ Average Attacker Profile: yesterday: teenager looking for fame today: organized crime Intermediate goals: (. etc Data Theft (Identity, credit cards, (. etc Extortion (denial-of-service, blackmail, (. etc Malware distribution (drive-by-downloads, Example: RBN (Russian Business Network): responsible for Storm, MalwareAlarm, much more...

Cybercrime Pseudo-Goals

OWASP Top 10

SQL Injection Example Web Browser Web Server Database Username & Password Normal Query SELECT passwd FROM USERS WHERE uname IS $username

QL Injection Example Attacker Provides This Input

QL Injection Example Web Browser Username & Password Web Server Malicious Query SELECT passwd FROM USERS WHERE uname IS ; DROP TABLE USERS; -- ' Database Eliminates all user accounts

http://xkcd.com/327/

Innovative Injection Attacks It is not just about web applications: Airline boarding passes Malicious credit card merchants

QL Injection Example View pizza order history:<br br> <form method="post" action="..."> Month <select> <option name="month" value="1"> Jan</option>... <option name="month" value="12"> Dec</option> </select> <p> <input type=submit name=submit value=view> </form>

QL Injection Example Normal SQL Query SELECT pizza, toppings, quantity, order_day FROM orders WHERE userid=4123 AND order_month=10 Type 2 For order_month parameter, attacker could Attack input 0 OR 1=1 Malicious Query WHERE userid=4123 WHERE condition is always true! Gives attacker access to other users private data! <option name="month" value= 0 OR 1=1"> Dec</option>

QL Injection Example All User Data Compromised

QL Injection Example A more damaging breach of user privacy: For order_month parameter, attacker could input: 0 AND 1=0 UNION SELECT cardholder, number, exp_month, exp_year FROM creditcards Attacker is able to Combine the results of two queries Empty table from first query with the sensitive credit card info of all users from second query

QL Injection Example Credit Card Info Compromised

Where You Can Learn More The Ultimate Online Software Security Course What Every Developer Needs to Know 9 Hours / Six modules for only $249! Online multimedia experience Presented by Neil Daswani, Ph.D. Free copy of Neil's book included NO Shipping Charges! http://y

Log keystrokes, DoS, etc. Building Botnets with SQL Injection Attacker Query for vulnerable sites Search Engine Inject malicious Javascript/ActiveX Target ( Site(s User View Page What do you want to do today? Get Infected: Drive-by-download

Preventing SQL Injection Whitelisting Why? Blacklisting chars doesn t work: Doesn t prevent many attacks Forget to filter out some characters ( O Brien Could prevent valid input (e.g. username Allow well-defined set of safe values via reg ex: [A-Za-z0-9]* [0-1][0-9] Can be implemented in a web application firewall ( mod_security (e.g., Escaping For valid string inputs like username o connor, use escape characters. Ex: escape(o connor) = o connor

Prepared Statements & Bind Variables reparedstatement ps = db.preparestatement( "SELECT pizza, toppings, quantity, order_day FROM orders WHERE userid=? AND order_month=?"); s.setint(1, session.getcurrentuserid()); s.setint(2, Integer.parseInt( request.getparameter("month"))) esultset res = ps.executequery(); query parsed w/o parameters bind variables are typed e.g. int, string, etc * Bind Variables: Data Placeholders

Web Application Firewalls ( WAF ) Without a WAF: http://a.com/showarticle?id=278 http://a.com/showarticle?id=345 Webserver http://a.com/showarticle?id=12 With a WAF: http://a.com/showarticle?id=278 http://a.com/showarticle?id=345 WAF Webserver http://a.com/showarticle?id=12

Web Application Firewalls Can prevent some attacks ModSecurity Core Rule Example:: SecRule REQUEST_FILENAME ARGS "\b(?:user_(?:(?:object table user)s password group) a(?:tt(?:rel typ)id ll_objects) object_(?:(?:nam ty p)e id) pg_(?:attribute class) column_(?:name id) su bstr(?:ing)? table_name mb_users rownum)\b" \ capture,t:htmlentitydecode,t:lowercase,t:replacecomm ents,ctl:auditlogparts=+e,log,auditlog,msg:'sql Injection Attack. Matched signature <%{TX.0}>',id:'950906',severity:'2' Can develop application-specific rules as well

Additional Mitigations What else helps? ( Defense-in-Depth ) Limit Privileges Harden DB Server and Host OS What else do I need to learn about SQL Injection? Second Order SQL Injection Blind SQL Injection

Trends In the second half of 2007, 58 percent of all vulnerabilities affected Web applications Symantec better to compromise a specific popular site with a single vulnerability Symantec 80% of sites hosting malware are legitimate sites that have been hacked -- Sophos Today over 70% of attacks against a company s web site or web application come at the application layer not the network or the system layer. -- Gartner

Where to learn more Foundations of Security: What Every Programmer Needs To Know (Daswani / Kern / Kesavan)

Where to learn more The Ultimate Online Software Security Course: Secure Design and Principles Worms and Malware Client-State Manipulation SQL Injection Cross-Domain Attacks Password Security Cryptography: Symmetric, Public-Key Hashing, Digital Signatures, Key Mgmt http://y

To conclude... Software and database security is everyone's problem! To learn more visit: http://y