今天我們來深入的了解一下PHP語言的深層次概念。
特別說明:此PHP eval加密解密程序好像一定得在PHP5上面使用,
我在PHP4上面測試eval(gzinflate(base64_decode("codes")))內加密的代碼始終無法正常解密
以下是PHP eval加密破解的代碼:
- < ?php
- /*
- Taken from http://www.php.net/manual/
de/function.eval.php#59862 - Directions:
- 1. Save this snippet as decrypt.php
- 2. Save encoded PHP code in coded.txt
- 3. Create a blank file called decoded.txt
(from shell do CHMOD 0666 decoded.txt) - 4. Execute this script (visit decrypt.php in
a web browser or do php decrypt.php in the shell) - 5. Open decoded.txt, the PHP should be decrypted
if not post the code on http://www.ariadoss.
com/forums/web-development/lamp -
- gzinflate執行PHP eval加密代碼的解密方法翻譯為中文後的文字
(此段漢字原始文件裡面可沒.嘿) - 1. 把這整段腳本保存為decrypt.php
- 2. 把需要解密的代碼保存為coded.txt並且和decrypt.php在同一目錄.
- 3. 創建一個空白文件命名為 decoded.txt (必須把 decoded.
txt 的權限設置為CHMOD 0666,也就是可以寫入的.當然,你可以
不創建文件文件.只要文件夾有寫入權限,腳本便會自動創建一個
名為decoded.txt的文檔. ) - 4. 運行PHP eval加密解密腳本 (浏覽器中運行decrypt.php 即訪問 http:
//您的域名/存放目錄/decrypt.php) - 5. 打開 decoded.txt, 代碼應該已經解密完成,如果出現錯誤請
把代碼發送到 http://www.ariadoss.com/forums/web-
development/lamp - */
- echo "nDECODE nested eval(gzinflate()) by DEBO
Jurgen <mailto:jurgen@person.benn"; - echo "1. Reading coded.txtn";
- $fp1 = fopen ("coded.txt", "r");
- $contents = fread ($fp1, filesize ("coded.txt"));
- fclose($fp1);
- echo "2. Decodingn";
- while (preg_match("/eval(gzinflate/",$contents)) {
- $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); - ?>
再簡單的說下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加密的原始代碼.