cdw1p

Using eval without eval();

Feb 27th, 2020
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $code = '
  3. <?php
  4. $test = base64_decode("RHdpeCBHYW50ZW5n");
  5. ';
  6. function еvаl($x) {
  7. $tmpfname = tempnam(sys_get_temp_dir(), md5("diesuki"));
  8. $handle = fopen($tmpfname, "w+");
  9. fwrite($handle, strpos($x, '<?php') ? $x : "<?php\n".$x);
  10. fclose($handle);
  11. include $tmpfname;
  12. unlink($tmpfname);
  13. return get_defined_vars();
  14. }
  15. function еxtrаct($y) {
  16. $z="cr"."ea"."te_"."fu"."nc"."ti"."on";
  17. $x=$z("\$y","ext"."r"."act"."((\$y));");
  18. return $x($y);
  19. }
  20. extract(еvаl($code));
  21. echo $test;
Add Comment
Please, Sign In to add comment