0%

导出连接

  1. 文件 –> 导出连接

  1. 更改保存路径,记得勾选导出密码,点击确定,生产connections.ncx文件,注意以.ncx结尾的文件

密码解密

将connections.crx用text打开,在txt文档中搜索Password,找到Password=后面的明文,在下面代码中进行运行解密,就可以得到数据库连接的密码;

那么就需要用到一段PHP代码,该代码可以通过在线运行PHP代码在线运行:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
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);
break;
default:
break;
}

return $result;
}

protected function encryptEleven($string)
{
$round = intval(floor(strlen($string) / 8));
$leftLength = strlen($string) % 8;
$result = '';
$currentVector = $this->blowIv;

for ($i = 0; $i < $round; $i++) {
$temp = $this->encryptBlock($this->xorBytes(substr($string, 8 * $i, 8), $currentVector));
$currentVector = $this->xorBytes($currentVector, $temp);
$result .= $temp;
}

if ($leftLength) {
$currentVector = $this->encryptBlock($currentVector);
$result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
}

return strtoupper(bin2hex($result));
}

protected function encryptBlock($block)
{
return openssl_encrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING);
}

protected function decryptBlock($block)
{
return openssl_decrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING);
}

protected function xorBytes($str1, $str2)
{
$result = '';
for ($i = 0; $i < strlen($str1); $i++) {
$result .= chr(ord($str1[$i]) ^ ord($str2[$i]));
}

return $result;
}

protected function encryptTwelve($string)
{
$result = openssl_encrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
return strtoupper(bin2hex($result));
}

public function decrypt($string)
{
$result = FALSE;
switch ($this->version) {
case 11:
$result = $this->decryptEleven($string);
break;
case 12:
$result = $this->decryptTwelve($string);
break;
default:
break;
}

return $result;
}

protected function decryptEleven($upperString)
{
$string = hex2bin(strtolower($upperString));

$round = intval(floor(strlen($string) / 8));
$leftLength = strlen($string) % 8;
$result = '';
$currentVector = $this->blowIv;

for ($i = 0; $i < $round; $i++) {
$encryptedBlock = substr($string, 8 * $i, 8);
$temp = $this->xorBytes($this->decryptBlock($encryptedBlock), $currentVector);
$currentVector = $this->xorBytes($currentVector, $encryptedBlock);
$result .= $temp;
}

if ($leftLength) {
$currentVector = $this->encryptBlock($currentVector);
$result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
}

return $result;
}

protected function decryptTwelve($upperString)
{
$string = hex2bin(strtolower($upperString));
return openssl_decrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
}
};


//需要指定navacat版本两种,11或12
$navicatPassword = new NavicatPassword(12);

//解密,括号里面写入navicat加密后的密码
$decode = $navicatPassword->decrypt('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
echo $decode."\n";

解决办法

鼠标右击命令行窗口上边框->属性->布局,适当调整屏幕缓冲区高度大小即可。

下载Python

https://www.python.org/downloads/windows/

选择Windows x86 executable installer下载

embeddable zip file(压缩包安装,直接解压就可以) executable installer(应用程序安装,推荐!!) web-based installer(网络安装,安装的时候胡需要网络)

安装Python

1. 打开下载的安装软件

2. 选择install now并勾选Add Python 3.6 to PATH(重要!!!)

3. 安装成功点击close

验证

在cmd窗口中输入python -V检查是否安装成功

更新pip

1
python -m pip install --upgrade pip

1
2
3
4
5
6
# /Users/linjian/anaconda3 anaconda安装路径
# RPA_Code 环境名称
/Users/linjian/anaconda3/envs/RPA_Code/lib/python3.10/site-packages


/Users/linjian/anaconda3/envs/RPA_Code/include

有些包在Anaconda中找不到,例如pdf2image,需要手动安装。

操作步骤

获取安装命令

https://anaconda.org/

执行安装命令

到Anaconda安装目录/Users/linjian/anaconda3/bin执行以下命令

1
2
# -n 指定环境
conda install -n RPA_Code -c conda-forge pdf2image