SlideShare a Scribd company logo
SQL Injection Part 1 - BASICSWasimHalani(WaSHaL)
./whoamiStudentFallibleNOT a SQL expert“Do not take anything I say as fact. I have been wrong before and I will be wrong again.” - Nullthreat
OWASP Top 10A1 – Injection FlawsInjection flaws, such as SQL, OS, and LDAP injection, occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing unauthorized data.Simpler definition, anyone? 
SQL InjectionSQL = Structured Query LanguageExecute a SQL query/statement or syntax by injecting it in an user input field on the web application
Why study it?BarracudaHBGary/ HBGary FederalAppinonlineAppinlabsNIITMysql.com
Our Sample DBuser_db
Generic SQL - SelectSQL> select * from userdb where username=‘xxxx’ and password=‘yyyy’;returns all columns from table ‘userdb’ and every row which have given username and passwordSQL> select role from userdb where username=‘zzzz’;returns only column ‘role’ where username matches
UNION OperatorCombine results of two or more SELECT statementsSELECT username,password from user_db UNION SELECT username,password from admin_dbSELECT username,password from user_db UNION ALL SELECT username,password from admin_db
ORDER BY ClauseSort results of SELECT query by a specific columnnumber column name
Misc.INSERTUPDATEDELETEALTERDROP
Categories of SQL InjectionIn-bandErrorUnionOut-bandDnsPingInferential (Blind)SleepWaitforRef: www.toorcon.org/tcx/9_McCray.pdf
SQL Injection Attacks
Vulnerable Code
Vanilla Injection‘ or 1=1 --a‘ or ‘a’=‘a
Finding # of Columns1234....100
Finding # of Columns - 2
Injecting Queries (UNION)Ref: http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/
ToolsNetsparker (Pro/Community)HavijSQLMapSQLNinja
Coming Up…Blind SQLManual Extraction of Data using SQLi+BurpPreventing SQL Injections
Questions?*wasimhalani@gmail.com@washalsechttp://securitythoughts.wordpress.com/*Conditions Apply

More Related Content

PPTX
SQL INJECTION
PPT
Sql injection
PDF
Sql Injection - Vulnerability and Security
PPTX
Sql injection
PPTX
Sql injection
PPTX
SQL Injection
PPTX
Sql injection - security testing
PPTX
SQL injection prevention techniques
SQL INJECTION
Sql injection
Sql Injection - Vulnerability and Security
Sql injection
Sql injection
SQL Injection
Sql injection - security testing
SQL injection prevention techniques

What's hot (20)

PPTX
SQL Injection
PPTX
Sql injections - with example
PPTX
Sql Injection attacks and prevention
PDF
What is SQL Injection Attack | How to prevent SQL Injection Attacks? | Cybers...
PPTX
Sql injection
PPT
Sql injection attack
PPT
A Brief Introduction in SQL Injection
PPTX
SQL injection
PPTX
Ppt on sql injection
PPT
Sql injection
PPT
SQL Injection
PPTX
Whatis SQL Injection.pptx
PDF
How to identify and prevent SQL injection
PPTX
Sql injection in cybersecurity
PPTX
Sql injections
PPTX
Sql injection
PDF
Sql Injection Myths and Fallacies
PPTX
SQL Injections - A Powerpoint Presentation
PPT
Sql injection
PPTX
SQL Injection
Sql injections - with example
Sql Injection attacks and prevention
What is SQL Injection Attack | How to prevent SQL Injection Attacks? | Cybers...
Sql injection
Sql injection attack
A Brief Introduction in SQL Injection
SQL injection
Ppt on sql injection
Sql injection
SQL Injection
Whatis SQL Injection.pptx
How to identify and prevent SQL injection
Sql injection in cybersecurity
Sql injections
Sql injection
Sql Injection Myths and Fallacies
SQL Injections - A Powerpoint Presentation
Sql injection
Ad

Viewers also liked (8)

PPT
Les attaques par injection sql
PPT
Introduction to SQL Injection
PPTX
SQL Injection
DOCX
Types of sql injection attacks
PPT
Sql Injection Attacks And Defense Presentatio (1)
PPTX
SQL INJECTION
PPT
Advanced sql injection 1
Les attaques par injection sql
Introduction to SQL Injection
SQL Injection
Types of sql injection attacks
Sql Injection Attacks And Defense Presentatio (1)
SQL INJECTION
Advanced sql injection 1
Ad

Similar to SQL Injections (Part 1) (20)

PDF
Sql injection
PDF
Sql injection
PPTX
03. sql and other injection module v17
PPTX
Sql injection
PPTX
SQL Injection in action with PHP and MySQL
PPTX
SQL Injection attack
PPTX
SQL INJECTION
PPTX
Sql injection
PPTX
Greensql2007
PPTX
Code injection and green sql
PPTX
Sql Injection V.2
PDF
Chapter 14 sql injection
PDF
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
PDF
Overview on SQL Injection Attacks
PPSX
Web application security
PPTX
Sql injections (Basic bypass authentication)
PPT
SQL Injection
PDF
Web Application Security 101 - 14 Data Validation
PPT
Advanced_SQL_ISASasASasaASnjection (1).ppt
PDF
Database security issues
Sql injection
Sql injection
03. sql and other injection module v17
Sql injection
SQL Injection in action with PHP and MySQL
SQL Injection attack
SQL INJECTION
Sql injection
Greensql2007
Code injection and green sql
Sql Injection V.2
Chapter 14 sql injection
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
Overview on SQL Injection Attacks
Web application security
Sql injections (Basic bypass authentication)
SQL Injection
Web Application Security 101 - 14 Data Validation
Advanced_SQL_ISASasASasaASnjection (1).ppt
Database security issues

More from n|u - The Open Security Community (20)

PDF
Hardware security testing 101 (Null - Delhi Chapter)
PPTX
SSRF exploit the trust relationship
PDF
PDF
Api security-testing
PDF
Introduction to TLS 1.3
PDF
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
PDF
Talking About SSRF,CRLF
PPTX
Building active directory lab for red teaming
PPTX
Owning a company through their logs
PPTX
Introduction to shodan
PDF
Detecting persistence in windows
PPTX
Frida - Objection Tool Usage
PDF
OSQuery - Monitoring System Process
PDF
DevSecOps Jenkins Pipeline -Security
PDF
Extensible markup language attacks
PPTX
PDF
Hardware security testing 101 (Null - Delhi Chapter)
SSRF exploit the trust relationship
Api security-testing
Introduction to TLS 1.3
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Talking About SSRF,CRLF
Building active directory lab for red teaming
Owning a company through their logs
Introduction to shodan
Detecting persistence in windows
Frida - Objection Tool Usage
OSQuery - Monitoring System Process
DevSecOps Jenkins Pipeline -Security
Extensible markup language attacks

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Machine Learning_overview_presentation.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
Teaching material agriculture food technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Network Security Unit 5.pdf for BCA BBA.
MYSQL Presentation for SQL database connectivity
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Machine Learning_overview_presentation.pptx
The AUB Centre for AI in Media Proposal.docx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation_ Review paper, used for researhc scholars
Per capita expenditure prediction using model stacking based on satellite ima...
Teaching material agriculture food technology
Building Integrated photovoltaic BIPV_UPV.pdf
Electronic commerce courselecture one. Pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Spectral efficient network and resource selection model in 5G networks
“AI and Expert System Decision Support & Business Intelligence Systems”
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Spectroscopy.pptx food analysis technology
sap open course for s4hana steps from ECC to s4
Network Security Unit 5.pdf for BCA BBA.

SQL Injections (Part 1)