-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtemplate.php
More file actions
176 lines (167 loc) · 8.95 KB
/
Copy pathtemplate.php
File metadata and controls
176 lines (167 loc) · 8.95 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
$ref_bool = true;
$ref_int = 0;
$ref_string = "a";
$ref_array = array(0);
$ref_object = new StdClass();
$ref_resource = fopen("/dev/null", "r");
function templateFunction($templateParameter) {
return 0;
}
function templateGenerator() {
yield 0;
}
class TemplateClass {
var $templateProperty;
const TEMPLATE_CONSTANT = 0;
function templateMethod() {
return 0;
}
}
$p = new Phar("/tmp/fuzz.phar");
$p["fuzz.txt"] = "fuzz";
$vars = array(
"stdClass" => new stdClass(),
"Exception" => new Exception(),
"ErrorException" => new ErrorException(),
"Error" => new Error(),
"CompileError" => new CompileError(),
"ParseError" => new ParseError(),
"TypeError" => new TypeError(),
"ArgumentCountError" => new ArgumentCountError(),
"ArithmeticError" => new ArithmeticError(),
"DivisionByZeroError" => new DivisionByZeroError(),
// "Closure" => new Closure(),
// "Generator" => new Generator(),
"ClosedGeneratorException" => new ClosedGeneratorException(),
"DateTime" => new DateTime(),
"DateTimeImmutable" => new DateTimeImmutable(),
"DateTimeZone" => new DateTimeZone("America/Chicago"),
"DateInterval" => new DateInterval("P2Y4DT6H8M"),
"DatePeriod" => new DatePeriod("R4/2012-07-01T00:00:00Z/P7D"),
"LibXMLError" => new LibXMLError(),
"DOMException" => new DOMException(),
"DOMStringList" => new DOMStringList(),
"DOMNameList" => new DOMNameList(),
"DOMImplementationList" => new DOMImplementationList(),
"DOMImplementationSource" => new DOMImplementationSource(),
"DOMImplementation" => new DOMImplementation(),
"DOMNode" => new DOMNode(),
"DOMNameSpaceNode" => new DOMNameSpaceNode(),
"DOMDocumentFragment" => new DOMDocumentFragment(),
"DOMDocument" => new DOMDocument(),
"DOMNodeList" => new DOMNodeList(),
"DOMNamedNodeMap" => new DOMNamedNodeMap(),
"DOMCharacterData" => new DOMCharacterData(),
"DOMAttr" => new DOMAttr("artr"),
"DOMElement" => new DOMElement("root"),
"DOMText" => new DOMText(),
"DOMComment" => new DOMComment(),
"DOMTypeinfo" => new DOMTypeinfo(),
"DOMUserDataHandler" => new DOMUserDataHandler(),
"DOMDomError" => new DOMDomError(),
"DOMErrorHandler" => new DOMErrorHandler(),
"DOMLocator" => new DOMLocator(),
"DOMConfiguration" => new DOMConfiguration(),
"DOMCdataSection" => new DOMCdataSection("root value"),
"DOMDocumentType" => new DOMDocumentType(),
"DOMNotation" => new DOMNotation(),
"DOMEntity" => new DOMEntity(),
"DOMEntityReference" => new DOMEntityReference("nbsp"),
"DOMProcessingInstruction" => new DOMProcessingInstruction("php"),
"DOMStringExtend" => new DOMStringExtend(),
"DOMXPath" => new DOMXPath(new DOMDocument()),
"finfo" => new finfo(),
// "HashContext" => new HashContext(),
"JsonException" => new JsonException(),
"LogicException" => new LogicException(),
"BadFunctionCallException" => new BadFunctionCallException(),
"BadMethodCallException" => new BadMethodCallException(),
"DomainException" => new DomainException(),
"InvalidArgumentException" => new InvalidArgumentException(),
"LengthException" => new LengthException(),
"OutOfRangeException" => new OutOfRangeException(),
"RuntimeException" => new RuntimeException(),
"OutOfBoundsException" => new OutOfBoundsException(),
"OverflowException" => new OverflowException(),
"RangeException" => new RangeException(),
"UnderflowException" => new UnderflowException(),
"UnexpectedValueException" => new UnexpectedValueException(),
/*
"RecursiveIteratorIterator" => new RecursiveIteratorIterator(),
"IteratorIterator" => new IteratorIterator(),
"FilterIterator" => new FilterIterator(),
"RecursiveFilterIterator" => new RecursiveFilterIterator(),
"CallbackFilterIterator" => new CallbackFilterIterator(),
"RecursiveCallbackFilterIterator" => new RecursiveCallbackFilterIterator(),
"ParentIterator" => new ParentIterator(),
"LimitIterator" => new LimitIterator(),
"CachingIterator" => new CachingIterator(),
"RecursiveCachingIterator" => new RecursiveCachingIterator(),
"NoRewindIterator" => new NoRewindIterator(),
"AppendIterator" => new AppendIterator(),
"InfiniteIterator" => new InfiniteIterator(),
"RegexIterator" => new RegexIterator(),
"RecursiveRegexIterator" => new RecursiveRegexIterator(),
"EmptyIterator" => new EmptyIterator(),
"RecursiveTreeIterator" => new RecursiveTreeIterator(),
"ArrayObject" => new ArrayObject(),
"ArrayIterator" => new ArrayIterator(),
"RecursiveArrayIterator" => new RecursiveArrayIterator(),
"SplFileInfo" => new SplFileInfo(),
"DirectoryIterator" => new DirectoryIterator(),
"FilesystemIterator" => new FilesystemIterator(),
"RecursiveDirectoryIterator" => new RecursiveDirectoryIterator(),
"GlobIterator" => new GlobIterator(),
*/
"SplFileObject" => new SplFileObject(__FILE__),
"SplTempFileObject" => new SplTempFileObject(),
"SplDoublyLinkedList" => new SplDoublyLinkedList(),
"SplQueue" => new SplQueue(),
"SplStack" => new SplStack(),
// "SplHeap" => new SplHeap(),
"SplMinHeap" => new SplMinHeap(),
"SplMaxHeap" => new SplMaxHeap(),
"SplPriorityQueue" => new SplPriorityQueue(),
"SplFixedArray" => new SplFixedArray(),
"SplObjectStorage" => new SplObjectStorage(),
"MultipleIterator" => new MultipleIterator(),
/*
"PDOException" => new PDOException(),
"PDO" => new PDO(),
"PDOStatement" => new PDOStatement(),
"PDORow" => new PDORow(),
*/
"SessionHandler" => new SessionHandler(),
"ReflectionException" => new ReflectionException(),
"Reflection" => new Reflection(),
// "ReflectionFunctionAbstract" => new ReflectionFunctionAbstract(),
"ReflectionFunction" => new ReflectionFunction("templateFunction"),
"ReflectionGenerator" => new ReflectionGenerator(templateGenerator()),
"ReflectionParameter" => new ReflectionParameter("templateFunction", "templateParameter"),
"ReflectionType" => (new ReflectionClass("ZipArchive"))->getMethod("getCommentName")->getReturnType(),
"ReflectionNamedType" => new ReflectionNamedType(),
"ReflectionMethod" => new ReflectionMethod("TemplateClass", "templateMethod"),
"ReflectionClass" => new ReflectionClass("TemplateClass"),
"ReflectionObject" => new ReflectionObject(new TemplateClass()),
"ReflectionProperty" => new ReflectionProperty("TemplateClass", "templateProperty"),
"ReflectionClassConstant" => new ReflectionClassConstant("TemplateClass", "TEMPLATE_CONSTANT"),
"ReflectionExtension" => new ReflectionExtension("Reflection"),
// "ReflectionZendExtension" => new ReflectionZendExtension(),
"__PHP_Incomplete_Class" => new __PHP_Incomplete_Class(),
"php_user_filter" => new php_user_filter(),
"Directory" => new Directory(),
"AssertionError" => new AssertionError(),
"SimpleXMLElement" => new SimpleXMLElement("<a>a</a>"),
"SimpleXMLIterator" => new SimpleXMLIterator("<a>a</a>"),
"PharException" => new PharException(),
"Phar" => new Phar("/tmp/fuzz.phar"),
"PharData" => new PharData("/tmp/fuzz.tar"),
"PharFileInfo" => new PharFileInfo("phar:///tmp/fuzz.phar/fuzz.txt"),
"XMLReader" => new XMLReader(),
"XMLWriter" => new XMLWriter(),
"CURLFile" => new CURLFile("/tmp/fuzz"),
"ZipArchive" => new ZipArchive(),
);
<phpfuzz>
?>