SlideShare a Scribd company logo
1 of 17
Download to read offline
Presented by
Sandeep Kumbhar
M.Tech (CSE), RNSIT
 Introduction
 Types of SQL Injection
 Approaches to detect SQL Injection
 How to prevent SQL Injection
 Conclusion
Dept. of CSE, RNSIT 2012
➢What is SQL Injection?
1
Dept. of CSE, RNSIT 2012
2
Dept. of CSE, RNSIT 2012
➢ Tautology
Example –
Select * from <tablename>
where userId = <id> and password = <wrongPassword> or 1=1;
➢ Logically incorrect queries
Example –
Select * from <tablename>
where userId = ‘xyz”” and password = <wrongPassword> or 1=1;
3
Dept. of CSE, RNSIT 2012
➢ Union queries
➢ Piggy-backed queries
4
Dept. of CSE, RNSIT 2012
➢ Stored Procedures
Example –
Select * from <tablename>
where userId = <id> and password = <Password> or 1=1; SHUTDOWN;
➢ Blind Injection
Example-
SELECT name FROM <tablename> WHERE id=<username> and 1 =0 -- AND pass =
SELECT name FROM <tablename> WHERE id=<username> and 1 = 1 -- AND pass =
5
Dept. of CSE, RNSIT 2012
➢ Timing Attacks
Example-
Declare @s varchar(500)
select @s = db_nameO
if (ascii(substring(@s, I, I)) & ( power(3, 0))) > O waitfor delay '0:0:10‘
➢ Alternate Encoding
Example-
SELECT name FROM <tablename> WHERE id=’’and
password=O;exec(char(O x73687574646j776e))
6
Dept. of CSE, RNSIT 2012
 Mechanism to detect SQL injection attacks.
 Knowledge of SQL injection vulnerabilities in web
applications.
 IDS Approach
◦ Generic Signature
◦ Accurate & Taint Propagation
◦ Syntax-aware evaluation
◦ Minimal Deployment Requirements
7
Dept. of CSE, RNSIT 2012
Dept. of CSE, RNSIT 2012 8
Fig-1: Identification of trusted and untrusted data
Dept. of CSE, RNSIT 2012 9
Fig-2 shows the SQL Injection Detection Process
 For Database Administration
1. Install the database on a different machine than the Web server or
application server.
2. Disable all the default accounts and passwords disabled, including the
super-user account
3. Create user account that has the minimum privileges necessary for that
application to access the data.
4. Identify the list of SQL statements that will be used by the application
and only allow such SQL statements, e.g. Select, Insert, Update, etc.
5. Use read-only views for SQL statements that do not require any inserts
or updates, e.g. Search functionality or Login functionality
10
Dept. of CSE, RNSIT 2012
 For Developer
1. Sanitize the input by validating it in your code
2. Use parameterized queries instead of dynamic queries.
For example: in Java, use Prepared Statement instead of Statement Object
3.Employ proper error handling and logging within the application so that a
database error or any other type of technical information is not revealed to
the user
4. Choose names for tables and fields that are not easy to guess
5. Use stored procedures instead of raw SQL wherever possible
11
Dept. of CSE, RNSIT 2012
 Security is still one of the major issues all across the globe.
 It is not difficult to prevent SQL injection attacks.
 Developer training has been very helpful in increasing their
understanding of website vulnerabilities and the extent of
damage they can do.
Dept. of CSE, RNSIT 2012 12
“Precaution is better than cure.”
13
Dept. of CSE, RNSIT 2012
[1] A. Baranwal Approaches To Detect SQLinjection and XSS in Web Application
EECE 571B, Term Survey Paper, April 2012
[2] Protect your Websites from SQL Injection Attacks February 2010 Anurag Agarwal
Director of Education Services, WhiteHat Security www.whitehatsec.com
[3] A. SRAVANTHI* et al. ISSN: 2250–3676 [IJESAT] International Journal Of
Engineering Science & Advanced Technology Volume-2, Issue-3, 664 – 671
[4] http://www.owasp.org/index.php/Top_10_2010-A1-Injection, retrieved on
13/01/2010
14
Dept. of CSE, RNSIT 2012
Approaches to detect and prevent sql injection in web applications

More Related Content

Similar to Approaches to detect and prevent sql injection in web applications

Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Barry Dorrans
 
Oracle Security Presentation
Oracle Security PresentationOracle Security Presentation
Oracle Security PresentationFrancisco Alvarez
 
Ijeee 51-57-preventing sql injection attacks in web application
Ijeee 51-57-preventing sql injection attacks in web applicationIjeee 51-57-preventing sql injection attacks in web application
Ijeee 51-57-preventing sql injection attacks in web applicationKumar Goud
 
Top 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsTop 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsNarudom Roongsiriwong, CISSP
 
