在使用Navicat 是都是习惯性的保存了密码,久而久之后 就会忘记数据库密码, 这就很不舒服了。
但是,这有个技巧,可以查看navicat 已连接保存的密码。
首先,打开navicat在想要查看密码的连接那单击选中,在顶部菜单中找到“导出连接”选项。
![在这里插入图片描述](https://img-blog.csdnimg.cn/548b65645f364239bdc759701a7d86d6.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L21hb3FpdWRhZA==,size_16,color_FFFFFF,t_70#pic_center)
在弹出的窗口中,记得勾选上“导出密码”。
导出后打开文件,找到文件里 password 字段的值。
把它复制下来。准备开始破译密码。
破译密码
github有位大佬分享了php破解密码代码,我们没php环境的可以直接去使用:在线运行php的工具
破解密码代码如下:
<?php
namespace FatSmallTools;
class NavicatPassword
{
protected $version = 0;
protected $aesKey = 'libcckeylibcckey';
protected $aesIv = 'libcciv libcciv ';
protected $blowString = '3DC5CA39';
protected $blowKey = null;
protected $blowIv = null;
public function __construct($version = 12)
{
$this->version = $version;
$this->blowKey = sha1('3DC5CA39', true);
$this->blowIv = hex2bin('d9c7c3c8870d64bd');
}
public function encrypt($string)
{
$result = FALSE;
switch ($this->version) {
case 11:
$result = $this->encryptEleven($string);
break;
case 12:
$result = $this->encryptTwelve($string)