Navicat导出连接查看数据库密码
Navicat15导出连接,文件connections.ncx内容如下:
<?xml version="1.0" encoding="UTF-8"?> <Connections Ver="1.4"> <Connection ConnectionName="MySQL8" ProjectUUID="" ConnType="MYSQL" OraConnType="" ServiceProvider="Default" Host="localhost" Port="3306" Database="" OraServiceNameType="" TNS="" MSSQLAuthenMode="" MSSQLAuthenWindowsDomain="" DatabaseFileName="" UserName="root" Password="503AA930968F877F04770B47DD731DC0" SavePassword="true" SettingsSavePath="C:\Users\Administer\Documents\Navicat\MySQL\Servers\MySQL8" SessionLimit="0" Encoding="0" Keepalive="false" KeepaliveInterval="240" MySQLCharacterSet="true" Compression="false" AutoConnect="false" NamedPipe="false" NamedPipeSocket="" OraRole="" OraOSAuthen="false" SQLiteEncrypt="false" SQLiteEncryptPassword="" SQLiteSaveEncryptPassword="false" UseAdvanced="false" SSL="false" SSL_Authen="false" SSL_PGSSLMode="REQUIRE" SSL_ClientKey="" SSL_ClientCert="" SSL_CACert="" SSL_Clpher="" SSL_PGSSLCRL="" SSL_WeakCertValidation="false" SSL_AllowInvalidHostName="false" SSL_PEMClientKeyPassword="" SSH="false" SSH_Host="" SSH_Port="22" SSH_UserName="" SSH_AuthenMethod="PASSWORD" SSH_Password="" SSH_SavePassword="false" SSH_PrivateKey="" SSH_Passphrase="" SSH_SavePassphrase="false" SSH_Compress="false" HTTP="false" HTTP_URL="" HTTP_PA="" HTTP_PA_UserName="" HTTP_PA_Password="" HTTP_PA_SavePassword="" HTTP_EQ="" HTTP_CA="" HTTP_CA_ClientKey="" HTTP_CA_ClientCert="" HTTP_CA_CACert="" HTTP_CA_Passphrase="" HTTP_Proxy="" HTTP_Proxy_Host="" HTTP_Proxy_Port="" HTTP_Proxy_UserName="" HTTP_Proxy_Password="" HTTP_Proxy_SavePassword=""/> </Connections>
其中数据库密码密文为503AA930968F877F04770B47DD731DC0
python解密代码如下:
from Crypto.Cipher import AES from binascii import a2b_hex class PrpCrypt(object): def __init__(self): self.key = 'libcckeylibcckey'.encode('utf-8') self.mode = AES.MODE_CBC self.iv = 'libcciv libcciv '.encode('utf-8') def decrypt(self, text): text = text.encode('utf-8') if type(text)==str else text cryptor = AES.new(self.key, self.mode, self.iv) plain_text = cryptor.decrypt(a2b_hex(text)) return bytes.decode(plain_text).rstrip() if __name__ == '__main__': pc = PrpCrypt() print('密码:',pc.decrypt('503AA930968F877F04770B47DD731DC0'))
posted on 2022-09-07 16:16 PythonBaby 阅读(821) 评论(0) 收藏 举报
浙公网安备 33010602011771号