Change Language
Sun Sun Sun

You are here: Resources >> What is SQL Injection?

 

What is SQL Injection?
SQL injection is a technique used to take advantage of non-validated input vulnerabilities to pass SQL commands through a Web application for execution by a backend database. Attackers take advantage of the fact that programmers often chain together SQL commands with user-provided parameters, and can therefore embed SQL commands inside these parameters. The result is that the attacker can execute arbitrary SQL queries and/or commands on the backend database server through the Web application.
 Detailed Description
Databases are fundamental components of Web applications. Databases enable Web applications to store data, preferences and content elements. Using SQL, Web applications interact with databases to dynamically build customized data views for each user. A common example is a Web application that manages products. In one of the Web application's dynamic pages (such as ASP), users are able to enter a product identifier and view the product name and description. The request sent to the database to retrieve the product's name and description is implemented by the following SQL statement.
Typically, Web applications use string queries, where the string contains both the query itself and its parameters. The string is built using server-side script languages such as ASP, JSP and CGI, and is then sent to the database server as a single SQL statement. The following example demonstrates an ASP code that generates a SQL query.
When a user enters the following URL:
The corresponding SQL query is executed:
An attacker may abuse the fact that the Product ID parameter is passed to the database without sufficient validation. The attacker can manipulate the parameter's value to build malicious SQL statements. For example, setting the value to the ProductID variable results in the following URL:
The corresponding SQL Statement is:
This condition would always be true and all Product Name and Product Description pairs are returned. The attacker can manipulate the application even further by inserting malicious commands. For example, an attacker can request the following URL:
In this example the semicolon is used to pass the database server multiple statements in a single execution. The second statement is  which causes SQL Server to delete the entire Products table.
An attacker may use SQL injection to retrieve data from other tables as well. This can be done using the statement. The  statement allows the chaining of two separate SQL queries that have nothing in common. For example, consider the following SQL query:
The result of this query is a table with two columns, containing the results of the first and second queries, respectively. An attacker may use this type of SQL injection by requesting the following URL:
The security model used by many Web applications assumes that an SQL query is a trusted command. This enables attackers to exploit SQL queries to circumvent access controls, authentication and authorization checks. In some instances, SQL queries may allow access to host operating system level commands. This can be done using stored procedures. Stored procedures are SQL procedures usually bundled with the database server. For example, the extended stored procedure xp _cmdshell executes operating system commands in the context of a Microsoft SQL Server. Using the same example, the attacker can set the value which returns the list of files in the current directory of the SQL Server process.
 
To see all the sql injection code used in this example please click
 
Click to buy a Protector UTM appliance at our Web Shop
Click to buy a Portable Penetrator at our Web Shop
Click to buy a Penetrator Pen Testing Appliance at our Web Shop
 
 Read more about our services and products here: About SecPoint, IT Security Products, and IT Security Jobs.

 

24 Hour Open Web Shop

Got a Question? - Call us!
EU: +45-70-235-245
US Toll Free: +1-888-704-7297
Sent us an Email!

Get a Free Vulnerability Scan

Get a Free SEO Blackhat Scan

  Email :
     
Related pages
 
