Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2. $includes = array(
  3. 'some text',
  4. '<?php print "some text"; ?>',
  5. '<?php print "some text";',
  6. 'some text<?php',
  7. 'some text<?php ',
  8. 'some text<?php;',
  9. 'some text<?php ?>',
  10. '<?php ?>some text',
  11. );
  12.  
  13. $tempFile = tempnam('/tmp', 'test_');
  14.  
  15. print "\r\n" . "Include:" . "\r\n";
  16. foreach ($includes as $include)
  17. {
  18. file_put_contents($tempFile, $include);
  19. var_dump(include $tempFile);
  20. }
  21.  
  22. unlink($tempFile);
  23.  
  24. print "\r\n" . "Eval 1:" . "\r\n";
  25. foreach ($includes as $include)
  26. var_dump(eval('?>' . $include . '<?php '));
  27.  
  28. print "\r\n" . "Eval 2:" . "\r\n";
  29. foreach ($includes as $include)
  30. var_dump(eval('?>' . $include));
  31.  
  32. print "\r\n" . "Eval 3:" . "\r\n";
  33. foreach ($includes as $include)
  34. var_dump(eval('?>' . $include . '<?php;'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement