SQL INJECTION TECHNIQUE
NAME – PRASAD GADE
ROLL NO – 14
TOPICS
• Introduction
• Attack Intent
• Real World Examples
• How SQL Injection works?
• Impact of SQL injection
• Types of attacks
• Defence Against SQL Injection
• Other Injection Types
• SQL Injection tools
• Conclusion
INTRODUCTION
• SQL injection is a code injection technique,used to attack data-driven
applications, in which malicious SQLstatements are inserted into an entry field for
execution
• This is a method to attack web applications that have a data repository.
• The attacker would send a speciallycrafted SQL statement that is designed
tocause some malicious action.
ATTACK INTENT
• Determining database schema
• Extracting data
• Adding or modifying data
• Bypassing authentication
REAL WORLD EXAMPLES
• On August 17, 2009, the United States Justice Department charged an American
citizen Albert Gonzalez and two Russians with the theft of 130 million credit card
numbers using an SQL injection attack.
• In 2008 a sweep of attacks began exploiting the SQL injection vulnerabilities of
Microsoft’s IIS web server and SQL database server. Over 500,000 sites were
exploited.
HOW SQL INJECTION WORKS ?
• The ability to inject SQL commands into the database engine through an existing
Application
• SQL injection is the use of publicly available fields to gain entry to your database.
• This is done by entering SQL commands into your form fields instead of the expected data.
• Improperly coded forms will allow a hacker to use them as an entry point to your database
HOW SQL INJECTION WORKS ?
• 1. App sends form to user.
• 2. Attacker submits form with SQL exploit data.
• 3. Application builds string with exploit data.
• 4. Application sends SQL query to DB.
• 5. DB executes query, including exploit, sends data back to
application.
• 6. Application returns data to user. Web Server
IMPACTS OF SQL INJECTION
• 1. Leakage of sensitive information.
• 2. Reputation decline.
• 3. Modification of sensitive information.
• 4. Loss of control of db server.
• 5. Data loss.
• 6. Denial of service.
TYPES OF ATTACKS
1. First order attacks
The attacker can simply enter a malicious string and cause the modified code to be
executed immediately
2. Second order attacks
The attacker injects into a persistent storage (such as a table row) which is deemed as a trusted source. An attack is subsequently
executed by another activity.
1. Lateral Injection
3. Lateral Injection
The attacker can manipulate the implicit function To_Char() by changing the values of the
environment
DEFENCE AGAINST SQL INJECTION
• Websites require constant access to the database.
• Firewalls provide little or no defense against SQL injection attacks.
• Your website is public and firewalls must be set to allow every site visitor access to
your database, usually over port 80/443.
• Antivirus programs are equally ineffective at blocking SQL injection attacks.
DEFENCE AGAINST SQL INJECTION
1. Comprehensive data sanitization
Web sites must filter all user input.
2. Use a web application firewall
A popular example is the free, open source module ModSecurity. ModSecurity provides a
sophisticated and ever-evolving set of rules to filter potentially dangerous web requests.
3. Limit database privileges by context
Create multiple database user accounts with the minimum levels of privilege for their usage
environment.
OTHER INJECTION TYPES
• Shell injection.
• Scripting language injection.
• File inclusion.
• XML injection.
• XPath injection.
• LDAP injection.
• SMTP injection.
SQL INJECTION TOOLS
• BSQL Hacker
• SQLmap
• SQLninja
• Safe3 SQL Injector
• SQLSus
• Mole
• Havij
CONCLUSION
• SQL injection is technique for exploiting applications that use relational databases as their back end.
• Applications compose SQL statements and send to database.
• SQL injection use the fact that many of these applications concatenate the fixed part of SQL statement with user-
supplied data that forms WHERE predicates or additional sub-queries.
• The technique is based on malformed user-
supplied data
• Transform the innocent SQL calls to a malicious
call
• Cause unauthorized access, deletion of data, or
theft of informatio
THANKYOU

