PHP eval加密的破解方法_PHP教程

來源:互聯網
上載者:User
今天我們來深入的瞭解一下PHP語言的深層次概念。

特別說明:此PHP eval加密解密程式好像一定得在PHP5上面使用,

我在PHP4上面測試eval(gzinflate(base64_decode("codes")))內加密的代碼始終無法正常解密

以下是PHP eval加密破解的代碼:

  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執行PHP eval加密代碼的解密方法翻譯為中文後的文字
    (此段漢字原始檔案裡面可沒.嘿)
  11. 1. 把這整段指令碼儲存為decrypt.php
  12. 2. 把需要解密的代碼儲存為coded.txt並且和decrypt.php在同一目錄.
  13. 3. 建立一個空白檔案命名為 decoded.txt (必須把 decoded.
    txt 的使用權限設定為CHMOD 0666,也就是可以寫入的.當然,你可以
    不建立檔案檔案.只要檔案夾有寫入許可權,指令碼便會自動建立一個
    名為decoded.txt的文檔. )
  14. 4. 運行PHP eval加密解密指令碼 (瀏覽器中運行decrypt.php 即訪問 http:
    //您的網域名稱/存放目錄/decrypt.php)
  15. 5. 開啟 decoded.txt, 代碼應該已經解密完成,如果出現錯誤請
    把代碼發送到 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 ($fp1, filesize ("coded.txt"));
  21. fclose($fp1);
  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($fp2,
    trim($contents)); fclose($fp2);
  25. ?>

再簡單的說下gzinflate,eval(gzinflate(base64_decode("codes")));decoding-eval-gzinflate-base64_decode的使用方法.
儲存上面的程式檔案decrypt.php,當然檔案名稱可以自己設定.

在此檔案的同一目錄建立一個coded.txt,這個裡面放的是PHP eval加密過的代碼,也就是eval(gzinflate(base64_decode("codes")))當中的codes;

再說明白點就是是要解密的eval(gzinflate(base64_decode("codes")))裡面執行的密原文.執行儲存過的檔案decrypt.php,這樣便會在同一目錄產生一個decoded.txt的txt文檔,開啟此文檔.裡面就是那些PHP eval加密的原始代碼.


http://www.bkjia.com/PHPjc/445972.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445972.htmlTechArticle今天我們來深入的瞭解一下PHP語言的深層次概念。 特別說明:此PHP eval加密解密程式好像一定得在PHP5上面使用, 我在PHP4上面測試eval(gzinflat...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.