Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <?php
  2. //if (extract_teamname_from_cookie("technews") === false)
  3. // exit;
  4.  
  5. if(isset($_GET["id"]) && (strpos($_GET["id"],'jpg') !== false))//is file type is jpg?
  6. {
  7. # echo "$_GET["id"]";
  8.  
  9. header('Cache-control: private');
  10.  
  11. preg_match("/^php:\/\/.*resource=([^|]*)/i", trim($_GET["id"]), $matches);
  12. //die ("<pre>" . trim($_GET["id"]));
  13. //die ("<pre>///".print_r($matches, true)."///");
  14. if (isset($matches[1]))
  15. $_GET["id"] = $matches[1];
  16.  
  17. if (file_exists("./" . $_GET["id"]) == false)
  18. die("file not found");
  19. if (substr(realpath("./" . $_GET["id"]), 0, 24) != "/var/www/technology-news")
  20. die(".");
  21.  
  22. header('Content-Type: image/jpg');
  23. header('Content-Length: '.filesize($_GET["id"]));
  24. header('Content-Disposition: filename='.$_GET["id"]);
  25.  
  26. $img_data = file_get_contents($_GET["id"]);
  27. $img_data = sharifctf_internal_put_it($img_data, "technews");
  28. echo $img_data;
  29.  
  30. }
  31. else //file type is not jpg! show the error message
  32. {
  33. echo "file not found";
  34. }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement