This command makes the page spit out ALL the column names in the database. Union all select 1,2,group_concat(column_name),4 from information_lumns where table_schema=database()–
In this Step we want to list all the column names in the database, to do this we use the following command: If this command is entered correctly, the page should show all the tables in the database, so look for tables that may contain useful information such as passwords, so look for admin tables or member or user tables. Remember the “table_name” goes in the vulnerable column number you found earlier. UNION SELECT 1,table_name,3,4 FROM information_schema.tables– To do this we enter the following command after the url. In this step our aim is to list all the table names in the database. IMPORTANT: If the version is 5 and above read on to carry out the attack, if it is 4 and below, you have to brute force or guess the table and column names, programs can be used to do this. The resulting page would then show the database user and then the MySQL version. Or if these dont work example the url would look like: We do this by replacing the vulnerable column numbers with the following commands: We now need to find the database version, name and user. This means columns 2 and 3 are vulnerable. If you have 7 columns you would put, union all select 1,2,3,4,5,6,7– If this is done successfully the page should show a couple of numbers somewhere on the page. This is what we would enter if we have 4 columns. So we enter after the url, union all select (number of columns)–,
We now are going to use the “union” command to find the vulnerable columns. It just depends on the way the database is configured as to which prefix is used. If this does not work, instead of - after the number, change it with /*, as they are two difference prefixes and if one works the other tends not too.
If the site errored on “order by 9” then we would have 8 columns. If we receive another MySQL error here, then that means we have 4 columns. We do this by entering “order by 1–“, “order by 2–” and so on until we receive a page error. Now we need to find the number of union columns in the database. If the page loads as normal then the database is not vulnerable, and the website is not vulnerable to SQL Injection. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/wwwprof/public_html/readnews.php on line 29 If the database is vulnerable, the page will spit out a MySQL error such as Once you have found a page like this, we test for vulnerability by simply entering a ‘ after the number in the url. All kinds of hacking are considered illegal barring the work done by white hat hackers.When testing a website for SQL Injection vulnerabilities, you need to find a page that looks like this:īasically the site needs to have an = then a number or a string, but most commonly a number. Grey hats differ from black hats in the sense that the former notify the admin of the network system about the weaknesses discovered in the system, whereas the latter is only looking for personal gains. Grey hat hackers comprise curious people who have just about enough computer language skills to enable them to hack a system to locate potential loopholes in the network security system. Some computer experts call them crackers instead of hackers. They do this by finding loopholes and weaknesses in the system. They can destroy, steal or even prevent authorized users from accessing the system. Black hat hackers hack to take control over the system for personal gains.
In most cases, they are part of the same organisation. White hat professionals hack to check their own security systems to make it more hack-proof. However, in general computer parlance, we call them white hats, black hats and grey hats. There are no hard and fast rules whereby we can categorize hackers into neat compartments. In fact, breaking a security system requires more intelligence and expertise than actually creating one. One can easily assume them to be intelligent and highly skilled in computers. Simply put, it is the unauthorised access to or control over computer network security systems for some illicit purpose.ĭescription: To better describe hacking, one needs to first understand hackers. Definition: Hacking is an attempt to exploit a computer system or a private network inside a computer.