{"id":10020499,"date":"2024-12-15T23:16:25","date_gmt":"2024-12-15T15:16:25","guid":{"rendered":"https:\/\/itmax.cn\/?p=10020499"},"modified":"2024-12-15T23:16:25","modified_gmt":"2024-12-15T15:16:25","slug":"%e5%88%a9%e7%94%a8web%e5%be%ae%e4%bf%a1%ef%bc%88%e7%bd%91%e9%a1%b5%e7%89%88%e5%be%ae%e4%bf%a1%ef%bc%89%e6%8e%a5%e5%8f%a3%e5%ae%9e%e7%8e%b0%e4%b8%aa%e4%ba%ba%e5%be%ae%e4%bf%a1api%e5%8f%91%e9%80%81","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10020499","title":{"rendered":"\u5229\u7528Web\u5fae\u4fe1\uff08\u7f51\u9875\u7248\u5fae\u4fe1\uff09\u63a5\u53e3\u5b9e\u73b0\u4e2a\u4eba\u5fae\u4fe1API\u53d1\u9001\u6d88\u606f"},"content":{"rendered":"<h2>\u6458\u8981<\/h2>\n<p>\u5fae\u4fe1\u5b98\u65b9\u662f\u6ca1\u6709\u63d0\u4f9b\u4e2a\u4eba\u5fae\u4fe1\u63a5\u53e3\u7684\uff0c\u5e02\u9762\u4e0a\u7684\u63a5\u53e3\u57fa\u672c\u90fd\u662f\u901a\u8fc7\u4e0d\u6b63\u89c4\u7684\u65b9\u5f0f\u53bb\u5b9e\u73b0\u7684\uff0c\u4f8b\u5982<code>Web\u534f\u8bae<\/code>\u3001<code>\u5fae\u4fe1HOOK<\/code>\u3001<code>iPad\u534f\u8bae<\/code>\u3001<code>Android\u534f\u8bae<\/code>\u3002\u8fd9\u4e9b\u6240\u8c13\u7684\u534f\u8bae\uff0c\u8981\u4e48\u662f\u6293\u5305HTTP\u534f\u8bae\uff0c\u8981\u4e48\u662f\u901a\u8fc7HOOK\u6280\u672f\u5b9e\u73b0\u7684\u7ed9\u4e88\u5185\u5b58\u6570\u636e\u52ab\u6301\u5b9e\u73b0\u7684\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u63a5\u53e3\u6280\u672f<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Web\u534f\u8bae<\/td>\n<td>\u57fa\u4e8e\u7f51\u9875\u7248\u5fae\u4fe1HTTP\u63a5\u53e3\u5b9e\u73b0\u7684<\/td>\n<\/tr>\n<tr>\n<td>\u5fae\u4fe1HOOK<\/td>\n<td>\u57fa\u4e8e\u7535\u8111\u7248\u5fae\u4fe1\u7684\u5185\u5b58\u52ab\u6301<\/td>\n<\/tr>\n<tr>\n<td>iPad\u534f\u8bae<\/td>\n<td>\u57fa\u4e8eiPad\u7248\u5fae\u4fe1\u9006\u5411API<\/td>\n<\/tr>\n<tr>\n<td>Android\u534f\u8bae<\/td>\n<td>\u57fa\u4e8eAndroid\u5fae\u4fe1Xposed\u6846\u67b6HOOK<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Web\u534f\u8bae<\/h2>\n<p>\u5728\u8fd9\u4e48\u591a\u534f\u8bae\u4e2d\uff0cWeb\u534f\u8bae\u7684\u5b9e\u73b0\u6bd4\u8f83\u7ecf\u6d4e\uff0c\u6280\u672f\u8981\u6c42\u4e5f\u6781\u4f4e\uff0c\u56e0\u4e3a\u6709\u5f88\u591a\u7684\u73b0\u6210\u7684\u5e93\u3002\u5728\u524d\u51e0\u5e74\uff0c\u90fd\u6709\u5f88\u591a\u8457\u540d\u7684Web\u5fae\u4fe1\u534f\u8bae\u7684Python\u5e93\uff0c\u4f8b\u5982itchat\u3001Wxpy\u3001WeixinBot\uff0c\u90fd\u662f\u53ef\u4ee5\u76f4\u63a5\u7528\u7684\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u65e9\u57282017\u5e74\u5f00\u59cb\uff0c\u5fae\u4fe1\u7f51\u9875\u7248\u5c31\u5df2\u7ecf\u4f4f\u9010\u6e10\u5f00\u59cb\u505c\u6b62\u767b\u5f55\uff0c\u4ee5\u4e3a\u4e86\u4fdd\u969c\u4f60\u7684\u8d26\u53f7\u5b89\u5168\u4e3a\u7531\u5f15\u5bfc\u4f60\u4f7f\u7528\u7535\u8111\u7248\u5fae\u4fe1\uff0c\u56e0\u6b64\u8fd9\u4e9b\u5e93\u53ef\u4ee5\u8bf4\u662f\u4e0d\u53ef\u7528\u4e86\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u73b0\u5728\u6709\u4e86\u65b0\u7684\u65b9\u6cd5\uff0c\u90a3\u5c31\u662f\u53ef\u4ee5\u767b\u5f55\u7f51\u9875\u7248\u5fae\u4fe1\u4e86\uff0c\u65e2\u7136\u53ef\u4ee5\u767b\u5f55\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u83b7\u5f97\u4e00\u4e9b\u5173\u952e\u7684\u53c2\u6570\u503c\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u53c2\u6570\u503c\u53bb\u8bf7\u6c42\u8fd9\u4e2aWeb\u5fae\u4fe1\u7684API\u3002<\/p>\n<p>\u5177\u4f53\u8bf7\u9605\u8bfb\u8fd9\u7bc7\u6587\u7ae0\u5373\u53ef\u8ba9\u4f60\u5fae\u4fe1\u767b\u5f55\u7f51\u9875\u7248\uff1a<a href=\"https:\/\/segmentfault.com\/a\/1190000044931999\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/segmentfault.com\/a\/1190000044931999<\/a><\/p>\n<h2>\u53d1\u9001\u6d88\u606f\u7684\u793a\u4f8b<\/h2>\n<pre><code>import requests\nimport json\nimport random\nimport time\n\ndef generate_device_id():\n    return &quot;e&quot; + &quot;&quot;.join(str(random.randint(0, 9)) for _ in range(15))\n\nurl = &quot;https:\/\/wx2.qq.com\/cgi-bin\/mmwebwx-bin\/webwxsendmsg&quot;\n\nheaders = {\n    &quot;Content-Type&quot;: &quot;application\/json;charset=UTF-8&quot;,\n    'Cookie': 'web\u5fae\u4fe1\u7684Cookie', # \u81ea\u5df1\u53bb\u6293\u5305\u83b7\u53d6\uff08\u65e0\u9700\u5b8c\u6574\u7684\uff0c\u53ea\u9700\u8981 psrf_qqopenid \u524d\u8fd9\u4e00\u6bb5\uff09\n    &quot;Host&quot;: &quot;wx2.qq.com&quot;,\n    &quot;Origin&quot;: &quot;https:\/\/wx2.qq.com&quot;,\n    &quot;Referer&quot;: &quot;https:\/\/wx2.qq.com\/?target=t&quot;,\n    &quot;client-version&quot;: &quot;2.0.0&quot;\n}\n\ndata = {\n    &quot;BaseRequest&quot;: {\n        &quot;Uin&quot;: &quot;\u81ea\u5df1\u53bb\u6293\u5305\u83b7\u53d6&quot;, #\uff08\u4e00\u822c\u662f\u56fa\u5b9a\u7684\uff0c\u91cd\u65b0\u767b\u5f55\u540e\u4e0d\u53d8\uff09\n        &quot;Sid&quot;: &quot;\u81ea\u5df1\u53bb\u6293\u5305\u83b7\u53d6&quot;, #\uff08\u91cd\u65b0\u767b\u5f55\u540e\u4f1a\u53d8\uff09\n        &quot;Skey&quot;: &quot;\u81ea\u5df1\u53bb\u6293\u5305\u83b7\u53d6&quot;,#\uff08\u91cd\u65b0\u767b\u5f55\u540e\u4f1a\u53d8\uff09\n        &quot;DeviceID&quot;: generate_device_id()\n    },\n    &quot;Msg&quot;: {\n        &quot;Type&quot;: 1,  # \u6d88\u606f\u7c7b\u578b\uff0c1\u8868\u793a\u6587\u672c\u6d88\u606f\n        &quot;Content&quot;: 'hahaha123456',  # \u6d88\u606f\u5185\u5bb9\n        &quot;FromUserName&quot;: &quot;\u81ea\u5df1\u53bb\u6293\u5305\u83b7\u53d6&quot;,  # \u53d1\u9001\u7528\u6237\uff08\u91cd\u65b0\u767b\u5f55\u540e\u4f1a\u53d8\uff09\n        &quot;ToUserName&quot;: &quot;\u81ea\u5df1\u53bb\u6293\u5305\u83b7\u53d6&quot;,  # \u63a5\u6536\u7528\u6237\uff08\u91cd\u65b0\u767b\u5f55\u540e\u4f1a\u53d8\uff09\n        &quot;LocalID&quot;: str(int(time.time() * 1000)),  # \u4f7f\u7528\u5f53\u524d\u65f6\u95f4\u6233\u751f\u6210\u552f\u4e00 ID\uff08\u81ea\u52a8\u751f\u6210\uff09\n        &quot;ClientMsgId&quot;: str(int(time.time() * 1000)) + str(random.random())[2:6]  # \u4f7f\u7528\u5f53\u524d\u65f6\u95f4\u6233\u751f\u6210\u552f\u4e00 ClientMsgId\uff08\u81ea\u52a8\u751f\u6210\uff09\n    }\n}\n\nresponse = requests.post(url, headers=headers, data=json.dumps(data))\n\nprint(response.text)<\/code><\/pre>\n<h2>\u5173\u952e\u53c2\u6570<\/h2>\n<pre><code>Cookie\uff1a\nUin\nSid\nSkey\nDeviceID\nFromUserName\nToUserName\nLocalID\nClientMsgId<\/code><\/pre>\n<p>\u5982\u4f55\u83b7\u53d6\u8fd9\u4e9b\u53c2\u6570\uff1f<\/p>\n<p>\u9996\u5148\uff0c\u767b\u5f55Web\u5fae\u4fe1\u540e\uff0cF12\u6253\u5f00\u63a7\u5236\u53f0\uff0c\u6e05\u7a7a\u8bf7\u6c42\u8bb0\u5f55\uff0c\u5fae\u4fe1\u53d1\u9001\u4e00\u6761\u6d88\u606f\u51fa\u53bb\uff0c\u67e5\u770b\u4e0b\u9762\u622a\u56fe\u8fd9\u4e2a\u8bf7\u6c42\u8bb0\u5f55\uff0c\u5c31\u53ef\u4ee5\u6293\u5230\u8fd9\u4e9b\u53c2\u6570\u503c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"392\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVdfwdo\" alt=\"\" title=\"\"><\/p>\n<p>\u7136\u540eCookie\u662f\u65e0\u9700\u4f7f\u7528\u5b8c\u6574\u7684\uff0c\u53ea\u9700\u8981 <code>wxopenid=;<\/code> \u4e4b\u524d\u8fd9\u4e00\u6bb5\u5373\u53ef\u3002<\/p>\n<p><img decoding=\"async\" width=\"707\" height=\"335\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVdfwdp\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<h2>\u4f7f\u7528\u611f\u53d7<\/h2>\n<p>\u7ecf\u8fc7\u4e00\u4e2a\u6708\u4f7f\u7528\uff0c\u5b89\u5168\u7a33\u5b9a\u53ef\u9760\uff0c\u53ea\u8981\u4f60\u7684Web\u5fae\u4fe1\u4e0d\u6389\u7ebf\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u7528\u4e86\uff0c\u53ef\u4ee5\u5c06\u4f60\u7684Web\u5fae\u4fe1\u6302\u5728Windows\u670d\u52a1\u5668\u4e0a\uff0c\u6211\u8bd5\u8fc77\u5929\u4e0d\u6389\u7ebf\u3002<\/p>\n<h2>\u672c\u6587\u4f5c\u8005<\/h2>\n<p>TANKING<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000045605418\">https:\/\/segmentfault.com\/a\/1190000045605418<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6458\u8981 \u5fae\u4fe1\u5b98\u65b9\u662f\u6ca1\u6709\u63d0\u4f9b\u4e2a\u4eba\u5fae\u4fe1\u63a5\u53e3\u7684\uff0c\u5e02\u9762\u4e0a\u7684\u63a5\u53e3\u57fa\u672c\u90fd\u662f\u901a\u8fc7\u4e0d\u6b63\u89c4\u7684\u65b9\u5f0f\u53bb\u5b9e\u73b0\u7684\uff0c\u4f8b\u5982Web\u534f\u8bae\u3001\u5fae\u4fe1HO [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10020499","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10020499"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020499\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10020499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10020499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10020499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}