⚠️Error Based Injection using Extractvalue
Error-based SQL Injection using SQLmap:
sqlmap -u "http://example.com/vulnerable.php?id=1" --technique E --dump-------------------------------------------------------------
Use this Method when Union Select Not Output
-------------------------------------------------------------
we are just using one of the XPATH function which is Extractvalue() to generate error and get the output.
Some times Different queries and web application behaviour makes is difficult to inject some injections and a web application may be just checking the input validity and not showing any output from the database. So as per the conditions we may have to use different Injection to get our way into the database.
-------------------------------------------------------------
what condition should i use this injection?
As per my experience most of the times the condition where we start injecting with a single qoute, double quote etc we get the error, well and good. We now comment out the query and start searching for the number of columns. huh we got the columns also using order by. Let us assume there were 5 columns.
Now when we inject Union Based injection, what the F..?? we cant see any output there. Earlier when we used to inject we gets an output which tells us the vulnerable column to inject. So this is the condition when you can depend on XPATH injection.
-------------------------------------------------------------
okay let us Start from the same condition we discussed above.5 columns found tried following Injection but no output.
As you can see the double quote over there..that means this time we are injecting into a string type query where the query is like.
Query:
So let us continue our injection using XPATH injection.
Getting the Current Database :
as we got the Database let us continue
-------------------------------------------------------------
Getting tables in current Database:
-------------------------------------------------------------
So Now lets assume we got the following tables using the above Query:
Let us continue and try to get the columns:
-------------------------------------------------------------
Let Us say we got the 3 Columns:
Let us Dump the data from them, but before that lets count the number of Columns.
Counting the number of columns:
You can use the same trick to count the tables or columns also. So now let us continue dumping the data
-------------------------------------------------------------
Last updated