Join us at IRC!
Your life is ending one minute at a time. If you were to die tomorrow, what would you do today?
Thursday, May 17, 2012
Navigation
Members Online
Total Online: 30
Web Spiders: 16
Guests Online: 26
Members Online: 4

Registered Members: 70039
Newest Member: p0isoN
Latest Articles

SQL Injection



FLV Blaster - Download Music and Videos Faster

website security Basic Guide to simple SQL Injection



What is SQL?

SQL stands for Structured Query Language
It is used by people to create databases on servers for data.
Common uses are;
User tables
Price lists
Sensitive data lists
What is SQL Injection?

SQL Injection forces the server to output data (i.e. User password hashes) from the database. To injected you find a page which is "vulnerable".

How do I know if a page is "vulnerable"?

The first test is to test input fields with code which could confuse the server.

Some examples are;
hi' OR 1=1--
hi' or 1=1--
hi" OR 1=1--
hi" or 1=1--
' OR 1=1--
" OR 1=1--
' or 1=1--
" or 1=1--
There are hundreds more and search google to see them.

Right, now there should be an output.

It normally comes in the format:

MySQL Query Error: SELECT * FROM (table name) WHERE (field type) = '' AND (field type) = ''

Now you have your target page but you need to learn what the error means before you can proceed.

So here goes

MySQL Query Error: SELECT * FROM (table name) WHERE (field type) = '' AND (field type) = ''

SELECT --> Select/choose/find
* --> means all in computing
FROM (table name) --> from the table it found
WHERE --> only select files where certain criteria are met

So in laymans terms

Find all instances from a table where your output is true

Now what?

Now you have got your vulnerable page you need to exploit the area where you can enter SQL Queries.

The most common one you will need will be

SELECT * FROM (table)

That outputs the whole table.

However there are other things you can do like destroying the table or adding users with specific abilities.

Found this interesting?

Here are some other links you might enjoy for extra research;

http://www.w3schools.com/sql/sql_intro.asp
http://www.securiteam.com/securityreviews/5DP0N1P76E.html

Comments

bl4ckc4t on April 28 2006 - 16:03:40
Very useful to know, 10/10 I learned a little bit more off of this article, well written.
evilapproaches on April 29 2006 - 17:42:15
i agree with bl4ckc4t, very well written article 2 thumbs up :p
lunatic on May 02 2006 - 12:42:31
yea good...but maybe bit to short(but that doesnt matter coz u put those 2 links there)B)
Elak on May 03 2006 - 07:50:25
Thanks for the help, this article has gotten me one step closer to getting past Basic 8 =)
mozzer on May 03 2006 - 17:38:37
It's not meant to be long. Long means long time. The longer the time the more likely it could be boring
dubbydubby on July 31 2006 - 21:53:16
great post i used it a lot and it contains a lot of the needed combos but i noticed it changed, some weird characters infront... delete maybe?
TotcoS on December 23 2006 - 08:37:17
this is great
Post Comment

Sorry.

You must have completed the challenge Basic 1 and have 100 points or more, to be able to post.
Ratings
Rating is available to members only.

Please login or register to vote.

Awesome! 53% [8 Votes]
Very Good 20% [3 Votes]
Good 7% [1 Vote]
Average 13% [2 Votes]
Poor 7% [1 Vote]
Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.