cgbhjjjjjjjnmmmkmmmmmmkkkkkkTutorial5.pptx

  • 1.
    SQL INJECTION TECHNIQUE NAME– PRASAD GADE ROLL NO – 14
  • 2.
    TOPICS • Introduction • AttackIntent • Real World Examples • How SQL Injection works? • Impact of SQL injection • Types of attacks • Defence Against SQL Injection • Other Injection Types • SQL Injection tools • Conclusion
  • 3.
    INTRODUCTION • SQL injectionis a code injection technique,used to attack data-driven applications, in which malicious SQLstatements are inserted into an entry field for execution • This is a method to attack web applications that have a data repository. • The attacker would send a speciallycrafted SQL statement that is designed tocause some malicious action.
  • 4.
    ATTACK INTENT • Determiningdatabase schema • Extracting data • Adding or modifying data • Bypassing authentication
  • 5.
    REAL WORLD EXAMPLES •On August 17, 2009, the United States Justice Department charged an American citizen Albert Gonzalez and two Russians with the theft of 130 million credit card numbers using an SQL injection attack. • In 2008 a sweep of attacks began exploiting the SQL injection vulnerabilities of Microsoft’s IIS web server and SQL database server. Over 500,000 sites were exploited.
  • 6.
    HOW SQL INJECTIONWORKS ? • The ability to inject SQL commands into the database engine through an existing Application • SQL injection is the use of publicly available fields to gain entry to your database. • This is done by entering SQL commands into your form fields instead of the expected data. • Improperly coded forms will allow a hacker to use them as an entry point to your database
  • 7.
    HOW SQL INJECTIONWORKS ? • 1. App sends form to user. • 2. Attacker submits form with SQL exploit data. • 3. Application builds string with exploit data. • 4. Application sends SQL query to DB. • 5. DB executes query, including exploit, sends data back to application. • 6. Application returns data to user. Web Server
  • 8.
    IMPACTS OF SQLINJECTION • 1. Leakage of sensitive information. • 2. Reputation decline. • 3. Modification of sensitive information. • 4. Loss of control of db server. • 5. Data loss. • 6. Denial of service.
  • 9.
    TYPES OF ATTACKS 1.First order attacks The attacker can simply enter a malicious string and cause the modified code to be executed immediately 2. Second order attacks The attacker injects into a persistent storage (such as a table row) which is deemed as a trusted source. An attack is subsequently executed by another activity. 1. Lateral Injection 3. Lateral Injection The attacker can manipulate the implicit function To_Char() by changing the values of the environment
  • 10.
    DEFENCE AGAINST SQLINJECTION • Websites require constant access to the database. • Firewalls provide little or no defense against SQL injection attacks. • Your website is public and firewalls must be set to allow every site visitor access to your database, usually over port 80/443. • Antivirus programs are equally ineffective at blocking SQL injection attacks.
  • 11.
    DEFENCE AGAINST SQLINJECTION 1. Comprehensive data sanitization Web sites must filter all user input. 2. Use a web application firewall A popular example is the free, open source module ModSecurity. ModSecurity provides a sophisticated and ever-evolving set of rules to filter potentially dangerous web requests. 3. Limit database privileges by context Create multiple database user accounts with the minimum levels of privilege for their usage environment.
  • 12.
    OTHER INJECTION TYPES •Shell injection. • Scripting language injection. • File inclusion. • XML injection. • XPath injection. • LDAP injection. • SMTP injection.
  • 13.
    SQL INJECTION TOOLS •BSQL Hacker • SQLmap • SQLninja • Safe3 SQL Injector • SQLSus • Mole • Havij
  • 14.
    CONCLUSION • SQL injectionis technique for exploiting applications that use relational databases as their back end. • Applications compose SQL statements and send to database. • SQL injection use the fact that many of these applications concatenate the fixed part of SQL statement with user- supplied data that forms WHERE predicates or additional sub-queries. • The technique is based on malformed user- supplied data • Transform the innocent SQL calls to a malicious call • Cause unauthorized access, deletion of data, or theft of informatio
  • 15.