자유게시판

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

페이지 정보

작성자 Jeffery 작성일 24-05-31 21:58 조회 5 댓글 0

본문

360_F_314700448_Ckh3uDxLuKEwPNGHIKF1ZgRwuVStqSft.jpgWe now have found two use-after-free vulnerabilities in PHP’s garbage collection algorithm. Those vulnerabilities had been remotely exploitable over PHP’s unserialize function. We were also 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 its relatively high rewards on Hackerone caught our attention. That’s why we have now taken the angle of a sophisticated attacker with the full intent to get as deep as potential 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 built upon: PHP. After analyzing the platform we rapidly detected the usage of unserialize on the website. In all cases a parameter named "cookie" got unserialized from Post data and afterwards mirrored via Set-Cookie headers. Standard exploitation methods require so called Property-Oriented-Programming (POP) that contain abusing already existing lessons with particularly outlined "magic methods" with a view to trigger undesirable and malicious code paths.



b9404ca05d4b26a9c18a3f4577b1b9da.10.jpgUnfortunately, it was tough for us to assemble any information 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 complicated as it includes more than 1200 lines of code in PHP 5.6. Further, xnxx many inside PHP courses have their own unserialize strategies. By supporting buildings like objects, arrays, integers, strings or even references it isn't any shock that PHP’s track document exhibits a tendency for bugs and memory corruption vulnerabilities. Sadly, there were no recognized vulnerabilities of such type for newer PHP versions like PHP 5.6 or PHP 7, particularly as a result of unserialize already got plenty of attention prior to now (e.g. phpcodz). Hence, auditing it can be compared to squeezing an already tightly squeezed lemon. Finally, after so much attention and so many security fixes its vulnerability potential should have been drained out and it ought to be secure, shouldn’t it? To search out a solution Dario applied a fuzzer crafted specifically for fuzzing serialized strings which had been handed to unserialize.



Running the fuzzer with PHP 7 instantly result in unexpected behavior. This behavior was not reproducible when examined towards Pornhub’s server although. Thus, we assumed a PHP 5 version. However, working the fuzzer in opposition to a newer version of PHP 5 just generated more than 1 TB of logs without any success. Eventually, after placing increasingly more effort into fuzzing we’ve stumbled upon unexpected habits again. Several questions needed to be answered: is the problem safety related? If that's the case can we solely exploit it regionally or also remotely? To additional complicate this situation the fuzzer did generate non-printable data blobs with sizes of greater than 200 KB. An incredible amount of time was needed to analyze potential issues. After all, we may extract a concise proof of idea of a working reminiscence corruption bug - a so referred to as use-after-free vulnerability! Upon further investigation we found that the foundation trigger may very well be found in PHP’s rubbish collection algorithm, a part of PHP that is completely unrelated to unserialize.



However, the interplay of both components occurred only after unserialize had finished its job. Consequently, it was not effectively suited to distant exploitation. After additional evaluation, gaining a deeper understanding for the problem’s root causes and numerous hard work a similar use-after-free vulnerability was found that gave the impression to be promising for distant exploitation. The excessive sophistication of the discovered PHP bugs and their discovery made it needed to jot down separate articles. You may read more 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. In particular, it concerned multiple exploitation stages. 1. The stack and heap (which additionally include any potential person-input) as well as another writable segments are flagged non-executable (c.f. 2. Even if you are ready to control the instruction pointer you want to know what you want to execute i.e. it's worthwhile to have a valid address of an executable memory segment.

댓글목록 0

등록된 댓글이 없습니다.

Copyright © suprememasterchinghai.net All rights reserved.