로고

SULSEAM
korean한국어 로그인

자유게시판

How we Broke PHP, Hacked Pornhub and Earned $20,000

페이지 정보

profile_image
작성자 Elke
댓글 0건 조회 31회 작성일 24-06-02 00:19

본문

360_F_314700448_Ckh3uDxLuKEwPNGHIKF1ZgRwuVStqSft.jpgWe have now found two use-after-free vulnerabilities in PHP’s rubbish collection algorithm. Those vulnerabilities had been remotely exploitable over PHP’s unserialize function. We were additionally awarded with $2,000 by the Internet Bug Bounty committee (c.f. Many thanks exit to cutz for co-authoring this article. Pornhub’s bug bounty program and xnxx its relatively high rewards on Hackerone caught our consideration. That’s why we now have taken the perspective of a sophisticated attacker with the complete intent to get as deep as possible into the system, focusing on one most important goal: gaining remote code execution capabilities. Thus, we left no stone unturned and attacked what Pornhub is constructed upon: PHP. After analyzing the platform we shortly detected the usage of unserialize on the web site. In all cases a parameter named "cookie" bought unserialized from Post information and afterwards reflected through Set-Cookie headers. Standard exploitation strategies require so referred to as Property-Oriented-Programming (POP) that contain abusing already present lessons with specifically defined "magic methods" with a view to trigger unwanted and malicious code paths.



414_1000.jpgUnfortunately, it was tough for us to assemble any information about Pornhub’s used frameworks and PHP objects basically. Multiple courses from frequent frameworks have been examined - all with out success. The core unserializer alone is comparatively complex as it entails greater than 1200 strains of code in PHP 5.6. Further, many inner PHP classes have their very own unserialize methods. By supporting buildings like objects, arrays, integers, strings and even references it is no shock that PHP’s observe report exhibits a tendency for bugs and memory corruption vulnerabilities. Sadly, there were no known vulnerabilities of such sort for newer PHP variations like PHP 5.6 or PHP 7, especially because unserialize already acquired a whole lot of consideration previously (e.g. phpcodz). Hence, auditing it can be in comparison with squeezing an already tightly squeezed lemon. Finally, after a lot attention and so many safety fixes its vulnerability potential should have been drained out and it must be safe, shouldn’t it? To find a solution Dario carried out a fuzzer crafted specifically for fuzzing serialized strings which were handed to unserialize.



Running the fuzzer with PHP 7 immediately lead to unexpected conduct. This habits was not reproducible when tested against Pornhub’s server although. Thus, we assumed a PHP 5 model. However, operating the fuzzer against a newer model of PHP 5 simply generated more than 1 TB of logs without any success. Eventually, after placing an increasing number of effort into fuzzing we’ve stumbled upon unexpected conduct once more. Several questions needed to be answered: is the problem safety associated? If so can we only exploit it locally or additionally remotely? To further complicate this example the fuzzer did generate non-printable knowledge blobs with sizes of more than 200 KB. An incredible amount of time was necessary to research potential points. After all, we could extract a concise proof of concept of a working memory corruption bug - a so referred to as use-after-free vulnerability! Upon further investigation we discovered that the foundation cause could be present in PHP’s rubbish assortment algorithm, a component of PHP that is completely unrelated to unserialize.



However, the interplay of both components occurred only after unserialize had completed its job. Consequently, it was not nicely fitted to remote exploitation. After additional analysis, gaining a deeper understanding for the problem’s root causes and loads of laborious work the same use-after-free vulnerability was found that seemed to be promising for distant exploitation. The high sophistication of the discovered PHP bugs and their discovery made it vital to write separate articles. You may learn more details in Dario’s fuzzing unserialize write-up. In addition, we've got written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was considerably difficult to use. Specifically, it concerned multiple exploitation levels. 1. The stack and heap (which additionally embody any potential consumer-enter) as well as every other writable segments are flagged non-executable (c.f. 2. Even if you're able to regulate the instruction pointer you must know what you need to execute i.e. you should have a legitimate address of an executable reminiscence segment.

댓글목록

등록된 댓글이 없습니다.