SlideShare a Scribd company logo
SQL Injection:
How It Works,
How To Stop It
Grant Fritchey, Redgate Software
Goals
Understand how SQL Injection attacks occur
Identify the traces left behind by a SQL Injection attack
Learn how to prevent SQL Injection
scarydba.com
grant@scarydba.com
@gfritchey
Grant Fritchey
youtube.com/c/GrantFritchey
SQL Injection Data Breaches
Single Greatest Known Explanation of SQL Injection
https://www.xkcd.com/327/
SQL Injection: How It Works, How to Stop It
What is SQL
Injection?
SQL code added, injected,
to the input of a form,
application, or URL
All SQL-based databases
are vulnerable
All operating systems are
vulnerable
Requires
Improperly escaped input
No parameterization of
input
Inappropriate or
inadequate security on
database
You can’t handle SQL Injection
SQL Injection Attack Types
• Error-based SQL Injection
• Union-based SQL Injection
In-Band
Injection
Blind Injection
Out of Band
Injection
SQL Injection!
What A Show,
SQL Injection!
Here We Go,
We know you’re
wishing that we’d
go away…
How To Detect SQL Injection
NOTE: Not all attacks can be detected
Failed logins
Incorrect
syntax errors
Invalid object
errors
UNION ALL
errors
Permissions
errors
Changes to
the data
structures
I love the smell of SQL Injection in the morning
How To
Prevent SQL
Injection
Use parameterized stored procedures
Use parameterized statements
Validate all user input
Implement proper error handling
Least privilege principal
Qualifications?
SQL Injection,
murder, arson,
SQL Injection
You said SQL
Injection twice
I like SQL Injection
Additional
Mitigation
Techniques
Use encryption
Hash some values
Segregate your data storage
Enable database auditing
Log errors and changes
Nobody expects SQL Injection!
Where To Get More
Information
• OWASP Top 10 – 2017
• SQL Injection Attacks: A cheat sheet for business pros
• SQL Injection: Defense in Depth
• SQL Injection: How it Works and How to Thwart it
• Picking over the Bones of a SQL Injection Attack
• How to Detect SQL Injection Attacks
• National Cybersecurity and Communications
Integration Center
• SQLi Hall-of-Shame
Bobby Tables?
I thought you
were dead.
How To
Prevent SQL
Injection
Use parameterized stored procedures
Use parameterized statements
Validate all user input
Implement proper error handling
Least privilege principal
Goals
Understand how SQL Injection attacks occur
Identify the traces left behind by a SQL Injection attack
Learn how to prevent SQL Injection
scarydba.com
grant@scarydba.com
@gfritchey
Grant Fritchey
youtube.com/c/GrantFritchey
Information Sources
• https://www.theverge.com/2019/4/27/18518619/i-dress-up-virtual-
website-ftc-data-breach
• https://calgarysun.com/news/local-news/100-million-class-action-
lawsuit-filed-in-calgary-over-marriott-hotels-data-breach
• https://campustechnology.com/articles/2019/04/17/georgia-tech-
breach-strikes-possible-1-3-million.aspx
• https://www.thesslstore.com/blog/80-eye-opening-cyber-security-
statistics-for-2019/
• https://thefintechtimes.com/security-scorecard-reveals/
Film frames used in parady (aka, fair use)
• A Few Good Men
• History of the World
• Apocalypse Now
• Blazing Saddles
• Monty Python’s Flying Circus
• Escape From New York

More Related Content

What's hot (20)

PPTX
Security Testing Training With Examples
Alwin Thayyil
 
PDF
Security testing presentation
Confiz
 
PPTX
Web app security essentials
Rafał Hryniewski
 
PPTX
Security testing fundamentals
Cygnet Infotech
 
PPTX
Chapter1:information security overview
Dr.Sami Khiami
 
PPTX
Prevent Malicious Hacking Attacks on your APIs
SmartBear
 
PPTX
Security Testing
Qualitest
 
PDF
OWASP Top Ten in Practice
Security Innovation
 
PPTX
Don't get stung - an introduction to the OWASP Top 10
Barry Dorrans
 
PPTX
Security misconfiguration
Jiri Danihelka
 
PPT
Step by step guide for web application security testing
Avyaan, Web Security Company in India
 
PPTX
Basics of getting Into Bug Bounty Hunting
Muhammad Khizer Javed
 
PDF
OWASP Top 10 - 2017
HackerOne
 
PPS
Security testing
Tabăra de Testare
 
PPTX
Anatomy Web Attack
Kelly Speiser
 
