Skip to content

Commit 727bce9

Browse files
committed
Updates php/challenge-90.md
Auto commit by GitBook Editor
1 parent 8b3c5ee commit 727bce9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

php/challenge-90.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
# Challenge
22
```php
3+
<?php
4+
if(!isset($_GET['c']) && !isset($_GET['re'])) {
5+
show_source(__FILE__);
6+
}
7+
8+
$selfdir = $_GET['dir'];
9+
if (!isset($selfdir)) {
10+
die();
11+
}
12+
$secret = '/var/www/html/hackme/' . md5("cetcrce" . $selfdir . $_SERVER['REMOTE_ADDR']);
13+
@chdir('hackme');
14+
@mkdir($secret);
15+
@chdir($secret);
16+
17+
if (isset($_GET['c']) && strlen($_GET['c']) <= 5) {
18+
include('waf.php');
19+
@exec($_GET['c']);
20+
}elseif(isset($_GET['re'])) {
21+
@exec('/bin/rm -rf ' . $secret);
22+
@exec('touch /var/www/html/hackme/index.php');
23+
}
24+
?>
325

426
```
527

628
# Solution
729

830
# Refference
9-
+ php-security-calendar-2017
31+
+ 赛博地球杯工业互联网安全大赛 请关注工控云管理系统的警告记录

0 commit comments

Comments
 (0)