PHP eval encryption hack method _php Tutorial

Source: Internet
Author: User
Today, let's take a closer look at the deep-seated concepts of the PHP language.

Special Note: This PHP eval encryption decryption program seems to have to be used on the PHP5,

I tested the encryption code in eval (Gzinflate (Base64_decode ("Codes")) on PHP4 and never decrypted properly.

Here is the code for PHP eval encryption hack:

  1. < ? PHP
  2. /*
  3. Taken from http://www.php.net/manual/
    de/function.eval.php#59862
  4. Directions:
  5. 1. Save this snippet as decrypt.php
  6. 2. Save encoded PHP code in Coded.txt
  7. 3. Create a blank file called Decoded.txt
    (from Shell do CHMOD 0666 decoded.txt)
  8. 4. Execute This script (visit decrypt.php in
    A Web browser or do php decrypt.php in the shell)
  9. 5. Open Decoded.txt, the PHP should be decrypted
    If not post the code on Http://www.ariadoss.
    Com/forums/web-development/lamp
  10. Gzinflate Execute PHP Eval encryption code decryption method translated into Chinese after the text
    (This paragraph is not in the original file.)
  11. 1. Save this entire script as decrypt.php
  12. 2. Save the code that needs to be decrypted as Coded.txt and decrypt.php in the same directory.
  13. 3. Create a blank file named Decoded.txt (must put decoded.
    The TXT permission is set to Chmod 0666, which is what can be written. Of course, you can
    Do not create a file file. As long as the folder has write permissions, the script automatically creates a
    A document named Decoded.txt.)
  14. 4. Run the PHP eval Cryptographic decryption script (the browser runs decrypt.php to access http:
    Your domain/storage directory/decrypt.php)
  15. 5. Open Decoded.txt, the code should have been decrypted to complete, if an error occurred, please
    Send the code to http://www.ariadoss.com/forums/web-
    Development/lamp
  16. */
  17. echo "Ndecode nested eval (gzinflate ()) by Debo
    Jurgen <Mailto:jurgen@person. Benn ";
  18. echo "1. Reading Coded.txtn ";
  19. $ FP1 = fopen ("Coded.txt", "R");
  20. $ Contents = fread ($fp 1, filesize ("Coded.txt"));
  21. Fclose ($fp 1);
  22. echo "2. DECODINGN ";
  23. while (Preg_match ("/eval (gzinflate/", $contents)) {
  24. $ Contents = Preg_replace ("/<? | ?> /"," ", $contents);
    Eval (preg_replace ("/eval/", "$contents=",
    $contents)); } echo "3. Writing Decoded.txtn ";
    $fp2 = fopen("Decoded.txt", "w"); Fwrite ($fp 2,
    Trim ($contents)); Fclose ($fp 2);
  25. ?>

The simplest way to say Gzinflate,eval (Gzinflate (Base64_decode ("Codes")) is to use;d ecoding-eval-gzinflate-base64_decode.
Save the above program file decrypt.php, of course the file name can be set by itself.

Create a coded.txt in the same directory in this file, with PHP eval encrypted code, which is the codes of eval (Gzinflate (Base64_decode ("Codes"));

Again, the point is to decrypt the gzinflate (Base64_decode ("Codes")). Executes the saved file decrypt.php, which generates a Decoded.txt txt document in the same directory To open the document. Inside is the original code for PHP eval encryption.


http://www.bkjia.com/PHPjc/445972.html www.bkjia.com true http://www.bkjia.com/PHPjc/445972.html techarticle today, let's take a closer look at the deep-seated concepts of the PHP language. Special Note: This PHP eval encryption decryption program seems to have to be used above the PHP5, I test the PHP4 above eval (Gzinflat ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.