PDF
Preventing Security Leaks in SharePoint with Joel Oleson & Christian Buckley
Joel Oleson
 
PPTX
Security testing
Khizra Sammad
 
PDF
Protecting Against Vulnerabilities in SharePoint Add-ons
Imperva
 
PPTX
Web Application Vulnerabilities
Preetish Panda
 
PDF
Getting Started With Hacking Android & iOS Apps? Tools, Techniques and resources
OWASP Delhi
 
Security Testing Training With Examples
Alwin Thayyil
 
Security testing presentation
Confiz
 
Web app security essentials
Rafał Hryniewski
 
Security testing fundamentals
Cygnet Infotech
 
Chapter1:information security overview
Dr.Sami Khiami
 
Prevent Malicious Hacking Attacks on your APIs
SmartBear
 
Security Testing
Qualitest
 
OWASP Top Ten in Practice
Security Innovation
 
Don't get stung - an introduction to the OWASP Top 10
Barry Dorrans
 
Security misconfiguration
Jiri Danihelka
 
Step by step guide for web application security testing
Avyaan, Web Security Company in India
 
Basics of getting Into Bug Bounty Hunting
Muhammad Khizer Javed
 
OWASP Top 10 - 2017
HackerOne
 
Security testing
Tabăra de Testare
 
Anatomy Web Attack
Kelly Speiser
 
Preventing Security Leaks in SharePoint with Joel Oleson & Christian Buckley
Joel Oleson
 
Security testing
Khizra Sammad
 
Protecting Against Vulnerabilities in SharePoint Add-ons
Imperva
 
Web Application Vulnerabilities
Preetish Panda
 
Getting Started With Hacking Android & iOS Apps? Tools, Techniques and resources
OWASP Delhi
 

Similar to SQL Injection: How It Works, How to Stop It (20)

PPTX
SQL Injection: Unraveling the Threats
InsecureLab
 
PPTX
Whatis SQL Injection.pptx
Simplilearn
 
PPTX
cgbhjjjjjjjnmmmkmmmmmmkkkkkkTutorial5.pptx
prasadGade6
 
DOCX
Understanding SQL Injection_ A Guide to Website Security.docx
Oscp Training
 
PDF
SQL injection Colombo Cybersecurity Meetup
Janith Malinga
 
PDF
How to identify and prevent SQL injection
Eguardian Global Services
 
PPTX
Sql Injection
penetration Tester
 
PDF
Protect Your Database_ SQL Injection Attack Prevention.pdf
Sachin FromDev
 
PPTX
SQL Injection Introduction and Prevention
Mohammed Fazuluddin
 
PPTX
Sql injections (Basic bypass authentication)
Ravindra Singh Rathore
 
PPTX
SQL INJECTION
Anoop T
 
PPTX
Sql injection
The Avi Sharma
 
PPTX
Dtabase sdouhosef kfkksw oefkksjnc oiwon owDBMS.pptx
dilshadmkp2
 
PPTX
Sql injection
Uzair ul Haq Khan
 
PDF
What is advanced SQL Injection? Infographic
JW CyberNerd
 
PPTX
Code injection
Gayatri Patel
 
PPT
Sql injection
Pallavi Biswas
 
PPTX
Understanding and preventing sql injection attacks
Kevin Kline
 
PPTX
SQL Injection Stegnography in Pen Testing
191013607gouthamsric
 
PDF
IRJET- Detection of SQL Injection using Machine Learning : A Survey
IRJET Journal
 
SQL Injection: Unraveling the Threats
InsecureLab
 
Whatis SQL Injection.pptx
Simplilearn
 
cgbhjjjjjjjnmmmkmmmmmmkkkkkkTutorial5.pptx
prasadGade6
 
Understanding SQL Injection_ A Guide to Website Security.docx
Oscp Training
 
SQL injection Colombo Cybersecurity Meetup
Janith Malinga
 
How to identify and prevent SQL injection
Eguardian Global Services
 
Sql Injection
penetration Tester
 
Protect Your Database_ SQL Injection Attack Prevention.pdf
Sachin FromDev
 
SQL Injection Introduction and Prevention
Mohammed Fazuluddin
 
Sql injections (Basic bypass authentication)
Ravindra Singh Rathore
 
SQL INJECTION
Anoop T
 
Sql injection
The Avi Sharma
 
Dtabase sdouhosef kfkksw oefkksjnc oiwon owDBMS.pptx
dilshadmkp2
 
Sql injection
Uzair ul Haq Khan
 
What is advanced SQL Injection? Infographic
JW CyberNerd
 
Code injection
Gayatri Patel
 
Sql injection
Pallavi Biswas
 