Appliance VS Software
What is Cross Site Scripting(XSS)?
What is SQL Injection?
What is a Routing Table?
What is High Availability?
What is Grey Listing?
What is a Web Filter?
What is a Vulnerability?
What is a Proxy Server?
What is a Firewall?
What is a Cookie?
What is a Bayesian Filter?
Test Your Security Policy
Email & Spam Test Links
What is RoHS Weee?
What is Vulnerability Scanning?
What is Vulnerability Assessment?
What is Penetration Testing?
What is a Security Exploit?
What is Appliance Scanning?
What is Zero Day?
What is Unified Threat Management?
What is Intrusion Prevention?
What is a Content-Filter?
What is VoIP?
What is Virus?
What is Spyware?
What is Phishing?
What is P2P?
What is Instant Messaging?
What is Spam?
White Papers
Technology Papers
What is Wi-fi?
What is Wimax?
What is an open relay
What is vlan tagging?
Security Mailinglist Rss Feeds
What is a Man in the Middle Attack?
What is a Botnet?
Top 10 Ways to Protect Your Computer from Hackers
Top 10 Free IT Security Tools
Top 10 Website Security Myths
Top 10 Most Secure Operating Systems
Top 10 Worms
Top 10 Hackers
Top 10 Social Engineering Tactics
Top 10 Spyware
Top 10 Viruses
Top 10 Phishing Scams
SecPoint
Anti-Spyware Tips and Tricks
Anti-Spam Tips & Tricks
Anti-Virus Tips & Trick
How to get rid of malware
How to protect against client wireless hacking
Risks of Cyber Crime
How to choose a vulnerability scanning vendor?
Better Wi-Fi Range without Interference
SecPoint Free Security Scan
IT Security Gurus
Top 10 Myths in IT Security
Top 10 IT Security Tools
Top 10 IT Security Tips
Top 10 Hacker Attacks
Anti-Spam Appliance
Top 10 Spam Attacks
UTM Appliance
Penetration Testing
Application Security
Vulnerability Scanning
Vulnerability Assessment
Internet Filter
Spam Filters
Web Content Filter
WEP Crack
WiFi Security
Anti-Phishing Tips & Trick
PCI-DSS Compliance
Anti-Social Engineering Tips & Trick
Anti-Denial of Service Tips & Trick
Wifi Security Tips & Trick
Anti Hacking – Anti Cracking Tips & Tricks
Wireless Encryption Standards
CIDR Network Information
Virus Spam Bounce Ruleset
Anti-Cross Site Scripting (XSS) Tips and Tricks
Anti-SQL Injection Tips and Tricks
Wifi WEP Encryption Cracking Guide
Wifi WPA & WPA2 Encryption Cracking Guide
How to get rid of a trojan horse
What is Port Knocking?
SecPoint Training Videos
RC Release Candidate Software Firmware
What is SSL?
What is SOCKS?
What is SOCKS5?
Worldwide Security Events
Server Spam Filter
Spam Blocker
Anti-Spam Software
Vulnerability Scanning Appliance
What is a Grey Hat?
What is a White Hat?
What is a Black Hat?
Top 10 Cloud Computing Services
Cloud Security
WPA Key
Block Email Junk
Stop Spam
Anti-Virus
WEP Key
What is Encryption?
What is SSH?
Dell Worldwide Warranty Benefits
Aircrack
Anti-Spam Appliance Guide
Anti-Spam Firewall
BackTrack
Web Filter Appliance
Pen Test Appliance
Security Scanner
WEP WPA2 Crack
What is Blacklisting?
UTM Appliance Anti-Virus
What is FTP?
UTM Appliance WiFi Security
What is Greylisting?
Vulnerability Assessment Guide
What is SFTP?
Vulnerability Scanner
What is Telnet?
Wardriving
What is Whitelisting?
WPA2 Encryption
WiFi Audit
WiFi Pen Test Appliance
WiFi Client Cracking
WiFi Pen Test
WiFi Client Hacking
WiFi Hacking
WiFi Crack
WiFi Hack
WiFi Cracking
What is a vulnerability scanning appliance?
What is a web vulnerability scanner?
What is a web application firewall?
What is CISSP?
What is ISSAP?
What is ISSMP?
What is UTM?
Blind SQL Injection
What is “Dumpster Diving”?
How does SEO hacking occur?
What is search engine hacking?
What is Data Leak Prevention?
How essential is vulnerability management?
Global System for Mobile communication
What is UDP?
What is TCP?
What is GSM Encryption?
What is a Script Kiddie?
What is an Elite Hacker?
What is a Cracker?
What is Phrack?
What is Social Engineering?
What is a password?
What is Linux?
What is a Null Session?
What is Cyberwarfare?
What is Novell NetWare?
What is SHA Encryption?
What is MD5 Encryption?
What is RC4 Encryption?
What is Diffie-Hellman Encryption?
Malware
Logic Bomb
Cross-site Request Forgery
Red box
Black box
Blue box
What is War Dialing?
What is Denial-of Service Attack?
What is Penetration Test?
What is Tunneling Protocol?
What is a Spanning Tree Protocol Attack?
Man-in-the-middle Attack
Shoulder Surfing
What is ComboFix?
What is 2600?
What is SANS Top 20?
Hacker
Breaking Authentication Schemes
SQL Server - Stored Procedure Attacks
Logic Attack
Windows Operating System - Password Attacks
SharePoint – Multi-Tier Attacks
Internet Information Services (IIS) - Web Service Attacks
What is a 2.4 GHz Wi-Fi?
What is the 5.8 GHz Wi-Fi?
What are Server Misconfigurations and Predictable Pages?
What are the risks of the escalation of privileges in the active directory?
What is the mail service attack on Microsoft’s Exchange Server?
What are the attacks on the Macros and ActiveX?
What is a Password Replay Attack?
SEO check for no tags noarchive noindex nofollow
SEO check for small size font tag
SEO Check for css hiding of elements
SEO Check NOSCRIPT text for spamming
SEO Check for img alt title tags spamming
SEO check for long title tag spamming
SEO Check for short link tag spam
SEO Check cusor type to text spam
SEO Check page has count a tags
SEO Check a tags no follow
SEO Check links do not correspond to a tag
SEO Check long keyword description tags
SEO Same link with different content
SEO Check link from invisible img
SEO Check H tags H1..H6 spamming
SEO Too many keywords spam
SEO META REFRESH redirect spam
SEO Javascript popups spam
SEO 302 Redirect
SEO 200 codes to 404 errors not follow html standard
SEO Errors explanations
View More...
 
Privacy Statement | Link Policy | User Policy | IT Security Blog | IT Security Forum | SecPoint Pictures
Event Pictures | Exploit Archive | IT Security Web Shop | Vulnerability Library
IT Security Video | Sitemap
© Copyright 1999-2010: SecPoint®
SecPoint ApS - Lergravsvej 53 - 2300 Copenhagen S - Phone +45 70 235 245
Recent awards Compatible with Visit us on Facebook! Visit us on LinkedIn! Visit us on Myspace!
   
Facebook
Group!


Follow us on Twitter!
Anti-Spam Appliance - Anti-Spam Firewall - Unified Threat Management Appliance Anti-Virus - Web Filter Appliance - Anti Spam Appliance - Anti Spam Firewall - UTM Appliance Wifi Security - Wifi Pen Test - Wifi Crack - Wifi Hack - Wifi Audit - Wep Wpa2 Crack Vulnerability Scanner - Vulnerability Assessment - Security Scanner - Pen Test Appliance