10h 35m remaining CHAPTER 12 Common Software Vulnerabili
10h 35m remaining CHAPTER 12 Common Software Vulnerabili10h 35m remaining CHAPTER 12 Common Software Vulnerabili
10h 35m remaining CHAPTER 12 Common Software VulnerabiliBenitoSumpter862
 
10h 35m remaining CHAPTER 12 Common Software Vulnerabili
10h 35m remaining CHAPTER 12 Common Software Vulnerabili10h 35m remaining CHAPTER 12 Common Software Vulnerabili
10h 35m remaining CHAPTER 12 Common Software VulnerabiliSantosConleyha
 
Literature Survey on Web based Recognition of SQL Injection Attacks
Literature Survey on Web based Recognition of SQL Injection AttacksLiterature Survey on Web based Recognition of SQL Injection Attacks
Literature Survey on Web based Recognition of SQL Injection AttacksIRJET Journal
 
A Study on Detection and Prevention of SQL Injection Attack
A Study on Detection and Prevention of SQL Injection AttackA Study on Detection and Prevention of SQL Injection Attack
A Study on Detection and Prevention of SQL Injection AttackIRJET Journal
 
Application Security 101 (OWASP DC)
Application Security 101 (OWASP DC)Application Security 101 (OWASP DC)
Application Security 101 (OWASP DC)mikemcbryde
 
Sql server security in an insecure world
Sql server security in an insecure worldSql server security in an insecure world
Sql server security in an insecure worldGianluca Sartori
 
Web Security: SQL Injection
Web Security: SQL InjectionWeb Security: SQL Injection
Web Security: SQL InjectionVortana Say
 
SalemPhilip_ResearchReport
SalemPhilip_ResearchReportSalemPhilip_ResearchReport
SalemPhilip_ResearchReportPhilip Salem
 
Prevention of SQL Injection Attacks having XML Database
Prevention of SQL Injection Attacks having XML DatabasePrevention of SQL Injection Attacks having XML Database
Prevention of SQL Injection Attacks having XML DatabaseIOSR Journals
 
SQL Server 2012 Security Task
SQL Server 2012 Security TaskSQL Server 2012 Security Task
SQL Server 2012 Security TaskYaakub Idris
 

Similar to Approaches to detect and prevent sql injection in web applications (20)

Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10
 
Oracle Security Presentation
Oracle Security PresentationOracle Security Presentation
Oracle Security Presentation
 
Ijeee 51-57-preventing sql injection attacks in web application
Ijeee 51-57-preventing sql injection attacks in web applicationIjeee 51-57-preventing sql injection attacks in web application
Ijeee 51-57-preventing sql injection attacks in web application
 
Top 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security ProblemsTop 10 Bad Coding Practices Lead to Security Problems
Top 10 Bad Coding Practices Lead to Security Problems
 
10h 35m remaining CHAPTER 12 Common Software Vulnerabili
10h 35m remaining CHAPTER 12 Common Software Vulnerabili10h 35m remaining CHAPTER 12 Common Software Vulnerabili
10h 35m remaining CHAPTER 12 Common Software Vulnerabili
 
10h 35m remaining CHAPTER 12 Common Software Vulnerabili
10h 35m remaining CHAPTER 12 Common Software Vulnerabili10h 35m remaining CHAPTER 12 Common Software Vulnerabili
10h 35m remaining CHAPTER 12 Common Software Vulnerabili
 
Literature Survey on Web based Recognition of SQL Injection Attacks
Literature Survey on Web based Recognition of SQL Injection AttacksLiterature Survey on Web based Recognition of SQL Injection Attacks
Literature Survey on Web based Recognition of SQL Injection Attacks
 
A Study on Detection and Prevention of SQL Injection Attack
A Study on Detection and Prevention of SQL Injection AttackA Study on Detection and Prevention of SQL Injection Attack
A Study on Detection and Prevention of SQL Injection Attack
 
Application Security 101 (OWASP DC)
Application Security 101 (OWASP DC)Application Security 101 (OWASP DC)
Application Security 101 (OWASP DC)
 
Sql server security in an insecure world
Sql server security in an insecure worldSql server security in an insecure world
Sql server security in an insecure world
 
Sql Injection
Sql InjectionSql Injection
Sql Injection
 
Web Security: SQL Injection
Web Security: SQL InjectionWeb Security: SQL Injection
Web Security: SQL Injection
 
SalemPhilip_ResearchReport
SalemPhilip_ResearchReportSalemPhilip_ResearchReport
SalemPhilip_ResearchReport
 
Prevention of SQL Injection Attacks having XML Database
Prevention of SQL Injection Attacks having XML DatabasePrevention of SQL Injection Attacks having XML Database
Prevention of SQL Injection Attacks having XML Database
 
Ijcatr04041018
Ijcatr04041018Ijcatr04041018
Ijcatr04041018
 
ASP.NET Web Security
ASP.NET Web SecurityASP.NET Web Security
ASP.NET Web Security
 