Understanding and preventing sql injection attacks
Kevin Kline
 
SQL Injection Stegnography in Pen Testing
191013607gouthamsric
 
IRJET- Detection of SQL Injection using Machine Learning : A Survey
IRJET Journal
 
Ad

More from Grant Fritchey (20)

PDF
You Need a PostgreSQL Restore Plan Presentation
Grant Fritchey
 
PDF
PostgreSQL Query Performance Monitoring for the Absolute Beginner
Grant Fritchey
 
PDF
Leveraging AI for the PostgreSQL DBA #pgconf.eu
Grant Fritchey
 
PDF
Exploring Execution Plans, Learning to Read SQL Server Execution Plans
Grant Fritchey
 
PPTX
SQL Server Performance Tuning: Common Problems, Possible Solutions
Grant Fritchey
 
PDF
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
PPTX
Migrating To PostgreSQL
Grant Fritchey
 
PPTX
PostgreSQL Performance Problems: Monitoring and Alerting
Grant Fritchey
 
PDF
Automating Database Deployments Using Azure DevOps
Grant Fritchey
 
PDF
Learn To Effectively Use Extended Events_Techorama.pdf
Grant Fritchey
 
PDF
Using Query Store to Understand and Control Query Performance
Grant Fritchey
 
PPTX
You Should Be Standing Here: Learn How To Present a Session
Grant Fritchey
 
PDF
Redgate Community Circle: Tools For SQL Server Performance Tuning
Grant Fritchey
 
PDF
10 Steps To Global Data Compliance
Grant Fritchey
 
PDF
Time to Use the Columnstore Index
Grant Fritchey
 
PDF
Introduction to SQL Server in Containers
Grant Fritchey
 
PDF
DevOps for the DBA
Grant Fritchey
 
PDF
Privacy and Protection in the World of Database DevOps
Grant Fritchey
 
PDF
SQL Server Tools for Query Tuning
Grant Fritchey
 
PPTX
Extending DevOps to SQL Server
Grant Fritchey
 
You Need a PostgreSQL Restore Plan Presentation
Grant Fritchey
 
PostgreSQL Query Performance Monitoring for the Absolute Beginner
Grant Fritchey
 
Leveraging AI for the PostgreSQL DBA #pgconf.eu
Grant Fritchey
 
Exploring Execution Plans, Learning to Read SQL Server Execution Plans
Grant Fritchey
 
SQL Server Performance Tuning: Common Problems, Possible Solutions
Grant Fritchey
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Migrating To PostgreSQL
Grant Fritchey
 
PostgreSQL Performance Problems: Monitoring and Alerting
Grant Fritchey
 
Automating Database Deployments Using Azure DevOps
Grant Fritchey
 
Learn To Effectively Use Extended Events_Techorama.pdf
Grant Fritchey
 
Using Query Store to Understand and Control Query Performance
Grant Fritchey
 
You Should Be Standing Here: Learn How To Present a Session
Grant Fritchey
 
Redgate Community Circle: Tools For SQL Server Performance Tuning
Grant Fritchey
 
10 Steps To Global Data Compliance
Grant Fritchey
 
Time to Use the Columnstore Index
Grant Fritchey
 
Introduction to SQL Server in Containers
Grant Fritchey
 
DevOps for the DBA
Grant Fritchey
 
Privacy and Protection in the World of Database DevOps
Grant Fritchey
 
SQL Server Tools for Query Tuning
Grant Fritchey
 
Extending DevOps to SQL Server
Grant Fritchey
 
Ad

Recently uploaded (20)

PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PDF
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PPTX
Perfecting XM Cloud for Multisite Setup.pptx
Ahmed Okour
 
PDF
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
 
PPTX
WYSIWYG Web Builder Crack 2025 – Free Download Full Version with License Key
HyperPc soft
 
PPTX
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
PPTX
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
PDF
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
PDF
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
PDF
Dealing with JSON in the relational world
Andres Almiray
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
PDF
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
PPTX
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
Perfecting XM Cloud for Multisite Setup.pptx
Ahmed Okour
 
LPS25 - Operationalizing MLOps in GEP - Terradue.pdf
terradue
 
WYSIWYG Web Builder Crack 2025 – Free Download Full Version with License Key
HyperPc soft
 
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
Dealing with JSON in the relational world
Andres Almiray
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
Beyond Binaries: Understanding Diversity and Allyship in a Global Workplace -...
Imma Valls Bernaus
 
MailsDaddy Outlook OST to PST converter.pptx
abhishekdutt366
 

SQL Injection: How It Works, How to Stop It