upload web_3

This commit is contained in:
sh1llc0de
2018-08-06 21:04:14 +08:00
parent 1f22848e99
commit 76b88af605
5 changed files with 27 additions and 0 deletions

7
web/web_3/Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM php:5.6-apache
COPY /code /var/www/html/
RUN chmod 4755 /bin/cat && chmod 777 /var/www/html/index.php && chmod 777 /var/www/html/option.php && chmod 777 /var/www/html/shell.sh

2
web/web_3/README.md Normal file
View File

@@ -0,0 +1,2 @@
## web_3 ##
第一次入手运维因为那个option.php被插错了就费了所以弄了个shell脚本来时间竞争。题目是p师傅代码审计里面的。恢复时间是5分钟一次。其实还存在一些安全隐患我觉得这个项目没人玩就没修复。。

7
web/web_3/code/index.php Normal file
View File

@@ -0,0 +1,7 @@
<?php
$str = addslashes($_GET['option']);
$file = file_get_contents('option.php');
$file = preg_replace('|\$option=\'.*\';|', "\$option='$str';", $file);
file_put_contents('option.php', $file);
highlight_file(__FILE__);
?>

View File

@@ -0,0 +1,3 @@
<?php
$option='xxx';
?>

8
web/web_3/code/shell.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
while true
do
echo "<?php" > option.php
echo "\$option='xxx';" >> option.php
echo "?>" >> option.php
sleep 5m
done