Risk
10/1/2013
06:28 AM
Brian Prince
Brian Prince
Quick Hits
Connect Directly
RSS
E-Mail
50%
50%

Anatomy Of A SQL Injection Attack

SQL injection has plagued databases for years. Here's a look at how the attacks work -- and what you can do about them

[The following is excerpted from "Anatomy Of A SQL Injection Attack," a new report posted this week on Dark Reading's Database Security Tech Center.]

It started with a vulnerability on a password reminder page and ended with a compromise of Nasdaq's computer network. Such is the life of a SQL injection vulnerability, one of the most prevalent and well-known classes of security flaws affecting organizations today.

A seemingly permanent fixture on the Open Web Application Security Project's list of top 10 Web application vulnerabilities, SQL injection has a long history as a weapon for the world's black hats to blast their way into corporate databases. In July, the U.S. Justice Department announced an indictment against five men accused of stealing more than 160 million credit card numbers and causing hundreds of millions of dollars in losses in attacks on more than a dozen organizations, including the one on Nasdaq.

The stakes cannot get much higher. According to Trustwave's "2013 Global Security Report," SQL injections accounted for 26 percent of the infiltration methods used by hackers in the data breaches it analyzed in 2012.

Fighting these attacks means more than just understanding where flaws lie in the code. It also means understanding the cyber kill chain -- the life cycle of the attacks targeting the corporate network. Armed with that knowledge, organizations can begin totake a smarter approach to defending their databases and making sure the Web applications that access them don't serve as unguarded gateways for attackers.

Put simply, SQL injection is a technique in which the attacker uses a vulnerability in the code to send malicious SQL statements to a database. This happens when user input that's not properly filtered and validated is utilized in SQL queries to databases accessible by vulnerable applications. There are multiple types of SQL injection attacks, with these two types being the most common categories:

In error-based SQL injection, the attacker forces the database to perform an operation that will result in an error, and then examines the error message for information that can be used to build a working exploit with the correct syntax. Organizations often seek to mitigate this by limiting the amount of information contained in error messages.

Blind SQL injection attacks are used when vulnerable applications are configured to show generic error messages. In this approach, the attacker asks the database a true or false question and examines the application's response. If the response is different, the attacker can determine whether or not the database has been successfully accessed.

Attackers have a number of different exploit methodologies at their disposal. For example, attackers sometimes use a method known as time-based blind SQL injection, which involves getting the database to pause for a specific period of time, and then comparing the response times between normal requests and injected requests to determine if a SQL statement was successfully executed.

To learn more about SQL injection attacks -- and how to prevent them -- download the free report.

Have a comment on this story? Please click "Add a Comment" below. If you'd like to contact Dark Reading's editors directly, send us a message. Brian Prince is a freelance writer for a number of IT security-focused publications. Prior to becoming a freelance reporter, he worked at eWEEK for five years covering not only security, but also a variety of other subjects in the tech industry. Before that, he worked as a ... View Full Bio

Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
Peter Fretty
50%
50%
Peter Fretty,
User Rank: Apprentice
10/15/2013 | 2:49:06 PM
re: Anatomy Of A SQL Injection Attack
Great post Brian. SQL injections are one of the key components of development and security that IT leaders need to understand. There is a desperate need today for highly security software development practices that would help eliminate the problem at the core. Of course that would not change all the existing applications businesses rely on everyday. This is where Web App Firewalls (i.e. Sophos UTM can make a difference in protecting the enterprise.

Peter Fretty
MROBINSON000
50%
50%
MROBINSON000,
User Rank: Apprentice
10/4/2013 | 10:56:06 AM
re: Anatomy Of A SQL Injection Attack
Great article Brian, and I am also looking forward to check out the full report. We also discussed about SQL injection attacks and bugs in a blog series on our company blog. I do hope that you and other readers interested in this topic will find the articles useful. Here is part 1 of the article: http://blog.securityinnovation...
Register for Dark Reading Newsletters
White Papers
Cartoon
Current Issue
Flash Poll
Video
Slideshows
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2013-2595
Published: 2014-08-31
The device-initialization functionality in the MSM camera driver for the Linux kernel 2.6.x and 3.x, as used in Qualcomm Innovation Center (QuIC) Android contributions for MSM devices and other products, enables MSM_CAM_IOCTL_SET_MEM_MAP_INFO ioctl calls for an unrestricted mmap interface, which all...

CVE-2013-2597
Published: 2014-08-31
Stack-based buffer overflow in the acdb_ioctl function in audio_acdb.c in the acdb audio driver for the Linux kernel 2.6.x and 3.x, as used in Qualcomm Innovation Center (QuIC) Android contributions for MSM devices and other products, allows attackers to gain privileges via an application that lever...

CVE-2013-2598
Published: 2014-08-31
app/aboot/aboot.c in the Little Kernel (LK) bootloader, as distributed with Qualcomm Innovation Center (QuIC) Android contributions for MSM devices and other products, allows attackers to overwrite signature-verification code via crafted boot-image load-destination header values that specify memory ...

CVE-2013-2599
Published: 2014-08-31
A certain Qualcomm Innovation Center (QuIC) patch to the NativeDaemonConnector class in services/java/com/android/server/NativeDaemonConnector.java in Code Aurora Forum (CAF) releases of Android 4.1.x through 4.3.x enables debug logging, which allows attackers to obtain sensitive disk-encryption pas...

CVE-2013-6124
Published: 2014-08-31
The Qualcomm Innovation Center (QuIC) init scripts in Code Aurora Forum (CAF) releases of Android 4.1.x through 4.4.x allow local users to modify file metadata via a symlink attack on a file accessed by a (1) chown or (2) chmod command, as demonstrated by changing the permissions of an arbitrary fil...

Best of the Web
Dark Reading Radio
Archived Dark Reading Radio
This episode of Dark Reading Radio looks at infosec security from the big enterprise POV with interviews featuring Ron Plesco, Cyber Investigations, Intelligence & Analytics at KPMG; and Chris Inglis & Chris Bell of Securonix.