Arved sandstrom - the rotwithin - atlseccon2011
Arved sandstrom - the rotwithin - atlseccon2011Arved sandstrom - the rotwithin - atlseccon2011
Arved sandstrom - the rotwithin - atlseccon2011
 
SQL Server 2012 Security Task
SQL Server 2012 Security TaskSQL Server 2012 Security Task
SQL Server 2012 Security Task
 
SQL Injection - Newsletter
SQL Injection - NewsletterSQL Injection - Newsletter
SQL Injection - Newsletter
 
SQL INJECTION ATTACKS.pptx
SQL INJECTION ATTACKS.pptxSQL INJECTION ATTACKS.pptx
SQL INJECTION ATTACKS.pptx
 

Recently uploaded

Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 

Recently uploaded (20)

Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 

Approaches to detect and prevent sql injection in web applications

  • 2.  Introduction  Types of SQL Injection  Approaches to detect SQL Injection  How to prevent SQL Injection  Conclusion Dept. of CSE, RNSIT 2012
  • 3. ➢What is SQL Injection? 1 Dept. of CSE, RNSIT 2012
  • 4. 2 Dept. of CSE, RNSIT 2012
  • 5. ➢ Tautology Example – Select * from <tablename> where userId = <id> and password = <wrongPassword> or 1=1; ➢ Logically incorrect queries Example – Select * from <tablename> where userId = ‘xyz”” and password = <wrongPassword> or 1=1; 3 Dept. of CSE, RNSIT 2012
  • 6. ➢ Union queries ➢ Piggy-backed queries 4 Dept. of CSE, RNSIT 2012
  • 7. ➢ Stored Procedures Example – Select * from <tablename> where userId = <id> and password = <Password> or 1=1; SHUTDOWN; ➢ Blind Injection Example- SELECT name FROM <tablename> WHERE id=<username> and 1 =0 -- AND pass = SELECT name FROM <tablename> WHERE id=<username> and 1 = 1 -- AND pass = 5 Dept. of CSE, RNSIT 2012
  • 8. ➢ Timing Attacks Example- Declare @s varchar(500) select @s = db_nameO if (ascii(substring(@s, I, I)) & ( power(3, 0))) > O waitfor delay '0:0:10‘ ➢ Alternate Encoding Example- SELECT name FROM <tablename> WHERE id=’’and password=O;exec(char(O x73687574646j776e)) 6 Dept. of CSE, RNSIT 2012
  • 9.  Mechanism to detect SQL injection attacks.  Knowledge of SQL injection vulnerabilities in web applications.  IDS Approach ◦ Generic Signature ◦ Accurate & Taint Propagation ◦ Syntax-aware evaluation ◦ Minimal Deployment Requirements 7 Dept. of CSE, RNSIT 2012
  • 10. Dept. of CSE, RNSIT 2012 8 Fig-1: Identification of trusted and untrusted data
  • 11. Dept. of CSE, RNSIT 2012 9 Fig-2 shows the SQL Injection Detection Process
  • 12.  For Database Administration 1. Install the database on a different machine than the Web server or application server. 2. Disable all the default accounts and passwords disabled, including the super-user account 3. Create user account that has the minimum privileges necessary for that application to access the data. 4. Identify the list of SQL statements that will be used by the application and only allow such SQL statements, e.g. Select, Insert, Update, etc. 5. Use read-only views for SQL statements that do not require any inserts or updates, e.g. Search functionality or Login functionality 10 Dept. of CSE, RNSIT 2012
  • 13.  For Developer 1. Sanitize the input by validating it in your code 2. Use parameterized queries instead of dynamic queries. For example: in Java, use Prepared Statement instead of Statement Object 3.Employ proper error handling and logging within the application so that a database error or any other type of technical information is not revealed to the user 4. Choose names for tables and fields that are not easy to guess 5. Use stored procedures instead of raw SQL wherever possible 11 Dept. of CSE, RNSIT 2012
  • 14.  Security is still one of the major issues all across the globe.  It is not difficult to prevent SQL injection attacks.  Developer training has been very helpful in increasing their understanding of website vulnerabilities and the extent of damage they can do. Dept. of CSE, RNSIT 2012 12
  • 15. “Precaution is better than cure.” 13 Dept. of CSE, RNSIT 2012
  • 16. [1] A. Baranwal Approaches To Detect SQLinjection and XSS in Web Application EECE 571B, Term Survey Paper, April 2012 [2] Protect your Websites from SQL Injection Attacks February 2010 Anurag Agarwal Director of Education Services, WhiteHat Security www.whitehatsec.com [3] A. SRAVANTHI* et al. ISSN: 2250–3676 [IJESAT] International Journal Of Engineering Science & Advanced Technology Volume-2, Issue-3, 664 – 671 [4] http://www.owasp.org/index.php/Top_10_2010-A1-Injection, retrieved on 13/01/2010 14 Dept. of CSE, RNSIT 2012