forked from c0ny1/upload-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
245 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,64 @@ | ||
<?php | ||
include '../config.php'; | ||
include '../head.php'; | ||
include '../menu.php'; | ||
|
||
$is_upload = false; | ||
$msg = null; | ||
if(isset($_POST['submit'])){ | ||
$ext_arr = array('jpg','png','gif'); | ||
$file_ext = substr($_FILES['upload_file']['name'],strrpos($_FILES['upload_file']['name'],".")+1); | ||
if(in_array($file_ext,$ext_arr)){ | ||
$temp_file = $_FILES['upload_file']['tmp_name']; | ||
$img_path = $_GET['save_path']."/".rand(10, 99).date("YmdHis").".".$file_ext; | ||
|
||
if(move_uploaded_file($temp_file,$img_path)){ | ||
$is_upload = true; | ||
} | ||
else{ | ||
$msg = '上传失败!'; | ||
} | ||
} | ||
else{ | ||
$msg = "只允许上传.jpg|.png|.gif类型文件!"; | ||
} | ||
} | ||
?> | ||
|
||
<div id="upload_panel"> | ||
<ol> | ||
<li> | ||
<h3>任务</h3> | ||
<p>上传一个<code>webshell</code>到服务器。</p> | ||
</li> | ||
<li> | ||
<h3>上传区</h3> | ||
<form action="?save_path=../upload/" enctype="multipart/form-data" method="post"> | ||
<p>请选择要上传的图片:<p> | ||
<input class="input_file" type="file" name="upload_file"/> | ||
<input class="button" type="submit" name="submit" value="上传"/> | ||
</form> | ||
<div id="msg"> | ||
<?php | ||
if($msg != null){ | ||
echo "提示:".$msg; | ||
} | ||
?> | ||
</div> | ||
<div id="img"> | ||
<?php | ||
if($is_upload){ | ||
echo '<img src="'.$img_path.'" width="250px" />'; | ||
} | ||
?> | ||
</div> | ||
</li> | ||
<?php | ||
if($_GET['action'] == "show_code"){ | ||
include 'show_code.php'; | ||
} | ||
?> | ||
</ol> | ||
</div> | ||
|
||
<?php | ||
include '../footer.php'; | ||
<?php | ||
include '../config.php'; | ||
include '../head.php'; | ||
include '../menu.php'; | ||
|
||
$is_upload = false; | ||
$msg = null; | ||
if(isset($_POST['submit'])){ | ||
$ext_arr = array('jpg','png','gif'); | ||
$file_ext = substr($_FILES['upload_file']['name'],strrpos($_FILES['upload_file']['name'],".")+1); | ||
if(in_array($file_ext,$ext_arr)){ | ||
$temp_file = $_FILES['upload_file']['tmp_name']; | ||
$img_path = $_GET['save_path']."/".rand(10, 99).date("YmdHis").".".$file_ext; | ||
|
||
if(move_uploaded_file($temp_file,$img_path)){ | ||
$is_upload = true; | ||
} else { | ||
$msg = '上传出错!'; | ||
} | ||
} else{ | ||
$msg = "只允许上传.jpg|.png|.gif类型文件!"; | ||
} | ||
} | ||
?> | ||
|
||
<div id="upload_panel"> | ||
<ol> | ||
<li> | ||
<h3>任务</h3> | ||
<p>上传一个<code>webshell</code>到服务器。</p> | ||
</li> | ||
<li> | ||
<h3>上传区</h3> | ||
<form action="?save_path=../upload/" enctype="multipart/form-data" method="post"> | ||
<p>请选择要上传的图片:<p> | ||
<input class="input_file" type="file" name="upload_file"/> | ||
<input class="button" type="submit" name="submit" value="上传"/> | ||
</form> | ||
<div id="msg"> | ||
<?php | ||
if($msg != null){ | ||
echo "提示:".$msg; | ||
} | ||
?> | ||
</div> | ||
<div id="img"> | ||
<?php | ||
if($is_upload){ | ||
echo '<img src="'.$img_path.'" width="250px" />'; | ||
} | ||
?> | ||
</div> | ||
</li> | ||
<?php | ||
if($_GET['action'] == "show_code"){ | ||
include 'show_code.php'; | ||
} | ||
?> | ||
</ol> | ||
</div> | ||
|
||
<?php | ||
include '../footer.php'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
<li id="show_code"> | ||
<h3>代码</h3> | ||
<pre> | ||
<code class="line-numbers language-php">$is_upload = false; | ||
$msg = null; | ||
if(isset($_POST['submit'])){ | ||
$ext_arr = array('jpg','png','gif'); | ||
$file_ext = substr($_FILES['upload_file']['name'],strrpos($_FILES['upload_file']['name'],".")+1); | ||
if(in_array($file_ext,$ext_arr)){ | ||
$temp_file = $_FILES['upload_file']['tmp_name']; | ||
$img_path = $_GET['save_path']."/".rand(10, 99).date("YmdHis").".".$file_ext; | ||
|
||
if(move_uploaded_file($temp_file,$img_path)){ | ||
$is_upload = true; | ||
} | ||
else{ | ||
$msg = '上传失败!'; | ||
} | ||
} | ||
else{ | ||
$msg = "只允许上传.jpg|.png|.gif类型文件!"; | ||
} | ||
} | ||
</code> | ||
</pre> | ||
<li id="show_code"> | ||
<h3>代码</h3> | ||
<pre> | ||
<code class="line-numbers language-php">$is_upload = false; | ||
$msg = null; | ||
if(isset($_POST['submit'])){ | ||
$ext_arr = array('jpg','png','gif'); | ||
$file_ext = substr($_FILES['upload_file']['name'],strrpos($_FILES['upload_file']['name'],".")+1); | ||
if(in_array($file_ext,$ext_arr)){ | ||
$temp_file = $_FILES['upload_file']['tmp_name']; | ||
$img_path = $_GET['save_path']."/".rand(10, 99).date("YmdHis").".".$file_ext; | ||
|
||
if(move_uploaded_file($temp_file,$img_path)){ | ||
$is_upload = true; | ||
} else { | ||
$msg = '上传出错!'; | ||
} | ||
} else{ | ||
$msg = "只允许上传.jpg|.png|.gif类型文件!"; | ||
} | ||
} | ||
</code> | ||
</pre> | ||
</li> |
Oops, something went wrong.