Skip to content

Commit

Permalink
add web200-8
Browse files Browse the repository at this point in the history
  • Loading branch information
wonderkun committed Nov 7, 2018
1 parent 62380cc commit 1055f1f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions web200-8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM 1and1internet/ubuntu-16-apache-php-7.0:latest
8 changes: 8 additions & 0 deletions web200-8/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '2'
services:
apache2-php7:
build: ./
volumes:
- ./www:/var/www/html/
ports:
- "8080:8080"
1 change: 1 addition & 0 deletions web200-8/writeup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[https://xz.aliyun.com/t/3174#toc-0](https://xz.aliyun.com/t/3174#toc-0)
8 changes: 8 additions & 0 deletions web200-8/www/admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
if(empty($_SESSION['name'])){
session_start();
#echo 'hello ' + $_SESSION['name'];
}else{
die('you must login with admin');
}
?>
9 changes: 9 additions & 0 deletions web200-8/www/function.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
function filters($data){
foreach($data as $key=>$value){
if(preg_match('/eval|assert|exec|passthru|glob|system|popen/i',$value)){
die('Do not hack me!');
}
}
}
?>
14 changes: 14 additions & 0 deletions web200-8/www/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
highlight_file(__FILE__);
error_reporting(0);
ini_set('open_basedir', '/var/www/html:/tmp');
$file = 'function.php';
$func = isset($_GET['function'])?$_GET['function']:'filters';
call_user_func($func,$_GET);
include($file);
session_start();
$_SESSION['name'] = $_POST['name'];
if($_SESSION['name']=='admin'){
header('location:admin.php');
}
?>
1 change: 1 addition & 0 deletions web200-8/www/sess_hc47qbga0gqeonmhm1pai6c704
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name|N;

0 comments on commit 1055f1f

Please sign in to comment.