Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <HTML>
- <HEAD>
- <TITLE>LCMWH</TITLE>
- </HEAD>
- <BODY>
- <center>
- <font size=+3 color="cyan" face="Verdana">
- <h1>LCMWH</h1>
- </font>
- <h3>Low-cost Manual WebHost</h3>
- <font face="Verdana">
- <p>Welcome to the control panel! Here you will be able to administrate this site.</p>
- <form action="/action_page.php">
- Username:<br>
- <input type="text" name="username" placeholder="johndoe"><br>
- Password:<br>
- <input type="password" name="passkey" placeholder="*********"><br><br>
- <h4>Actions</h4>
- <br>
- <p>File to upload:</p>
- <input type="file" name="fileToUpload" id="fileToUpload">
- <p>Folder (if it does not exist, it will be created, leave empty to upload at root):</p>
- <input type="text" name="folderLoc" id="folderLoc" placeholder="memes/">
- <input type="submit" value="Upload Image" name="submit">
- <?php
- $target_dir = "/";
- $target_file = $_POST["folderLoc"] . basename($_FILES["fileToUpload"]["name"]);
- $uploadOk = 1;
- $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
- if(isset($_POST["submit"])) {
- if (file_exists($target_file)) {
- echo "This file already exists.";
- $uploadOk = 0;
- }
- if ($_FILES["fileToUpload"]["size"] > 150000) {
- echo "Your file is over 15MB.";
- $uploadOk = 0;
- }
- if($imageFileType == "php") {
- echo "Your plan does not allow the uploading of PHP files.";
- $uploadOk = 0;
- }
- if (strpos($_POST["folderLoc"], '..') !== FALSE)
- {
- echo "Your folder location string contains .. and it might be an exploit. Please, try again without using ..";
- $uploadOk = 0;
- }
- if ($_POST["username"] != "root") {
- echo "Wrong username!";
- $uploadOk = 0;
- }
- if ($_POST["passkey"] != "Takyon6") {
- echo "Wrong password!";
- $uploadOk = 0;
- }
- if ($uploadOk == 0) {
- } else {
- if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
- echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
- } else {
- echo "Sorry, there was an error uploading your file.";
- }
- }
- }
- ?>
- </form>
- </center>
- </font>
- </BODY>
- </HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement