{"id":1135,"date":"2025-12-21T22:49:39","date_gmt":"2025-12-21T14:49:39","guid":{"rendered":"https:\/\/h4ckm310n.com\/?p=1135"},"modified":"2025-12-26T00:08:42","modified_gmt":"2025-12-25T16:08:42","slug":"%e8%a7%a3%e5%af%86%e5%ae%89%e5%8d%93ntqq%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93","status":"publish","type":"post","link":"https:\/\/h4ckm310n.com\/?p=1135","title":{"rendered":"\u89e3\u5bc6\u5b89\u5353NTQQ\u7684\u6570\u636e\u5e93"},"content":{"rendered":"<p><!--more--><\/p>\n<p>\u867d\u7136\u7535\u8111\u4e0a\u8fd8\u662f\u65e7\u7248\u7684QQ\uff0c\u4f46\u624b\u673a\u4e0a\u65e9\u5df2\u66f4\u65b0\u5230\u4e86\u65b0\u7248\uff08NT\uff09\u3002\u8fd9\u6b21\u6765\u7814\u7a76\u4e00\u4e0b\u5982\u4f55\u89e3\u5bc6NTQQ\u7684\u6570\u636e\u5e93\u3002\u867d\u7136\u7535\u8111\u7248\u7684NTQQ\u6570\u636e\u5e93\u683c\u5f0f\u8ddf\u5b89\u5353\u7684\u76f8\u540c\uff0c\u4f46\u83b7\u53d6key\u8fd9\u4e00\u90e8\u5206\u53ea\u9002\u7528\u4e8e\u5b89\u5353\u7248\u672c\u3002<\/p>\n<p>\u9996\u5148\uff0c\u624b\u673a\u9700\u8981\u6709root\u6743\u9650\uff0c\u8fd9\u6837\u624d\u80fd\u8bbf\u95ee\/data\/data\u76ee\u5f55\u3002\u8fdb\u5165\/data\/data\/com.tencent.mobileqq\uff0c\u5c06databases\u548cfiles\/uid\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5939\u62f7\u5230\u7535\u8111\u4e0a\uff0c\u63a5\u4e0b\u6765\u7684\u64cd\u4f5c\u4f1a\u5728\u7535\u8111\u4e0a\uff08Windows\uff09\u8fdb\u884c\u3002<\/p>\n<h4>\u83b7\u53d6\u6570\u636e\u5e93\u6587\u4ef6<\/h4>\n<p>\u5728uid\u76ee\u5f55\u4e0b\uff0c\u53ef\u4ee5\u770b\u5230\u6587\u4ef6\u540d\u683c\u5f0f\u4e3a\u201cQQ\u53f7###uid\u201d\u7684\u6587\u4ef6\uff0c\u4f8b\u5982123456789###u_xxxxxxxx\u3002\u5f97\u5230\u8fd9\u4e2auid\u4e4b\u540e\uff0c\u5bf9\u5b83\u8fdb\u884cmd5\uff0c\u5f97\u5230\u4e00\u4e32hash\uff0c\u6b64\u5904\u8bb0\u4e3auid hash\u3002<\/p>\n<p>\u5c06uid hash\u672b\u5c3e\u52a0\u4e0a\u201cnt_kernel\u201d\u540e\uff0c\u518d\u6b21\u8fdb\u884cmd5\uff0c\u5f97\u5230\u53e6\u4e00\u4e32hash\uff0c\u5c06\u8fd9\u4e32hash\u524d\u9762\u52a0\u4e0a\u201cnt_qq_\u201d\uff0c\u5728databases\/nt_db\u76ee\u5f55\u4e0b\u53ef\u4ee5\u627e\u5230\u5bf9\u5e94\u7684\u8def\u5f84\uff0c\u8fd9\u5c31\u662fQQ\u53f7\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u8def\u5f84\u4e86\u3002<\/p>\n<p>hash\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>def get_qq_uid_hash(nt_uid):\r\n    return md5(nt_uid.encode('utf-8')).hexdigest()\r\n\r\ndef get_qq_path_hash(qq_uid_hash):\r\n    return md5((qq_uid_hash+'nt_kernel').encode('utf-8')).hexdigest()\r\n<\/pre>\n<h4>\u83b7\u53d6key<\/h4>\n<p>\u6570\u636e\u5e93\u76ee\u5f55\u4e0b\u6709\u591a\u4e2a\u6570\u636e\u5e93\u6587\u4ef6\uff0c\u6211\u5c1d\u8bd5\u4e86\u5176\u4e2d\u51e0\u4e2a\u6587\u4ef6\uff0c\u89e3\u5bc6\u65b9\u5f0f\u5e94\u8be5\u90fd\u662f\u4e00\u6837\u7684\u3002<br \/>\n\u7528winhex\u6253\u5f00\u6570\u636e\u5e93\u6587\u4ef6\uff0c\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u5185\u5bb9\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1139\" src=\"https:\/\/h4ckm310n.com\/wp-content\/uploads\/2025\/12\/nt_qq_decrypt_1.png\" alt=\"\" width=\"398\" height=\"448\" srcset=\"https:\/\/h4ckm310n.com\/wp-content\/uploads\/2025\/12\/nt_qq_decrypt_1.png 398w, https:\/\/h4ckm310n.com\/wp-content\/uploads\/2025\/12\/nt_qq_decrypt_1-267x300.png 267w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/p>\n<p>\u5176\u4e2d\uff0c\u7b2c\u4e00\u4e2a\u7ea2\u6846\u5185\u7684\u5b57\u7b26\u4e32\u8bb0\u4e3arand\u3002\u5c06\u524d\u9762\u5f97\u5230\u7684uid hash\u540e\u9762\u52a0\u4e0a\u8fd9\u4e2arand\uff0c\u518d\u8fdb\u884cmd5\uff0c\u5c31\u5f97\u5230key\u4e86\uff1a<\/p>\n<pre>def get_key(qq_uid_hash, rand):\r\n    return md5((qq_uid_hash+rand).encode('utf-8')).hexdigest()\r\n<\/pre>\n<h4>\u89e3\u5bc6<\/h4>\n<p>\u5148\u53bb\u9664\u6389\u6587\u4ef6\u7684\u524d1024\u4e2a\u5b57\u8282\uff0c\u8fd9\u6837\u624d\u80fd\u88ab\u6b63\u786e\u8bfb\u53d6\uff1a<\/p>\n<pre>import shutil\r\n\r\nwith open('nt_msg.db', 'rb') as f_in:\r\n    f_in.seek(1024)\r\n    with open('nt_msg_2.db', 'wb') as f_out:\r\n        shutil.copyfileobj(f_in, f_out)\r\n<\/pre>\n<p>\u89e3\u5bc6\u9700\u8981\u4f7f\u7528sqlcipher\uff0cwindows\u4e0b\u53ef\u4ee5\u4ece\u8fd9\u91cc\u4e0b\u8f7d\u5df2\u7f16\u8bd1\u597d\u7684\u7248\u672c\uff1a<a href=\"https:\/\/github.com\/QQBackup\/sqlcipher-github-actions\/releases\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/QQBackup\/sqlcipher-github-actions\/releases<\/a><br \/>\n\u8fd0\u884csqlcipher\u547d\u4ee4\u884c\uff1a<\/p>\n<pre>.\\sqlcipher-x64.exe .\\nt_msg_2.db<\/pre>\n<p>\u8fdb\u5165sqlcipher\u73af\u5883\u540e\uff0c\u4f9d\u6b21\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>PRAGMA key = 'key';\r\nPRAGMA cipher_page_size = 4096;\r\nPRAGMA kdf_iter = 4000;\r\nPRAGMA cipher_hmac_algorithm = HMAC_SHA1;\r\nPRAGMA cipher_default_kdf_algorithm = PBKDF2_HMAC_SHA512;\r\nPRAGMA cipher = 'aes-256-cbc';\r\n<\/pre>\n<p>\u9996\u5148\uff0c\u7b2c\u4e00\u884c\u7684key\uff0c\u5c31\u662f\u524d\u9762\u83b7\u53d6\u5230\u7684key\u3002<br \/>\n\u7b2c\u56db\u884c\u7684\u7b97\u6cd5\uff0c\u6839\u636e\u56fe1\u4e2d\u7684\u7b2c2\u4e2a\u7ea2\u6846\u8fdb\u884c\u586b\u5199\uff0c\u6b64\u5904\u5c31\u662fHMAC_SHA1\u3002<br \/>\n\u6b64\u65f6\uff0c\u5e94\u8be5\u53ef\u4ee5\u6b63\u5e38\u8bfb\u53d6\u6570\u636e\u5e93\u7684\u5185\u5bb9\u4e86\u3002<\/p>\n<h4>\u5bfc\u51fa<\/h4>\n<p>\u5c3d\u7ba1\u73b0\u5728\u53ef\u4ee5\u6b63\u5e38\u8bfb\u53d6\u6570\u636e\u5e93\u4e86\uff0c\u4f46\u4e3a\u4e86\u4e4b\u540e\u66f4\u65b9\u4fbf\u5730\u8bfb\u53d6\uff0c\u6211\u9700\u8981\u5c06\u5b83\u5bfc\u51fa\u4e3a\u672a\u52a0\u5bc6\u72b6\u6001\u7684\u6b63\u5e38\u6570\u636e\u5e93\u6587\u4ef6\u3002\u5728\u8fd9\u4e00\u6b65\uff0c\u6211\u9047\u5230\u4e86\u4e0d\u5c11\u9ebb\u70e6\u3002<\/p>\n<p>\u4e00\u5f00\u59cb\uff0c\u6211\u76f4\u63a5\u5728sqlcipher\u4e2d\u5bfc\u51fa\u4e3a\u65b0\u7684\u6570\u636e\u5e93\uff1a<\/p>\n<pre>ATTACH DATABASE 'nt_msg_dec.db' AS plaintext KEY '';\r\nSELECT sqlcipher_export('plaintext');\r\nDETACH DATABASE plaintext;\r\n<\/pre>\n<p>\u51fa\u73b0\u62a5\u9519\uff1a<br \/>\nRuntime error: database disk image is malformed<\/p>\n<p>\u4e8e\u662f\uff0c\u6839\u636e<a href=\"https:\/\/github.com\/QQBackup\/qq-win-db-key\/issues\/57\" target=\"_blank\" rel=\"noopener\">\u8fd9\u4e2aissue<\/a>\uff0c\u6211\u5148\u5728sqlcipher\u4e2d\u5bfc\u51fasql\u6587\u4ef6\uff1a<\/p>\n<pre>.output nt_msg.sql\r\n.dump\r\n<\/pre>\n<p>\u5b89\u88c5MSYS2\uff0c\u8fdb\u5165UCRT64\u7ec8\u7aef\uff0c\u5b89\u88c5sqlite3\uff1a<\/p>\n<pre>pacman -S mingw-w64-ucrt-x86_64-sqlite3<\/pre>\n<p>\u5bf9\u4e4b\u524d\u7684sql\u8fdb\u884c\u4e00\u4e9b\u5904\u7406\uff0c\u518d\u5bfc\u5165sqlite3\uff1a<\/p>\n<pre>\r\ncat nt_msg.sql | sed -e 's|^ROLLBACK;\\( -- due to errors\\)*$|COMMIT;|g' &gt; nt_msg_2.sql\r\nsqlite3 nt_msg_dec.db &lt; nt_msg_2.sql\r\n<\/pre>\n<p>\u53c8\u51fa\u73b0\u62a5\u9519\uff1a<br \/>\nParse error near line xxx: unrecognized token: xxx<\/p>\n<p>\u6211\u731c\u6d4b\uff0c\u5e94\u8be5\u662f\u56e0\u4e3a\u91cc\u9762\u67d0\u4e9b\u5b57\u6bb5\u5305\u542b\u7279\u6b8a\u5b57\u7b26\uff08\u4f8b\u5982\u4e00\u4e9b\u975e\u4e3b\u6d41\u7684\u6635\u79f0\uff09\u3002\u76ee\u524d\u6ca1\u53d1\u73b0\u6709\u4ec0\u4e48\u529e\u6cd5\u80fd\u591f\u5728\u4fdd\u7559\u8fd9\u4e9b\u5b57\u7b26\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u5bfc\u5165\uff0c\u56e0\u6b64\u53ea\u597d\u53bb\u9664\u6389\u8fd9\u4e9b\u5b57\u7b26\uff1a<\/p>\n<pre>sed -i 's\/[[:cntrl:]]\/\/g' nt_msg_2.sql<\/pre>\n<p>\u518d\u6b21\u5bfc\u5165sqlite3\uff0c\u8fd9\u6b21\u6b63\u5e38\u4e86\uff0c\u80fd\u591f\u521b\u5efa\u51fa\u65b0\u7684\u6570\u636e\u5e93\u6587\u4ef6\u4e86\u3002\u5c31\u662f\u4e0d\u77e5\u9053\u4f1a\u4e0d\u4f1a\u6709\u4ec0\u4e48\u7f3a\u5931\u3002<\/p>\n<p>\u4e0b\u4e00\u6b65\uff0c\u6211\u5c06\u57fa\u4e8e\u6570\u636e\u5e93\u4e2d\u7684\u804a\u5929\u8bb0\u5f55\uff0c\u5220\u9664\u6389\u90e8\u5206\u7fa4\u804a\u7684\u56fe\u7247\u3002<\/p>\n<h4>\u53c2\u8003<\/h4>\n<p>1. <a href=\"https:\/\/docs.aaqwq.top\/decrypt\/NTQQ%20(Android).html\" target=\"_blank\" rel=\"noopener\">https:\/\/docs.aaqwq.top\/decrypt\/NTQQ%20(Android).html<\/a><br \/>\n2. <a href=\"https:\/\/github.com\/Mythologyli\/qq-nt-db\" target=\"_blank\">https:\/\/github.com\/Mythologyli\/qq-nt-db<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[22,6],"tags":[],"class_list":["post-1135","post","type-post","status-publish","format-standard","hentry","category-android","category-6"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"h4ckm310n","author_link":"https:\/\/h4ckm310n.com\/?author=1"},"uagb_comment_info":1,"uagb_excerpt":null,"_links":{"self":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts\/1135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1135"}],"version-history":[{"count":7,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts\/1135\/revisions"}],"predecessor-version":[{"id":1143,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=\/wp\/v2\/posts\/1135\/revisions\/1143"}],"wp:attachment":[{"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h4ckm310n.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}