forked from wonderkun/CTF_web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchallenge8.php
More file actions
39 lines (29 loc) · 754 Bytes
/
Copy pathchallenge8.php
File metadata and controls
39 lines (29 loc) · 754 Bytes
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
<?php
#GOAL: file_get_content('sbztz.php') : )
class just4fun {
public $filename;
function __toString() {
return @file_get_contents($this->filename);
}
}
$data = stripslashes($_GET['data']);
if (!$data) {
die("hello from y");
}
$token = $data[0];
$pass = true;
switch ( $token ) {
case 'a' :
case 'O' :
case 'b' :
case 'i' :
case 'd' :
$pass = ! (bool) preg_match( "/^{$token}:[0-9]+:/s", $data );
break;
default:
$pass = false;
}
if (!$pass) {
die("TKS L.N.");
}
echo unserialize($data);