Advertisement
scriptz-team

[PHP] Secured file_get_contents (getting local .txt files)

Jun 6th, 2012
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. _____ _____ _ _____ _____ _____ _____ _____ _____
  2. ___| | __ |_| _ |_ _|___ ___|_ _| __| _ | |
  3. |_ -| --| -| | __| | | |- _|___| | | | __| | | | |
  4. |___|_____|__|__|_|__| |_| |___| |_| |_____|__|__|_|_|_|
  5. |s C R i P T z - T E A M . i N F O|████████████████████████████
  6.  
  7. - iNfO -
  8.  
  9. [PHP] Secured file_get_contents (getting local .txt files)
  10.  
  11. - NOtIcE -
  12.  
  13. Create new file index.php in folder /test/ -->
  14. <?php
  15. error_reporting(0);
  16. if (isset($_GET['page'])) {
  17. define("CRYPT", "d5a79b55d72652537e9dcc6a4df1ece2");
  18. $y = $_GET['page'];
  19. $x = file_get_contents('./pages/' . $y . ".txt");
  20. if (strstr($x, CRYPT) == TRUE) {
  21. echo $x;
  22. } else {
  23. echo "Failed.";
  24. }
  25. }
  26. ?>
  27.  
  28. Create new file test.txt in folder /test/pages/ -->
  29. <!-- d5a79b55d72652537e9dcc6a4df1ece2 -->
  30. You can see this!
  31.  
  32. Create new file omfgwtf.txt in folder /test/pages/ -->
  33. You can not see this, since CRYPT CODE is missing.
  34.  
  35. Now run -->
  36. Then run /test/index.php?page=test --> OUTPUT: You can see this!
  37. Then run /test/index.php?page=omfgwtf --> OUTPUT: Failed. You will not see the content of it!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement