SlideShare a Scribd company logo
SQL INJECTION
AND
GREEN SQL
ABHISHEK KUMAR PRASAD (25500111003)
DEBLINA CHOWDHURY (25500111018)
KAUSTAV SENGUPTA (25500111024)
Internet in daily life
Code injection
SQl injection
GreenSQL
“Life has become easy by
INTERNET…”
It is a computer- based global information system.
 Composed of many interconnected computer
networks.
 Each network links with thousands of computers.
 Enabling links to share information and processing
power.
 Wonderful tool provides information at our finger tips.
INTRODUCTION TO INTERNET
EXTREME IMPACTS OF INTERNET
► Saved the world a great deal of time and money.
► There is a big influence of technique on our daily life.
► It is one of the newest and most forward-looking media
HOW INTERNET MADE LIFE EASY
INTERNET MADE CHANGES IN….
Bill payments
Railway Reservations
Banking
Business
Entertainment
Information
Weather Reports
Education
Job Search Engine
Shopping
DISADVANTAGES
 Hacking
 Code Injection
 Spamming
 Virus
 In Appropriate websites
 Isolation
 Inaccurate information
What is code injection?
• Code injection is the exploitation of a computer
bug that is caused by processing invalid data.
• Code injection can be used by an attacker to
introduce (or "inject") code into a computer
program to change the course of execution.
• The results of a code injection attack can be
disastrous
Code injection
Different types of Code injection
• SQL injection
• LDAP Injection
• OS Command Injection
• Cross-Site Scripting (“XSS”)
 Many web applications take user input from a form
 Often this user input is used literally in the construction of a SQL query
submitted to a database. For example:
 SELECT productdata FROM table WHERE productname = ‘user input
product name’;
 A SQL injection attack involves placing SQL statements in the user
input
What is a SQL Injection Attack?
SQL injection
Input contains special characters and hidden SQL commands
Server accidentally passes hidden SQL commands to database.
Product Search:
 This input is put directly into the SQL statement within the Web
application:
 $query = “SELECT prodinfo FROM prodtable WHERE prodname = ‘” .
$_POST[‘prod_search’] . “’”;
 Creates the following SQL:
 SELECT prodinfo FROM prodtable WHERE prodname = ‘blah‘ OR ‘x’ = ‘x’
 Attacker has now successfully caused the entire database to be
returned.
An Example SQL Injection Attack
‘blah‘ OR ‘x’ = ‘x’
Sample SQL injection
User Input Chris’; DROP TABLE USER_TABLE;--
Query SELECT password FROM USER_TABLE WHERE username=‘Chris’; DROP TABLE
USER_TABLE;--’
Result USER_TABLE is deleted by the hacker.
Example 1: Data Loss
Example 2: Data Leakage
User Input ‘AND 1=0 UNION
SELECT card_number AS uid,card_holder_name
AS uname,expiry_date AS password FROM
CREDITCARD’
Query SELECT uid,uname,password FROM USERS WHERE
uname=‘AND 1=0 UNION
SELECT card_number AS uid,card_holder_name
AS uname,expiry_date AS password FROM
CREDITCARD’
Examples of SQL injection
These attacks noted on the Eastern European website started early in March and by
Wednesday March 12, 2008, 10,000 Web pages were compromised. Here is a diagram
of how it is done
Examples of SQL injection
Here is a diagram of how to protect against it
 Using SQL injections, attackers can:
 Add new data to the database
 Could be embarrassing to find yourself selling politically
incorrect items on an e-Commerce site
 Perform an INSERT in the injected SQL
 Modify data currently in the database
 Could be very costly to have an expensive item suddenly be
deeply ‘discounted’
 Perform an UPDATE in the injected SQL
 Often can gain access to other user’s system capabilities by
obtaining their password
Other injection possibilities
 Use provided functions for escaping strings
 Many attacks can be thwarted by simply using the SQL string escaping
mechanism
 ‘  ’ and “  ”
 mysql_real_escape_string() is the preferred function for this
 Not a silver bullet!
 Consider:
 SELECT fields FROM table WHERE id = 23 OR 1=1
 No quotes here!
Defenses
 Check syntax of input for validity
 Many classes of input have fixed languages
 Email addresses, dates, part numbers, etc.
 Verify that the input is a valid string in the language
 Sometime languages allow problematic characters (e.g., ‘*’ in
email addresses); may decide to not allow these
 If you can exclude quotes and semicolons that’s good
 Not always possible: consider the name Bill O’Reilly
 Want to allow the use of single quotes in names
 Have length limits on input
 Many SQL injection attacks depend on entering long strings
More Defenses
 Scan query string for undesirable word combinations that
indicate SQL statements
 INSERT, DROP, etc.
 If you see these, can check against SQL syntax to see if they
represent a statement or valid user input
 Limit database permissions and segregate users
 If you’re only reading the database, connect to database
as a user that only has read permissions
 Never connect as a database administrator in your web
application
More Defenses
 Configure database error reporting
 Default error reporting often gives away information that is valuable for
attackers (table name, field name, etc.)
 Configure so that this information is never exposed to a user
 If possible, use bound variables
 Some libraries allow you to bind inputs to variables inside a SQL statement
 PERL example (from http://www.unixwiz.net/techtips/sql-injection.html)
$sth = $dbh->prepare("SELECT email, userid FROM members WHERE email =
?;");
$sth->execute($email);
More Defenses
SQL Injection
 Code injection technique
 Gain Unauthorized access to database
Web Application Architecture
GreenSQL
 Known as database firewall
 Works as a proxy for SQL commands
 Calculates risks of queries
 Supports different modes for protection
• SQL Injection protection
• Full separation of duties
• Database Activity Monitoring ( DAM )
• IPS/IDS
• Learning mode
• Flexible deployment options
• Highly granular rules
• Real time e-mail alerts
Calculation of Risky Queries
 Fingerprinting of database
 Stack-based queries
 SQL tautology
Modes of GreenSQL
 IDS Mode
 IPS Mode
 Learning Mode
 Database Firewall Mode
GreenSQL Architecture
GreenSQL Login
GreenSQL Dashboard
GreenSQL Database List
GreenSQL Whitelist Configuration
GreenSQL Database Settings
GreenSQL Database Overview
GreenSQL Mail Alerts
Conclusion
 Provides great security regarding different sql attacks
 Can be used as a penetration tool !!!
Code injection and green sql
Code injection and green sql

More Related Content

What's hot

Code injection
Code injectionCode injection
Code injection
Gayatri Patel
 
Sql
SqlSql
Sql
IJASCSE
 
SQL injection implementation and prevention
SQL injection implementation and prevention SQL injection implementation and prevention
SQL injection implementation and prevention
Rejaul Islam Royel
 
Time-Based Blind SQL Injection using Heavy Queries
Time-Based Blind SQL Injection using Heavy QueriesTime-Based Blind SQL Injection using Heavy Queries
Time-Based Blind SQL Injection using Heavy Queries
Chema Alonso
 
Time-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy QueriesTime-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy Queries
Chema Alonso
 
Time-Based Blind SQL Injection
Time-Based Blind SQL InjectionTime-Based Blind SQL Injection
Time-Based Blind SQL Injection
matt_presson
 
SQL Injection
SQL InjectionSQL Injection
SQL Injection
Abhinav Nair
 
Sql injection
Sql injectionSql injection
Sql injection
Sasha-Leigh Garret
 
Web security with Eng Ahmed Galal and Eng Ramy saeid
Web security with Eng Ahmed Galal and Eng Ramy saeid Web security with Eng Ahmed Galal and Eng Ramy saeid
Web security with Eng Ahmed Galal and Eng Ramy saeid
Ahmed Ghazey
 
SQL Injection Tutorial
SQL Injection TutorialSQL Injection Tutorial
SQL Injection Tutorial
Magno Logan
 
Practical Approach towards SQLi ppt
Practical Approach towards SQLi pptPractical Approach towards SQLi ppt
Practical Approach towards SQLi ppt
Ahamed Saleem
 
Web application security
Web application securityWeb application security
Web application security
www.netgains.org
 
Sql Injection
Sql InjectionSql Injection
Sql Injection
Tayyip Gören
 
Sql injection in cybersecurity
Sql injection in cybersecuritySql injection in cybersecurity
Sql injection in cybersecurity
Sanad Bhowmik
 
Ijcet 06 10_005
Ijcet 06 10_005Ijcet 06 10_005
Ijcet 06 10_005
IAEME Publication
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
webhostingguy
 
SQLite Database Tutorial In Android
SQLite Database Tutorial In AndroidSQLite Database Tutorial In Android
SQLite Database Tutorial In Android
Android 5
 
Sql full tutorial
Sql full tutorialSql full tutorial
Sql full tutorial
Mozaaic Cyber Security
 
Always encrypted overview
Always encrypted overviewAlways encrypted overview
Always encrypted overview
SolidQ
 

What's hot (19)

Code injection
Code injectionCode injection
Code injection
 
Sql
SqlSql
Sql
 
SQL injection implementation and prevention
SQL injection implementation and prevention SQL injection implementation and prevention
SQL injection implementation and prevention
 
Time-Based Blind SQL Injection using Heavy Queries
Time-Based Blind SQL Injection using Heavy QueriesTime-Based Blind SQL Injection using Heavy Queries
Time-Based Blind SQL Injection using Heavy Queries
 
Time-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy QueriesTime-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy Queries
 
Time-Based Blind SQL Injection
Time-Based Blind SQL InjectionTime-Based Blind SQL Injection
Time-Based Blind SQL Injection
 
SQL Injection
SQL InjectionSQL Injection
SQL Injection
 
Sql injection
Sql injectionSql injection
Sql injection
 
Web security with Eng Ahmed Galal and Eng Ramy saeid
Web security with Eng Ahmed Galal and Eng Ramy saeid Web security with Eng Ahmed Galal and Eng Ramy saeid
Web security with Eng Ahmed Galal and Eng Ramy saeid
 
SQL Injection Tutorial
SQL Injection TutorialSQL Injection Tutorial
SQL Injection Tutorial
 
Practical Approach towards SQLi ppt
Practical Approach towards SQLi pptPractical Approach towards SQLi ppt
Practical Approach towards SQLi ppt
 
Web application security
Web application securityWeb application security
Web application security
 
Sql Injection
Sql InjectionSql Injection
Sql Injection
 
Sql injection in cybersecurity
Sql injection in cybersecuritySql injection in cybersecurity
Sql injection in cybersecurity
 
Ijcet 06 10_005
Ijcet 06 10_005Ijcet 06 10_005
Ijcet 06 10_005
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
 
SQLite Database Tutorial In Android
SQLite Database Tutorial In AndroidSQLite Database Tutorial In Android
SQLite Database Tutorial In Android
 
Sql full tutorial
Sql full tutorialSql full tutorial
Sql full tutorial
 
Always encrypted overview
Always encrypted overviewAlways encrypted overview
Always encrypted overview
 

Similar to Code injection and green sql

SQLSecurity.ppt
SQLSecurity.pptSQLSecurity.ppt
SQLSecurity.ppt
LokeshK66
 
SQLSecurity.ppt
SQLSecurity.pptSQLSecurity.ppt
SQLSecurity.ppt
CNSHacking
 
Ppt on sql injection
Ppt on sql injectionPpt on sql injection
Ppt on sql injection
ashish20012
 
Sql Injection V.2
Sql Injection V.2Sql Injection V.2
Sql Injection V.2
Tjylen Veselyj
 
Sql security
Sql securitySql security
Sql security
Safwan Hashmi
 
Sql injection
Sql injectionSql injection
Sql injection
Nikunj Dhameliya
 
Sql injection attacks
Sql injection attacksSql injection attacks
Sql injection attacks
chaitanya Lotankar
 
Prevention of SQL Injection Attack in Web Application with Host Language
Prevention of SQL Injection Attack in Web Application with Host LanguagePrevention of SQL Injection Attack in Web Application with Host Language
Prevention of SQL Injection Attack in Web Application with Host Language
IRJET Journal
 
Sql injection
Sql injectionSql injection
Sql injection
Nuruzzaman Milon
 
SQL Injection
SQL InjectionSQL Injection
SQL Injection
Asish Kumar Rath
 
Sql injection attacks
Sql injection attacksSql injection attacks
Sql injection attacks
Nitish Kumar
 
Protecting Your Web Site From SQL Injection & XSS
Protecting Your Web SiteFrom SQL Injection & XSSProtecting Your Web SiteFrom SQL Injection & XSS
Protecting Your Web Site From SQL Injection & XSS
skyhawk133
 
Understanding and preventing sql injection attacks
Understanding and preventing sql injection attacksUnderstanding and preventing sql injection attacks
Understanding and preventing sql injection attacks
Kevin Kline
 
A Brief Introduction in SQL Injection
A Brief Introduction in SQL InjectionA Brief Introduction in SQL Injection
A Brief Introduction in SQL Injection
Sina Manavi
 
Chapter 14 sql injection
Chapter 14 sql injectionChapter 14 sql injection
Chapter 14 sql injection
newbie2019
 
ASP.NET Web Security
ASP.NET Web SecurityASP.NET Web Security
ASP.NET Web Security
SharePointRadi
 
Php Security - OWASP
Php  Security - OWASPPhp  Security - OWASP
Php Security - OWASP
Mizno Kruge
 
E017131924
E017131924E017131924
E017131924
IOSR Journals
 
SQL Injection Prevention by Adaptive Algorithm
SQL Injection Prevention by Adaptive AlgorithmSQL Injection Prevention by Adaptive Algorithm
SQL Injection Prevention by Adaptive Algorithm
IOSR Journals
 
Sql injection attacks
Sql injection attacksSql injection attacks
Sql injection attacks
Kumar
 

Similar to Code injection and green sql (20)

SQLSecurity.ppt
SQLSecurity.pptSQLSecurity.ppt
SQLSecurity.ppt
 
SQLSecurity.ppt
SQLSecurity.pptSQLSecurity.ppt
SQLSecurity.ppt
 
Ppt on sql injection
Ppt on sql injectionPpt on sql injection
Ppt on sql injection
 
Sql Injection V.2
Sql Injection V.2Sql Injection V.2
Sql Injection V.2
 
Sql security
Sql securitySql security
Sql security
 
Sql injection
Sql injectionSql injection
Sql injection
 
Sql injection attacks
Sql injection attacksSql injection attacks
Sql injection attacks
 
Prevention of SQL Injection Attack in Web Application with Host Language
Prevention of SQL Injection Attack in Web Application with Host LanguagePrevention of SQL Injection Attack in Web Application with Host Language
Prevention of SQL Injection Attack in Web Application with Host Language
 
Sql injection
Sql injectionSql injection
Sql injection
 
SQL Injection
SQL InjectionSQL Injection
SQL Injection
 
Sql injection attacks
Sql injection attacksSql injection attacks
Sql injection attacks
 
Protecting Your Web Site From SQL Injection & XSS
Protecting Your Web SiteFrom SQL Injection & XSSProtecting Your Web SiteFrom SQL Injection & XSS
Protecting Your Web Site From SQL Injection & XSS
 
Understanding and preventing sql injection attacks
Understanding and preventing sql injection attacksUnderstanding and preventing sql injection attacks
Understanding and preventing sql injection attacks
 
A Brief Introduction in SQL Injection
A Brief Introduction in SQL InjectionA Brief Introduction in SQL Injection
A Brief Introduction in SQL Injection
 
Chapter 14 sql injection
Chapter 14 sql injectionChapter 14 sql injection
Chapter 14 sql injection
 
ASP.NET Web Security
ASP.NET Web SecurityASP.NET Web Security
ASP.NET Web Security
 
Php Security - OWASP
Php  Security - OWASPPhp  Security - OWASP
Php Security - OWASP
 
E017131924
E017131924E017131924
E017131924
 
SQL Injection Prevention by Adaptive Algorithm
SQL Injection Prevention by Adaptive AlgorithmSQL Injection Prevention by Adaptive Algorithm
SQL Injection Prevention by Adaptive Algorithm
 
Sql injection attacks
Sql injection attacksSql injection attacks
Sql injection attacks
 

Recently uploaded

Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 

Recently uploaded (20)

Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 

Code injection and green sql

  • 1.
  • 2. SQL INJECTION AND GREEN SQL ABHISHEK KUMAR PRASAD (25500111003) DEBLINA CHOWDHURY (25500111018) KAUSTAV SENGUPTA (25500111024)
  • 3. Internet in daily life Code injection SQl injection GreenSQL
  • 4. “Life has become easy by INTERNET…”
  • 5. It is a computer- based global information system.  Composed of many interconnected computer networks.  Each network links with thousands of computers.  Enabling links to share information and processing power.  Wonderful tool provides information at our finger tips. INTRODUCTION TO INTERNET
  • 7. ► Saved the world a great deal of time and money. ► There is a big influence of technique on our daily life. ► It is one of the newest and most forward-looking media HOW INTERNET MADE LIFE EASY
  • 8. INTERNET MADE CHANGES IN…. Bill payments Railway Reservations Banking Business Entertainment Information Weather Reports Education Job Search Engine Shopping
  • 9. DISADVANTAGES  Hacking  Code Injection  Spamming  Virus  In Appropriate websites  Isolation  Inaccurate information
  • 10. What is code injection? • Code injection is the exploitation of a computer bug that is caused by processing invalid data. • Code injection can be used by an attacker to introduce (or "inject") code into a computer program to change the course of execution. • The results of a code injection attack can be disastrous
  • 12. Different types of Code injection • SQL injection • LDAP Injection • OS Command Injection • Cross-Site Scripting (“XSS”)
  • 13.  Many web applications take user input from a form  Often this user input is used literally in the construction of a SQL query submitted to a database. For example:  SELECT productdata FROM table WHERE productname = ‘user input product name’;  A SQL injection attack involves placing SQL statements in the user input What is a SQL Injection Attack?
  • 14. SQL injection Input contains special characters and hidden SQL commands Server accidentally passes hidden SQL commands to database.
  • 15. Product Search:  This input is put directly into the SQL statement within the Web application:  $query = “SELECT prodinfo FROM prodtable WHERE prodname = ‘” . $_POST[‘prod_search’] . “’”;  Creates the following SQL:  SELECT prodinfo FROM prodtable WHERE prodname = ‘blah‘ OR ‘x’ = ‘x’  Attacker has now successfully caused the entire database to be returned. An Example SQL Injection Attack ‘blah‘ OR ‘x’ = ‘x’
  • 16. Sample SQL injection User Input Chris’; DROP TABLE USER_TABLE;-- Query SELECT password FROM USER_TABLE WHERE username=‘Chris’; DROP TABLE USER_TABLE;--’ Result USER_TABLE is deleted by the hacker. Example 1: Data Loss Example 2: Data Leakage User Input ‘AND 1=0 UNION SELECT card_number AS uid,card_holder_name AS uname,expiry_date AS password FROM CREDITCARD’ Query SELECT uid,uname,password FROM USERS WHERE uname=‘AND 1=0 UNION SELECT card_number AS uid,card_holder_name AS uname,expiry_date AS password FROM CREDITCARD’
  • 17. Examples of SQL injection These attacks noted on the Eastern European website started early in March and by Wednesday March 12, 2008, 10,000 Web pages were compromised. Here is a diagram of how it is done
  • 18. Examples of SQL injection Here is a diagram of how to protect against it
  • 19.  Using SQL injections, attackers can:  Add new data to the database  Could be embarrassing to find yourself selling politically incorrect items on an e-Commerce site  Perform an INSERT in the injected SQL  Modify data currently in the database  Could be very costly to have an expensive item suddenly be deeply ‘discounted’  Perform an UPDATE in the injected SQL  Often can gain access to other user’s system capabilities by obtaining their password Other injection possibilities
  • 20.  Use provided functions for escaping strings  Many attacks can be thwarted by simply using the SQL string escaping mechanism  ‘  ’ and “  ”  mysql_real_escape_string() is the preferred function for this  Not a silver bullet!  Consider:  SELECT fields FROM table WHERE id = 23 OR 1=1  No quotes here! Defenses
  • 21.  Check syntax of input for validity  Many classes of input have fixed languages  Email addresses, dates, part numbers, etc.  Verify that the input is a valid string in the language  Sometime languages allow problematic characters (e.g., ‘*’ in email addresses); may decide to not allow these  If you can exclude quotes and semicolons that’s good  Not always possible: consider the name Bill O’Reilly  Want to allow the use of single quotes in names  Have length limits on input  Many SQL injection attacks depend on entering long strings More Defenses
  • 22.  Scan query string for undesirable word combinations that indicate SQL statements  INSERT, DROP, etc.  If you see these, can check against SQL syntax to see if they represent a statement or valid user input  Limit database permissions and segregate users  If you’re only reading the database, connect to database as a user that only has read permissions  Never connect as a database administrator in your web application More Defenses
  • 23.  Configure database error reporting  Default error reporting often gives away information that is valuable for attackers (table name, field name, etc.)  Configure so that this information is never exposed to a user  If possible, use bound variables  Some libraries allow you to bind inputs to variables inside a SQL statement  PERL example (from http://www.unixwiz.net/techtips/sql-injection.html) $sth = $dbh->prepare("SELECT email, userid FROM members WHERE email = ?;"); $sth->execute($email); More Defenses
  • 24.
  • 25. SQL Injection  Code injection technique  Gain Unauthorized access to database
  • 27. GreenSQL  Known as database firewall  Works as a proxy for SQL commands  Calculates risks of queries  Supports different modes for protection
  • 28. • SQL Injection protection • Full separation of duties • Database Activity Monitoring ( DAM ) • IPS/IDS • Learning mode • Flexible deployment options • Highly granular rules • Real time e-mail alerts
  • 29. Calculation of Risky Queries  Fingerprinting of database  Stack-based queries  SQL tautology
  • 30. Modes of GreenSQL  IDS Mode  IPS Mode  Learning Mode  Database Firewall Mode
  • 39. Conclusion  Provides great security regarding different sql attacks  Can be used as a penetration tool !!!