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

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
Video
Slideshows
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2012-3946
Published: 2014-04-24
Cisco IOS before 15.3(2)S allows remote attackers to bypass interface ACL restrictions in opportunistic circumstances by sending IPv6 packets in an unspecified scenario in which expected packet drops do not occur for "a small percentage" of the packets, aka Bug ID CSCty73682.

CVE-2012-5723
Published: 2014-04-24
Cisco ASR 1000 devices with software before 3.8S, when BDI routing is enabled, allow remote attackers to cause a denial of service (device reload) via crafted (1) broadcast or (2) multicast ICMP packets with fragmentation, aka Bug ID CSCub55948.

CVE-2013-6738
Published: 2014-04-24
Cross-site scripting (XSS) vulnerability in IBM SmartCloud Analytics Log Analysis 1.1 and 1.2 before 1.2.0.0-CSI-SCALA-IF0003 allows remote attackers to inject arbitrary web script or HTML via an invalid query parameter in a response from an OAuth authorization endpoint.

CVE-2014-0188
Published: 2014-04-24
The openshift-origin-broker in Red Hat OpenShift Enterprise 2.0.5, 1.2.7, and earlier does not properly handle authentication requests from the remote-user auth plugin, which allows remote attackers to bypass authentication and impersonate arbitrary users via the X-Remote-User header in a request to...

CVE-2014-2391
Published: 2014-04-24
The password recovery service in Open-Xchange AppSuite before 7.2.2-rev20, 7.4.1 before 7.4.1-rev11, and 7.4.2 before 7.4.2-rev13 makes an improper decision about the sensitivity of a string representing a previously used but currently invalid password, which allows remote attackers to obtain potent...

Best of the Web