Web3 Security

  • Обзор атак на клиента с помощью CSS

    Posted in

    css-resetCSS (Cascading Style Sheets) – язык разметки для оформления внешнего вида веб-страниц, отделяющий визуальное представление от содержания. Первая спецификация формата была опубликована организацией W3C в 1996 году. Тогда CSS позволял делать самые простые вещи: покрасить блок текста цветом, оформить текст курсивом, выравнять абзац, сделать рамку. Сегодня CSS стал настолько сложным, что для него создают фреймворки (bootstrap, jQuery UI) и метаязыки (SASS, SCSS, LESS), которые позволяют упростить написание стилей с помощью увеличения уровня абстракции CSS.

    Бурное развитие CSS привлекло внимание исследователей безопасности, что вылилось в ряд техник, позволяющих проводить атаки на клиента с целью украсть его персональные данные: CSRF-токены, историю посещений сайтов, списки email-контактов и т.д. Начнем обзор с классических векторов, которые еще не потеряли свою актуальность. (more…)

  • Вебинар по распознаванию ботов с помощью машинного обучения

    Posted in

    В среду в 19:00 с моим коллегой Андреем Завгородним проводим вебинар “Распознавание активности ботов с помощью алгоритмов машинного обучения”. Ждем всех, кто интересуется машинным обучением и не только.

    И да, мы все еще ищем специалистов по веб-безопасности, хакеров и тех, кому интересно не только ломать, но и защищать для исследовательской работы в проекте PT Application Firewall. Пишите на мою почту: me@raz0r.name

    687474703a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f656e2f7468756d622f612f61362f42656e6465725f526f6472696775657a2e706e672f32323070782d42656e6465725f526f6472696775657a2e706e67

  • Компания Positive Technologies срочно ищет веб-хакеров разной квалификации

    Posted in

    В первую очередь нам интересен ваш практический опыт в данном направлении, а не количество строчек в резюме.

    Приветствуется наличие статей в блогах и на форумах, в журнале Хакер, участие в CTF или bug-bounty программах.

    Пожелания с технической стороны:

    • наличие навыков практической компрометации и защиты веб-приложений;
    • желателен опыт программирования на любом из языков: Java, C#/VB (ASP, ASP.NET), PHP, Python, Ruby (наиболее востребованы: Java, C#/VB), SQL;
    • наличие собственных разработок и исследований, в том числе и опубликованных на тематических форумах и в блогах; наличие опубликованных данных об уязвимостях, обнаруженных вами.

    Задачи, которые предлагаем:

    • анализ защищенности веб-приложений и систем ДБО ведущих российских и зарубежных компаний;
    • проведение тестов на проникновение, участие в исследовательской деятельности отдела, посещение и участие в российских и международных конференциях;
    • участие в организации конференции Positive Hack Days;
    • возможность вести собственные исследования в области ИБ;
    • работа в команде признанных экспертов в ИБ.

    Условия:

    • «белая» заработная плата;
    • ДМС;
    • 6 недель оплачиваемого отпуска.

    Мы можем предложить работу в московском и питерском офисе компании, а так же удаленно.
    Резюме/вопросы пишите на career@ptsecurity.com

  • Hash Length Extension in HTMLPurifier

    Posted in

    HTMLPurifier is a PHP library that helps to protect against XSS by filtering bad HTML and only allowing harmless markup. Recently a new version of HTMLPurifier has been released that fixes a hash length extension issue that I reported some time ago.
    Hash length extension is a crypto attack against algorithms based on Merkle-Damgard construction (md5, sha1, etc) that allows to inject arbitrary characters into the signed data without knowing the secret key. A typical vulnerable piece of code looks like this:

    if hash(secret + value) == signature:

    With hash length extension we can append our data to the “value” and generate such a new signature that will satisfy the expression above. More information on this kind of attack can be found in this great article.

    One of HTMLPurifier’s filters, namely URIFilter.Munge, can rewrite links to some custom address. It has also an ability to generate signatures that will protect these links from altering. However this is done in a way prone to hash length extension:

    if ($this->secretKey) $this->replace['%t'] = sha1($this->secretKey . ':' . $string);
    

    Web applications that rely on this signature to check the links, for example in URL redirectors or before placing them in the DB, may be vulnerable (for example Invision Power Board), because arbitrary data can be appended despite unknown secret.

    Now HTMLPurifier uses secure HMAC-SHA256 to generate and verify signatures. Upgrade to 3.6.0 and be safe.

  • Radamsa Fuzzer Extension for Burp Suite

    Posted in

    Radamsa is a cool tool that combines a set of fuzzers which generate data based on input string. You can feed it a PDF file for example and Radamsa will produce a bunch of PDF-alike documents that are fuzzed in all imaginable forms. Just see this:

    $ echo "test123" | radamsa -n 10
    ttestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestestest1
    tes.--1
    --test170141183460469231731687303715884105728
    test4294129
    test1
    test65660
    340282366920938463463374607431768211443t0
    -0
    test1710618
    test-6

    Perfect for looking for all kinds of buffer overflows. And this tool can be especially useful combined with Burp Suite, that is why here is quick and dirty extension that enables you to use Radamsa to generate Burp Suite’s Intruder payloads:
    Снимок экрана от 2013-06-24 21:25:01
    Grab the code here: https://github.com/Raz0r/burp-radamsa

  • DEFCON CTF 2013 Quals “grandprix” Writeup

    Posted in

    This time at DEFCON CTF quals there was a special task category, namely OMGACM or competitive programming. Here is a solution to OMGACM 3 task. We have a remote host that offers to play a race game:

    Connected to grandprix.shallweplayaga.me.
    Escape character is '^]'.
    Use 'l' and 'r' to move. Don't crash.
    Press return to start

    OK, we send ‘\n’ to start and see a 5×8 track with different obstacles: (more…)

  • CONFidence 2013: PHP Object Injection Revisited

    Posted in

  • PHDays 2013 CTF “Blade” Writeup

    Posted in

    We have a simple form with login and password. There is an SQL injection, but a WAF blocks any attempt to bypass it. First step to solve this task was to reveal the contents of the script by requesting index.phps:

    <?php
    include 'flag.php';
    
    if (!isset($_POST['username']) || !isset($_POST['password'])) {
        print <<<FORM
    <form method=POST>
    <input type=text name=username></input>
    <input type=password name=password></input>
    <input type=submit></input>
    </form>
    FORM;
        die;
    }
    
    $this_is_baaad = array(
        "union",
        "select",
        "from",
        "where",
        "join",
        "sleep",
        "benchmark",
        ",",
        "(",
        ")"
    );
    foreach ($this_is_baaad as $srsly) {
        if (stripos($_POST['username'], $srsly) !== false) {
            print "Do not try to trick me!";
            die;
        }
    }
    
    $q = mysql_query("SELECT * FROM users WHERE username = '{$_POST['username']}'");
    if (mysql_num_rows($q) == 1) {
        $user = mysql_fetch_array($q);
        if ($user['password'] == $_POST['password']) {
            print $flag;
        } else {
            print "Login failed!";
        }
    } else {
        print "Login failed!";
    }
    

    The first thing we see is that the password does not get into the SQL query, so we need to use at least UNION, but it is blocked. Guys from PPP tried time delaying heavy queries that do not rely on sleep() or becnhmark(), however the right way to solve this task is as follows. Firstly, one notices that passwords are compared using == operator, and secondly the GROUP operator is not filtered. In MySQL this operator can be used with some interesting modifier: WITH ROLLUP

    The GROUP BY clause permits a WITH ROLLUP modifier that causes extra rows to be added to the summary output.

    If you use column password on GROUP BY WITH ROLLUP, you will get an extra empty row. And as NULL and empty string if compared with operator == are equal it is possible to bypass the authorization using the following query:

    admin' GROUP BY password WITH ROLLUP LIMIT 1 OFFSET 1-- -
  • Simple Machines Forum <= 2.0.3 Admin Password Reset

    Posted in

    Simple Machines Forum is a popular web community software written in PHP. Its password reset mechanism had some issues back in 2008. The vulnerability was caused by insecure random numbers generation and was patched right after the exploit was published. This time I found a more interesting vulnerability however at Positive Technologies we didn’t manage to raise awareness of SMF developers. After continuous silence of SMF devs I am disclosing the vulnerability details but I am not going to publish the exploit.

    (more…)

  • ZeroNights HackQuest ErsSma Task Writeup

    Posted in

    ErsSma task was one the most interesting puzzles at ZeroNights HackQuest, here is detailed solution.
    We have a form with a single input:

    POST /missions/ErsSma/index.php HTTP/1.0
    Content-Type: multipart/form-data; boundary=--------336730954
    Content-Length: 99
    
    ----------336730954
    Content-Disposition: form-data; name="login"
    
    admin
    ----------336730954--
    ->
    Password is incorrect!
    

    What do we do here? Fuzz all the things! (more…)