发新话题
打印

[转载]紧急安全更新 For Discuz! 4.X 5.x

[转载]紧急安全更新 For Discuz! 4.X 5.x

信息来源:DZ官方

请所有 使用 4.X , 5.x 论坛的用户立即修补您的论坛,避免遭受攻击。

修补方法:修改文件  include/global.func.php

查找下面这段代码(一般应当在global.func.php 文件的开头处)
复制内容到剪贴板
代码:
function authcode($string, $operation, $key = '') {
      $key = $key ? $key : $GLOBALS['discuz_auth_key'];

      $coded = '';
      $keylength = strlen($key);
      $string = $operation == 'DECODE' ? base64_decode($string) : $string;
      for($i = 0; $i < strlen($string); $i += $keylength) {
           $coded .= substr($string, $i, $keylength) ^ $key;
      }
      $coded = $operation == &#39;ENCODE&#39; ? str_replace(&#39;=&#39;, &#39;&#39;, base64_encode($coded)) : $coded;
      return $coded;
}
替换为
复制内容到剪贴板
代码:
function authcode ($string, $operation, $key = &#39;&#39;) {
      
      $key = bin2hex($key ? $key : $GLOBALS[&#39;discuz_auth_key&#39;]);
      $key_length = strlen($key);
      
      $string = $operation == &#39;DECODE&#39; ? base64_decode($string) : $string;
      $string_length = strlen($string);
           
      $rndkey = $box = array();
      $result = &#39;&#39;;
      
      for ($i = 0; $i <= 255; $i++) {
           $rndkey[$i] = ord($key[$i % $key_length]);
           $box[$i] = $i;
      }

      for ($j = $i = 0; $i < 256; $i++) {
           $j = ($j + $box[$i] + $rndkey[$i]) % 256;
           $tmp = $box[$i];
           $box[$i] = $box[$j];
           $box[$j] = $tmp;
      }
      
      for ($a = $j = $i = 0; $i < $string_length; $i++) {
           $a = ($a + 1) % 256;
           $j = ($j + $box[$a]) % 256;
           $tmp = $box[$a];
           $box[$a] = $box[$j];
           $box[$j] = $tmp;
           $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256]));
      }
      return ($operation == &#39;ENCODE&#39; ? str_replace(&#39;=&#39;, &#39;&#39;, base64_encode($result)) : $result);
}
select girl from Guilin where age='18-20' and bg='beautiful'--

TOP

Discuz! 5.0.0 GBK SQL Injection / Admin Credentials Disclosure Exploit

http://forum.eviloctal.com/read-htm-tid-25710.html

TOP

发新话题