Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/extend/user.config.php on line 85

Warning: file_get_contents(https://quotation-api-cdn.dunamu.com/v1/forex/recent?codes=FRX.KRWUSD): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/extend/user.config.php on line 85

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/extend/user.config.php on line 86

Warning: file_get_contents(https://quotation-api-cdn.dunamu.com/v1/forex/recent?codes=FRX.KRWJPY): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/extend/user.config.php on line 86

Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/extend/user.config.php on line 87

Warning: file_get_contents(https://quotation-api-cdn.dunamu.com/v1/forex/recent?codes=FRX.KRWCNY): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/extend/user.config.php on line 87
How we Broke PHP, Hacked Pornhub and Earned $20,000 > 온라인상담 | Book Bridge

온라인상담

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

페이지 정보

24-05-29 06:53 

본문

이메일 :
연락처 :

1HccP.jpgWe now have discovered two use-after-free vulnerabilities in PHP’s rubbish assortment 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 text. Pornhub’s bug bounty program and its comparatively excessive rewards on Hackerone caught our attention. That’s why we've got taken the perspective of an advanced attacker with the complete intent to get as deep as attainable into the system, specializing in one principal goal: gaining distant 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 usage of unserialize on the website. In all cases a parameter named "cookie" obtained unserialized from Post knowledge and afterwards mirrored by way of Set-Cookie headers. Standard exploitation strategies require so known as Property-Oriented-Programming (POP) that contain abusing already existing lessons with specifically defined "magic methods" to be able to set off unwanted and malicious code paths.



1452804214_untitled-article-1452434637-body-image-1452434925-1280x628.jpgUnfortunately, it was tough for us to assemble any information about Pornhub’s used frameworks and PHP objects normally. Multiple classes from widespread frameworks have been examined - all without success. The core unserializer alone is relatively complicated as it includes greater than 1200 lines of code in PHP 5.6. Further, many inside PHP classes have their own unserialize methods. By supporting constructions like objects, arrays, integers, strings or even references it is not any surprise that PHP’s observe file exhibits a tendency for bugs and memory corruption vulnerabilities. Sadly, there have been no known vulnerabilities of such sort for newer PHP versions like PHP 5.6 or PHP 7, particularly as a result of unserialize already acquired loads of attention previously (e.g. phpcodz). Hence, auditing it can be compared to squeezing an already tightly squeezed lemon. Finally, after so much attention and so many safety fixes its vulnerability potential should have been drained out and it needs to be safe, shouldn’t it? To seek out a solution Dario applied a fuzzer crafted specifically for fuzzing serialized strings which were passed to unserialize.

pexels-photo-3311505.png?cs=srgbu0026dl=pexels-vazha-meladze-3311505.jpgu0026fm=jpg

Running the fuzzer with PHP 7 instantly lead to unexpected behavior. This conduct was not reproducible when tested in opposition to Pornhub’s server though. Thus, we assumed a PHP 5 version. However, running the fuzzer towards a newer version of PHP 5 just generated greater than 1 TB of logs without any success. Eventually, after putting more and more effort into fuzzing we’ve stumbled upon unexpected habits once more. Several questions needed to be answered: is the problem safety related? If that's the case can we solely 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 vital to research potential points. In spite of everything, we could extract a concise proof of idea of a working memory corruption bug - a so called use-after-free vulnerability! Upon additional investigation we found that the root cause may very well be present in PHP’s garbage collection algorithm, a component of PHP that is totally unrelated to unserialize.



However, the interaction of both components occurred solely 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 quite a lot of onerous work the same 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 mandatory to jot down separate articles. You possibly can learn more details in Dario’s fuzzing unserialize write-up. As well as, we have written an article about Breaking PHP’s Garbage Collection and Unserialize. Even this promising use-after-free vulnerability was considerably tough to exploit. Specifically, it concerned a number of exploitation phases. 1. The stack and heap (which also embrace any potential person-input) in addition to some other writable segments are flagged non-executable (c.f. 2. Even in case you are ready to regulate the instruction pointer you could know what you want to execute i.e. you want to have a legitimate deal with of an executable memory phase.

댓글목록

등록된 댓글이 없습니다.