upload web_3
This commit is contained in:
7
web/web_3/Dockerfile
Normal file
7
web/web_3/Dockerfile
Normal 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
2
web/web_3/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
## web_3 ##
|
||||
第一次入手运维,因为那个option.php被插错了就费了,所以弄了个shell脚本来时间竞争。题目是p师傅代码审计里面的。恢复时间是5分钟一次。其实还存在一些安全隐患,我觉得这个项目没人玩,就没修复。。
|
||||
7
web/web_3/code/index.php
Normal file
7
web/web_3/code/index.php
Normal 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__);
|
||||
?>
|
||||
3
web/web_3/code/option.php
Normal file
3
web/web_3/code/option.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
$option='xxx';
|
||||
?>
|
||||
8
web/web_3/code/shell.sh
Normal file
8
web/web_3/code/shell.sh
Normal 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
|
||||
Reference in New Issue
Block a user