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

페이지 정보

profile_image
작성자 Lottie
댓글 0건 조회 31회 작성일 24-05-31 00:34

본문

1476741245_PEPPER-PORN_low-res-1200x628.jpgWe've got discovered two use-after-free vulnerabilities in PHP’s garbage assortment algorithm. Those vulnerabilities have been remotely exploitable over PHP’s unserialize operate. We had been also awarded with $2,000 by the Internet Bug Bounty committee (c.f. Many thanks go out to cutz for co-authoring this text. Pornhub’s bug bounty program and its relatively high rewards on Hackerone caught our attention. That’s why we now have taken the angle of a complicated attacker with the total intent to get as deep as potential into the system, specializing in one important purpose: gaining distant code execution capabilities. Thus, we left no stone unturned and attacked what Pornhub is built upon: PHP. After analyzing the platform we rapidly detected the utilization of unserialize on the web site. In all cases a parameter named "cookie" acquired unserialized from Post knowledge and afterwards reflected by way of Set-Cookie headers. Standard exploitation strategies require so called Property-Oriented-Programming (POP) that involve abusing already existing courses with particularly defined "magic methods" so as to trigger unwanted and malicious code paths.



s-l1200.webpUnfortunately, it was tough for us to collect any details about Pornhub’s used frameworks and PHP objects in general. Multiple courses from common frameworks have been tested - all without success. The core unserializer alone is comparatively complex as it involves greater than 1200 strains of code in PHP 5.6. Further, many inner PHP classes have their very own unserialize strategies. By supporting structures like objects, arrays, integers, strings and even references it is no shock that PHP’s track report reveals a tendency for bugs and reminiscence corruption vulnerabilities. Sadly, there have been no recognized vulnerabilities of such kind for newer PHP variations like PHP 5.6 or PHP 7, particularly because unserialize already bought lots of attention in the past (e.g. phpcodz). Hence, auditing it can be compared to squeezing an already tightly squeezed lemon. Finally, after so much consideration and so many security fixes its vulnerability potential should have been drained out and it needs to be secure, shouldn’t it? To find an answer Dario carried out a fuzzer crafted specifically for fuzzing serialized strings which were handed to unserialize.



Running the fuzzer with PHP 7 instantly lead to unexpected behavior. This habits was not reproducible when examined towards Pornhub’s server though. Thus, porn we assumed a PHP 5 model. However, working the fuzzer against a newer model of PHP 5 simply generated greater than 1 TB of logs with none success. Eventually, after putting increasingly more effort into fuzzing we’ve stumbled upon unexpected habits again. Several questions had to be answered: is the problem safety associated? In that case can we only exploit it domestically or additionally remotely? To additional complicate this situation the fuzzer did generate non-printable information blobs with sizes of more than 200 KB. An incredible period of time was necessary to investigate potential points. In any case, we could extract a concise proof of idea of a working reminiscence corruption bug - a so known as use-after-free vulnerability! Upon further investigation we found that the foundation cause could possibly be found in PHP’s rubbish assortment algorithm, a part of PHP that is totally unrelated to unserialize.



However, the interplay of both components occurred solely after unserialize had finished its job. Consequently, it was not nicely fitted to distant exploitation. After additional evaluation, gaining a deeper understanding for the problem’s root causes and loads of hard work the same use-after-free vulnerability was found that appeared to be promising for remote exploitation. The high sophistication of the discovered PHP bugs and their discovery made it obligatory to write separate articles. You'll be able to 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 significantly troublesome to exploit. Particularly, it concerned a number of exploitation levels. 1. The stack and heap (which also embody any potential consumer-input) in addition to another writable segments are flagged non-executable (c.f. 2. Even if you are ready to regulate the instruction pointer that you must know what you wish to execute i.e. it is advisable have a legitimate deal with of an executable memory phase.

x-hamster-geld-verdienen-696x392.jpg

댓글목록

등록된 댓글이 없습니다.