Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 52 guests online
Free Business and Tech Magazines and eBooks
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Web Applications
Brief anatomy of a SQL Injection
EH-Net
May 25, 2013, 09:34:15 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Ethical Hacking Discussions and Related Certifications
>
Web Applications
(Moderator:
don
) >
Brief anatomy of a SQL Injection
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Brief anatomy of a SQL Injection (Read 6965 times)
0 Members and 1 Guest are viewing this topic.
unsupported
Sr. Member
Offline
Posts: 318
Unofficial Newbie Moderator
Brief anatomy of a SQL Injection
«
on:
February 26, 2010, 08:21:55 AM »
I found a quick write-up on SQL injections,
http://threatpost.com/en_us/blogs/anatomy-sql-injection-attack-022510
, and the more detailed article,
http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2010/02/25/a-big-case-of-oops.aspx
.
Basically, in this write up, someone found a database throwing raw database errors back to the client. Next, he tested the website for SQL injections by using '1=1', which is a true statement in SQL world and will not generate any errors. They also found the site was serving a trojan. JOY!
I never understood why anyone would not, at a minimum sanitize their inputs or require the use of stored procedures for anything coming off the web. At the very least trap database errors and not return it to the client.
Logged
-Un
CISSP, GCIH, GCIA, C|EH, Sec+, Net+, MCP
zeroflaw
Full Member
Offline
Posts: 208
Re: Brief anatomy of a SQL Injection
«
Reply #1 on:
February 26, 2010, 09:05:18 AM »
Lol wow, funny story! I also can't believe that people still don't properly filter user input. Any decent book about web development warns you about the dangers of SQL injections. It requires little effort to fix SQL injections bugs.
Looks like most SQL injection exploits rely on information leakage. Well, SQL injection would still be possible of course, but less obvious. Also, lots of developers aren't aware of the fact, that it possibly leads to server compromise.
ZF
Logged
ZF
Ketchup
Hero Member
Offline
Posts: 1021
Re: Brief anatomy of a SQL Injection
«
Reply #2 on:
February 26, 2010, 09:27:08 AM »
Wow that's a classic.
Logged
~~~~~~~~~~~~~~
Ketchup
unsupported
Sr. Member
Offline
Posts: 318
Unofficial Newbie Moderator
Re: Brief anatomy of a SQL Injection
«
Reply #3 on:
February 26, 2010, 09:46:18 AM »
Oh, this would be worth mentioning, Little Bobby Tables.
http://xkcd.com/327/
Logged
-Un
CISSP, GCIH, GCIA, C|EH, Sec+, Net+, MCP
chrisj
Hero Member
Offline
Posts: 1163
Re: Brief anatomy of a SQL Injection
«
Reply #4 on:
February 27, 2010, 11:03:57 AM »
Quote
I never understood why anyone would not, at a minimum sanitize their inputs or require the use of stored procedures for anything coming off the web. At the very least trap database errors and not return it to the client.
Quote
I also can't believe that people still don't properly filter user input. Any decent book about web development warns you about the dangers of SQL injections.
My experience may be limited, but I've found the people doing the db side usually aren't the guys doing the web side.
I seen one where the person was both, but self taught, and it had to be done quickly, so not every well self taught. He had the whole user table with passwords in clear text in the application.
Logged
OSWP, Sec+
zeroflaw
Full Member
Offline
Posts: 208
Re: Brief anatomy of a SQL Injection
«
Reply #5 on:
February 27, 2010, 11:50:48 AM »
Quote from: chrisj on February 27, 2010, 11:03:57 AM
Quote
I never understood why anyone would not, at a minimum sanitize their inputs or require the use of stored procedures for anything coming off the web. At the very least trap database errors and not return it to the client.
Quote
I also can't believe that people still don't properly filter user input. Any decent book about web development warns you about the dangers of SQL injections.
My experience may be limited, but I've found the people doing the db side usually aren't the guys doing the web side.
I seen one where the person was both, but self taught, and it had to be done quickly, so not every well self taught. He had the whole user table with passwords in clear text in the application.
That may be, but in my opinion everyone that codes a database application should be aware of how the database works. You don't have to be a database guru to understand the dangers.
The database guys should at least set the right permissions, so that the average user can only retrieve data with SELECT statements and such. Preferably using stored procedures.
Even if you don't deal with the database, filtering all input is good practice. No one likes the possibility of other attacks, like XSS for example.
Logged
ZF
Ketchup
Hero Member
Offline
Posts: 1021
Re: Brief anatomy of a SQL Injection
«
Reply #6 on:
February 27, 2010, 04:23:26 PM »
I think that one of the issues is that there are a lot "old hats" running software development shops. There once was a time when security wasn't a concern. When only the rich and Universities had access to the Internet. That time wasn't long ago. I think that times are changing, slowly but surely.
Logged
~~~~~~~~~~~~~~
Ketchup
UNIX
Hero Member
Offline
Posts: 1235
Re: Brief anatomy of a SQL Injection
«
Reply #7 on:
March 04, 2010, 08:10:11 AM »
Some of my thoughts on this are the same as Ketchup's. There are still quite a few programmers around from an older generation where security was not what it is now. People nowadays get already taught at the very beginning of possible threats and how to avoid them, securing things, validating inputs etc. Also not all companies, especially the smaller ones, have the money to keep their employees updated through courses and classes.
Logged
zeroflaw
Full Member
Offline
Posts: 208
Re: Brief anatomy of a SQL Injection
«
Reply #8 on:
March 04, 2010, 08:35:45 AM »
I didn't think of it that way. Ketchup and awesec, you two have good points. But I always thought it was kind of important in the IT field to keep learning and stay up to date. But yea, that costs money and time.
Logged
ZF
apollo
Full Member
Offline
Posts: 146
Re: Brief anatomy of a SQL Injection
«
Reply #9 on:
March 04, 2010, 03:24:22 PM »
Well part of this is also that when teaching people to program in schools, schools haven't historically focused on things like input validation etc. Whether it is XSS, SQL Injection, or a number of other attacks, input validation is always secondary to functionality. It's more important than just preventing SQL Injection and XSS, as those are talked about quite a bit, but poor input validation also leads to poor data integrity. In most cases, there should be two levels of integrity checking, one enforced at the database layer and one enforced through the application layer and allowing for user feedback and correction.
I wish they taught more of this in school, as I think most people who learn this stuff now on the job or the hard way.
Logged
CISSP, CSSLP, MCSE+Security, MCTS, CCSP, GPEN, GWAPT, GCWN, NOP, OSCP, Security+
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
SANSFIRE 2013
June 15 - 22
5% Off
w/ Code
:
EHN_5
SANS Deals 4 EH-Netters
5% OFF
Any
SANS Course
in Any Format!
Coupon Code:
EHN_5
Including
SANS Rocky Mountain 2013
&
SANS Boston 2013
Polls
Compared to this year, 2013 will be:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
News Items and General Discussion About EH-Net
: Change is Coming to EH-Net!!
(30) by
don
Tools
: Symbolic Exploit Assistant project is looking for collaborators
(0) by
galapag0
Greetings
: Hi from the UK
(5) by
prats84
GCIH - GIAC Certified Incident Handler
: Passed my GCIH
(9) by
prats84
Network Pen Testing
: Want a challenge? Want a GXPN practice exam?
(0) by
ajohnson
GCIH - GIAC Certified Incident Handler
: GCIH Free Practice test attempt
(1) by
prats84
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.