로고

SULSEAM
korean한국어 로그인

자유게시판

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

페이지 정보

profile_image
작성자 Ngan
댓글 0건 조회 44회 작성일 24-06-02 06:09

본문

2000x2000.8.jpgWe have now found two use-after-free vulnerabilities in PHP’s garbage assortment 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 go out to cutz for co-authoring this article. Pornhub’s bug bounty program and its comparatively excessive rewards on Hackerone caught our attention. That’s why we have taken the angle of a complicated attacker with the complete intent to get as deep as possible into the system, focusing on one principal purpose: gaining remote code execution capabilities. Thus, we left no stone unturned and attacked what Pornhub is constructed upon: PHP. After analyzing the platform we rapidly detected the utilization of unserialize on the web site. In all instances a parameter named "cookie" obtained unserialized from Post knowledge and afterwards mirrored through Set-Cookie headers. Standard exploitation techniques require so referred to as Property-Oriented-Programming (POP) that involve abusing already present lessons with specifically outlined "magic methods" so as to trigger unwanted and malicious code paths.



sense8_204_unit_04032_r2.jpgUnfortunately, it was tough for us to assemble any details about Pornhub’s used frameworks and PHP objects typically. Multiple lessons from frequent frameworks have been examined - all without success. The core unserializer alone is relatively complex as it entails greater than 1200 traces of code in PHP 5.6. Further, many inside PHP classes have their very own unserialize methods. By supporting buildings like objects, arrays, integers, strings and even references it isn't any surprise that PHP’s track file shows a tendency for bugs and reminiscence corruption vulnerabilities. Sadly, there have been no known vulnerabilities of such sort for newer PHP versions like PHP 5.6 or PHP 7, especially because unserialize already got quite a lot of consideration in the past (e.g. phpcodz). Hence, auditing it may be in comparison with squeezing an already tightly squeezed lemon. Finally, after so much consideration and so many safety fixes its vulnerability potential ought to have been drained out and it should be safe, shouldn’t it? To search out a solution Dario carried out a fuzzer crafted specifically for fuzzing serialized strings which had been passed to unserialize.

437_1000.jpg

Running the fuzzer with PHP 7 instantly lead to unexpected conduct. This behavior was not reproducible when tested against Pornhub’s server although. Thus, we assumed a PHP 5 version. However, operating the fuzzer in opposition to a newer model of PHP 5 just generated more than 1 TB of logs with none success. Eventually, after placing increasingly more effort into fuzzing we’ve stumbled upon unexpected conduct once more. Several questions had to be answered: is the problem safety related? If so can we only exploit it regionally or also remotely? To further complicate this situation the fuzzer did generate non-printable information blobs with sizes of more than 200 KB. An incredible amount of time was essential to research potential points. After all, we could extract a concise proof of idea of a working memory corruption bug - a so referred to as use-after-free vulnerability! Upon further investigation we found that the root cause could possibly be found in PHP’s garbage assortment algorithm, a part of PHP that is totally unrelated to unserialize.



However, the interaction of each parts occurred only after unserialize had completed its job. Consequently, it was not effectively suited for distant exploitation. After further analysis, gaining a deeper understanding for the problem’s root causes and plenty of onerous work an analogous use-after-free vulnerability was found that gave the impression to be promising for remote exploitation. The high sophistication of the discovered PHP bugs and their discovery made it vital to write down separate articles. You may learn extra particulars 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 exploit. Specifically, xhamster it concerned multiple exploitation phases. 1. The stack and heap (which additionally embody any potential user-input) in addition to some other writable segments are flagged non-executable (c.f. 2. Even in case you are in a position to regulate the instruction pointer you should know what you want to execute i.e. you want to have a sound tackle of an executable reminiscence section.

댓글목록

등록된 댓글이 없습니다.