-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapper to bypass checks as enhancement ? #52
Comments
Cool idea. I'll implement it soon. |
Added |
Great :) However, it seems that only Object and Class are allowed to have the So the function should be public function process_serialized($serialized)
{
return preg_replace(
'#\b([CO]):+?(\d+):(".*?"):+?(\d+):{#',
'$1:+$2:$3:+$4:{',
$serialized
);
} |
I beg to differ:
|
Humm, it doesn't make it easy to use the Using PHP 7.1 (7.1.23 locally and 7.1.0 from the online shell), below were my tests (not sure if there is a generation error from the tool or another shenanigan as in my case only Object and Class can have the
|
I found the issue. When there is serialized class (C), its length would need to be updated if there are any Example: chain.php <?php
namespace GadgetChain\WordPress\NumberIssue;
class RCE1 extends \PHPGGC\GadgetChain\RCE {
public function generate(array $parameters) {
return new \Custom_Iterator;
}
} gadgets.php <?php
class Custom_Iterator Extends ArrayIterator {
public $callback = 'test';
}
Here the +47 is wrong and should be +50 (as 3 |
Haha was just writing about this as well. Well, this is annoying, because this means parsing the serialized string. If for instance there is a serialized string inside a serialized string, this problem will happen as well (as the size of the string will change). For now, I'll do as you said, and change the --plus-numbers option to a parameter: |
Try now and tell me :) |
Seems good, thank you! |
complet |
There is a trick which can be used to bypass some attempts to validate the serialised data given: Put a
+
before all integer values of Object and/or Classes (there might be also possible for integer and string, haven't checked).For instance:
would become
So far I am using a wrapper as this is a very specific situation to bypass the check in place:
However, it might be interesting to add it as an enhancement
The text was updated successfully, but these errors were encountered: