{"id":48522,"date":"2020-03-09T08:53:01","date_gmt":"2020-03-09T00:53:01","guid":{"rendered":"http:\/\/4563.org\/?p=48522"},"modified":"2020-03-09T08:53:01","modified_gmt":"2020-03-09T00:53:01","slug":"%e5%93%aa%e4%bd%8dpy%e5%a4%a7%e4%bd%ac%e6%8a%8a%e8%ae%ba%e5%9d%9b%e7%ad%be%e5%88%b0%e4%bb%a3%e7%a0%81%e5%8a%a0%e4%b8%aa%e6%97%b6%e9%97%b4%e9%97%b4%e9%9a%94%e5%95%8a","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=48522","title":{"rendered":"\u54ea\u4f4dpy\u5927\u4f6c\u628a\u8bba\u575b\u7b7e\u5230\u4ee3\u7801\u52a0\u4e2a\u65f6\u95f4\u95f4\u9694\u554a"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>bob1987<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u54ea\u4f4dpy\u5927\u4f6c\u628a\u8bba\u575b\u7b7e\u5230\u4ee3\u7801\u52a0\u4e2a\u65f6\u95f4\u95f4\u9694\u554a<\/h3>\n<p>  \t\t\u54ea\u4f4d\u5927\u4f6c\uff0c\u4ee5\u4e0b\u4ee3\u7801\u662f\u76f4\u63a5copy\u51e0\u4f4d\u5927\u4f6c\u7684\uff0c\u4f46\u662f\u8c8c\u4f3c\u6ca1\u6709\u52a0\u591a\u8d26\u53f7\uff0c\u6bcf\u4e2a\u8d26\u53f7\u767b\u5f55\u9886\u53d6\u7684\u65f6\u95f4\u95f4\u9694\u3002<br \/>  \u6240\u4ee5\u8bf7\u5927\u4f6c\u4eec\u52a0\u4e00\u4e2a\u65f6\u95f4\u95f4\u9694\uff0c\u6bd4\u59821\u5206\u949f\uff0c\u6216\u800530\u79d2\u5565\u7684<\/p>\n<p>  \u5b89\u88c5 Python3<\/p>\n<p>  apt-get install python3-pip<br \/>  \u7136\u540e\u5728\u5b9d\u5854\u9762\u677f\u521b\u5efa\u4e00\u4e2a\u540d\u4e3ahostloc.py\u7684\u6587\u4ef6<\/p>\n<p>  \u5728\u6587\u4ef6\u4e2d\u5199\u5165\u4ee5\u4e0b\u4ee3\u7801\uff0c\u5c06\u5176\u4e2d\u7684\u8d26\u53f7A\u66ff\u6362\u6210\u81ea\u5df1\u7684\uff0c\u5bc6\u7801A\u4e5f\u66ff\u6362\u6210\u81ea\u5df1\u7684\u5373\u53ef\uff0c\u591a\u8d26\u53f7\u81ea\u884c\u6dfb\u52a0\uff0c\u6ce8\u610f\u524d\u9762\u7684\u6570\u5b57\u7f16\u53f7\uff1b<\/p>\n<p>  \u6ce8\u610f\uff1a\u4e0d\u8981\u7528\u7535\u8111\u7684TXT\u8bb0\u4e8b\u672c\u7f16\u8f91\uff0c\u907f\u514d\u683c\u5f0f\u51fa\u9519\uff0c\u76f4\u63a5\u5728\u5b9d\u5854\u9762\u677f\u7f16\u8f91\u5373\u53ef\uff1b<\/p>\n<p>  #!\/usr\/bin\/env python<br \/>  # -*- coding: UTF-8 -*-<br \/>  # Author:MoeClub.org<\/p>\n<p>  import re<br \/>  import sys<br \/>  from urllib import request, parse<br \/>  from http import cookiejar<\/p>\n<p>  account_dict = {<br \/>  &nbsp; &nbsp; &#8216;0&#8217;: {&#8216;username&#8217;: &#8216;\u8d26\u53f7A&#8217;, &#8216;password&#8217;: &#8216;\u5bc6\u7801A&#8217;},<br \/>  &nbsp; &nbsp; &#8216;1&#8217;: {&#8216;username&#8217;: &#8216;\u8d26\u6237B&#8217;, &#8216;password&#8217;: &#8216;\u5bc6\u7801B&#8217;},<br \/>  }<\/p>\n<p>  def Login(URL, UserData):<br \/>  &nbsp; &nbsp; _cookies = &#8221;<br \/>  &nbsp; &nbsp; _cookie = cookiejar.CookieJar()<br \/>  &nbsp; &nbsp; _handler = request.HTTPCookieProcessor(_cookie)<br \/>  &nbsp; &nbsp; _req = request.Request(URL, data=parse.urlencode(UserData).encode(&#8216;utf-8&#8217;))<br \/>  &nbsp; &nbsp; request.build_opener(_handler).open(_req)<br \/>  &nbsp; &nbsp; for cookie in _cookie:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;_cookies += cookie.name + &#8216;=&#8217; + cookie.value + &#8216;;&#8217;<br \/>  &nbsp; &nbsp; return _cookies<\/p>\n<p>  def GetPage(URL, Header_Cookies):<br \/>  &nbsp; &nbsp; _Header = {&#8216;Cookie&#8217;: str(Header_Cookies)}<br \/>  &nbsp; &nbsp; _req = request.Request(URL, headers=_Header)<br \/>  &nbsp; &nbsp; return request.urlopen(_req).read().decode(&#8216;utf-8&#8217;)<\/p>\n<p>  def GetCredit(user_data, proto=&#8217;https&#8217;):<br \/>  &nbsp; &nbsp; username = user_data[&#8216;username&#8217;]<br \/>  &nbsp; &nbsp; Login_URL = proto + &#8216;:\/\/www.hostloc.com\/member.php?mod=logging&amp;action=login&amp;loginsubmit=yes&amp;infloat=yes&amp;lssubmit=yes&amp;inajax=1&#8217;<br \/>  &nbsp; &nbsp; My_Credit = proto + &#8216;:\/\/www.hostloc.com\/home.php?mod=spacecp&amp;ac=credit&amp;showcredit=1&amp;inajax=1&#8217;<br \/>  &nbsp; &nbsp; My_Home = proto + &#8216;:\/\/www.hostloc.com\/home.php?mod=spacecp&amp;inajax=1&#8217;<br \/>  &nbsp; &nbsp; My_Cookies = Login(Login_URL, user_data)<\/p>\n<p>  &nbsp; &nbsp; if &#8216;&lt;td&gt;&#8217; + str(username) + &#8216;&lt;\/td&gt;&#8217; not in GetPage(My_Home, My_Cookies):<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;print(&#8216;[%s] Login Fail!&#8217; % username)<br \/>  &nbsp; &nbsp; else:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;try:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;CreditNum0 = str(re.findall(&#8216;+&#8217;, GetPage(My_Credit, My_Cookies))[-1])<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;except:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;CreditNum0 = &#8216;Null&#8217;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;for x in range(25297, 25309):<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;GetPage(proto + &#8216;:\/\/www.hostloc.com\/space-uid-{}.html&#8217;.format(x), My_Cookies)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;try:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if CreditNum0 == &#8216;Null&#8217;:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; raise Exception<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;CreditNum1 = str(re.findall(&#8216;+&#8217;, GetPage(My_Credit, My_Cookies))[-1])<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if CreditNum0 == CreditNum1:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; CreditDetails = str(CreditNum1)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;else:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; CreditDetails = str(CreditNum0) + &#8216;-&gt;&#8217; + str(CreditNum1)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;except:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;CreditDetails = &#8216;Null&#8217;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;print(&#8216;[%s] Login Success! (Credit: %s)&#8217; % (username, CreditDetails))<\/p>\n<p>  if __name__ == &#8216;__main__&#8217;:<br \/>  &nbsp; &nbsp; if len(sys.argv) &gt; 1:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;n = 0<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;account_dict = {}<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;account_list =  for x in range(1, len(sys.argv))]<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;for account in account_list:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if &quot;:&quot; not in account:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; continue<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;account_dict = {}<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;account_dict[&#8216;username&#8217;] = str(str(account).split(&quot;:&quot;, 1))<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;account_dict[&#8216;password&#8217;] = str(str(account).split(&quot;:&quot;, 1)[-1])<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;n += 1<br \/>  &nbsp; &nbsp; for i in range(0, len(account_dict)):<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;try:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;GetCredit(account_dict)<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;except:<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;continue<br \/>  \u521b\u5efa\u81ea\u52a8\u6267\u884c\u7b7e\u5230\u4efb\u52a1\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>cherbim<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u52a0\u4e2atime.sleep\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>bob1987 \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u54ea&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/48522"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=48522"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/48522\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=48522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=48522"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=48522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}