破解Navicat Premium数据库账号密码

- 日理万妓 2022-12-03 01:59 458阅读 0赞

在线PHP运行工具

在这里插入图片描述

  1. <?php
  2. namespace FatSmallTools;
  3. class NavicatPassword
  4. {
  5. protected $version = 0;
  6. protected $aesKey = 'libcckeylibcckey';
  7. protected $aesIv = 'libcciv libcciv ';
  8. protected $blowString = '3DC5CA39';
  9. protected $blowKey = null;
  10. protected $blowIv = null;
  11. public function __construct($version = 12)
  12. {
  13. $this->version = $version;
  14. $this->blowKey = sha1('3DC5CA39', true);
  15. $this->blowIv = hex2bin('d9c7c3c8870d64bd');
  16. }
  17. public function encrypt($string)
  18. {
  19. $result = FALSE;
  20. switch ($this->version) {
  21. case 11:
  22. $result = $this->encryptEleven($string);
  23. break;
  24. case 12:
  25. $result = $this->encryptTwelve($string);
  26. break;
  27. default:
  28. break;
  29. }
  30. return $result;
  31. }
  32. protected function encryptEleven($string)
  33. {
  34. $round = intval(floor(strlen($string) / 8));
  35. $leftLength = strlen($string) % 8;
  36. $result = '';
  37. $currentVector = $this->blowIv;
  38. for ($i = 0; $i < $round; $i++) {
  39. $temp = $this->encryptBlock($this->xorBytes(substr($string, 8 * $i, 8), $currentVector));
  40. $currentVector = $this->xorBytes($currentVector, $temp);
  41. $result .= $temp;
  42. }
  43. if ($leftLength) {
  44. $currentVector = $this->encryptBlock($currentVector);
  45. $result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
  46. }
  47. return strtoupper(bin2hex($result));
  48. }
  49. protected function encryptBlock($block)
  50. {
  51. return openssl_encrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING);
  52. }
  53. protected function decryptBlock($block)
  54. {
  55. return openssl_decrypt($block, 'BF-ECB', $this->blowKey, OPENSSL_RAW_DATA|OPENSSL_NO_PADDING);
  56. }
  57. protected function xorBytes($str1, $str2)
  58. {
  59. $result = '';
  60. for ($i = 0; $i < strlen($str1); $i++) {
  61. $result .= chr(ord($str1[$i]) ^ ord($str2[$i]));
  62. }
  63. return $result;
  64. }
  65. protected function encryptTwelve($string)
  66. {
  67. $result = openssl_encrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
  68. return strtoupper(bin2hex($result));
  69. }
  70. public function decrypt($string)
  71. {
  72. $result = FALSE;
  73. switch ($this->version) {
  74. case 11:
  75. $result = $this->decryptEleven($string);
  76. break;
  77. case 12:
  78. $result = $this->decryptTwelve($string);
  79. break;
  80. default:
  81. break;
  82. }
  83. return $result;
  84. }
  85. protected function decryptEleven($upperString)
  86. {
  87. $string = hex2bin(strtolower($upperString));
  88. $round = intval(floor(strlen($string) / 8));
  89. $leftLength = strlen($string) % 8;
  90. $result = '';
  91. $currentVector = $this->blowIv;
  92. for ($i = 0; $i < $round; $i++) {
  93. $encryptedBlock = substr($string, 8 * $i, 8);
  94. $temp = $this->xorBytes($this->decryptBlock($encryptedBlock), $currentVector);
  95. $currentVector = $this->xorBytes($currentVector, $encryptedBlock);
  96. $result .= $temp;
  97. }
  98. if ($leftLength) {
  99. $currentVector = $this->encryptBlock($currentVector);
  100. $result .= $this->xorBytes(substr($string, 8 * $i, $leftLength), $currentVector);
  101. }
  102. return $result;
  103. }
  104. protected function decryptTwelve($upperString)
  105. {
  106. $string = hex2bin(strtolower($upperString));
  107. return openssl_decrypt($string, 'AES-128-CBC', $this->aesKey, OPENSSL_RAW_DATA, $this->aesIv);
  108. }
  109. }
  110. use FatSmallTools\NavicatPassword;
  111. //需要指定版本,11或12
  112. //$navicatPassword = new NavicatPassword(12);
  113. $navicatPassword = new NavicatPassword(11);
  114. //解密
  115. //$decode = $navicatPassword->decrypt('15057D7BA390');
  116. $decode = $navicatPassword->decrypt('15057D7BA390');
  117. echo $decode."\n";

在倒数第二行的字符串中,换成自己的,运行即可!

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,458人围观)

还没有评论,来说两句吧...

相关阅读

    相关 破解navicat premium12

    (之前下载的navicat已过试用期,为了便于以后使用,重新下载了navicat premium12,网上找到了比较方便的破解方法,这里分享给大家) 来源地址:[https

    相关 Navicat Premium 12破解方法

    > 一,问题 最近想换一个连接mysql的可视化工具,后来查了一下资料,觉得navicat好像挺不错的。然后去查了一下资料。 > 二,解决方案 2.1 去官网下载最新版的