{"id":40417,"date":"2020-02-27T12:00:47","date_gmt":"2020-02-27T04:00:47","guid":{"rendered":"http:\/\/4563.org\/?p=40417"},"modified":"2020-02-27T12:00:47","modified_gmt":"2020-02-27T04:00:47","slug":"%e5%b8%ae%e5%bf%99%e7%9c%8b%e7%9c%8b%e8%bf%99%e4%b8%aaphp%e8%af%a5%e5%92%8b%e6%94%b9","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=40417","title":{"rendered":"\u5e2e\u5fd9\u770b\u770b\u8fd9\u4e2aPHP\u8be5\u548b\u6539"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>\u5168\u7403VPS\u5927\u5b66<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u5e2e\u5fd9\u770b\u770b\u8fd9\u4e2aPHP\u8be5\u548b\u6539<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 \u5168\u7403VPS\u5927\u5b66 \u4e8e 2020-2-27 11:52 \u7f16\u8f91 <\/p>\n<p> \u539f\u8d34\u5730\u5740\uff1ahttps:\/\/www.hostloc.com\/thread-649304-1-1.html<br \/>  \u611f\u8c22@yisuo \u5927\u4f6c\u5e2e\u5fd9\u5199\u7684\u8fd9\u4e2aPHP<br \/>  \u9700\u8981\uff1a\u7528\u8fd9\u4e2aPHP\u53ef\u4ee5\u6279\u91cf\u68c0\u6d4b this.txt\u91cc\u9762\u7684url\u94fe\u63a5\uff0c\u68c0\u6d4b\u5b8c\u4ee5\u540e\u4f1a\u81ea\u52a8\u5220\u9664\u5931\u6548\u7684\u3002<\/p>\n<p>  \u56e0\u4e3a\u8fd9\u4e2ahttp:\/\/127.0.0.1\/api.php?url=\u8fd9\u4e2a\u63a5\u53e3\u6709\u65f6\u95f4\u9650\u5236\uff0c\u6bcf7\u79d2\u53ea\u80fd\u8bbf\u95ee\u4e00\u6b21\u3002<br \/>  \u6240\u4ee5\u60f3\u628a\u8fd9\u4e2aPHP\u6539\u4e00\u4e0b\uff0c\u8ba9\u4ed6\u6bcf7\u79d2\u949f\u6309\u987a\u5e8f\u7528\u63a5\u53e3\u68c0\u6d4bthis.txt\u91cc\u9762\u7684url <br \/>  $url = &#8216;http:\/\/127.0.0.1\/api.php?url=&#8217; . $v; <br \/>  \u5230\u6700\u540e\u4e00\u4e2a\u7ed3\u675f\u505c\u6b62\u3002<br \/>  \u8be5\u600e\u4e48\u6539\u3002\u4e0b\u9762\u662f\u5927\u4f6c\u539f\u6765\u5199\u7684\u3002<\/p>\n<p>  &lt;?php<\/p>\n<p>  $fn = &#8216;this.txt&#8217;;<\/p>\n<p>  set_time_limit(0);<br \/>  $str = @file_get_contents($fn);<br \/>  if($str === false) die(&quot;return false, can&#8217;t get data from the file .&quot;);<br \/>  $array = explode(&quot;rn&quot;,$str);<br \/>  $new_str = &#8221;;<br \/>  foreach($array as $v){<br \/>  &nbsp; &nbsp; if(empty($v)) continue;<br \/>  &nbsp; &nbsp; $url = &#8216;http:\/\/127.0.0.1\/api.php?url=&#8217; . $v;<br \/>  &nbsp; &nbsp; $refer = $url;<br \/>  &nbsp; &nbsp; $ua = &#8216;Mozilla\/5.0 (Windows NT 6.2; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/27.0.1453.94 Safari\/537.36&#8217;;<br \/>  &nbsp; &nbsp; $option = array(&#8216;http&#8217; =&gt; array(&#8216;header&#8217; =&gt; &quot;Referer:$referrn&quot; .<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;user_agent:$uarn&quot;));<br \/>  &nbsp; &nbsp; $json = @file_get_contents($url, false, stream_context_create($option));<br \/>  &nbsp; &nbsp; if($json === false){<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;echo &quot;Error connecting to the url rn&quot;;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;continue;<br \/>  &nbsp; &nbsp; }<br \/>  &nbsp; &nbsp; # {&quot;status&quot;:1,&quot;msg&quot;:&quot;OK&quot;}<br \/>  &nbsp; &nbsp; $json2array = json_decode($json, true);<br \/>  &nbsp; &nbsp; if(empty($json2array[&#8216;status&#8217;])) continue;<br \/>  &nbsp; &nbsp; if($json2array[&#8216;status&#8217;] !== 1) continue;<br \/>  &nbsp; &nbsp; else $new_str .= $v . &quot;rn&quot;;<br \/>  }<br \/>  file_put_contents($fn . &#8216;.1&#8217;, trim($new_str));<br \/>  echo &quot;It is all done&quot;;  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u590d\u4e16\u59ec\u51cc<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tsleep(7)\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5b89\u597d<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5728 for \u91cc\u9762\u52a0\u4e2a sleep(7);\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5168\u7403VPS\u5927\u5b66<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5b89\u597d \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-27 12:05<br \/>  \u5728 for \u91cc\u9762\u52a0\u4e2a sleep(7);<\/p>\n<p> \u52a0\u5728\u54ea\u91cc\u5462\uff0c\u80fd\u4e0d\u80fd\u622a\u4e2a\u4e00\u5c0f\u6bb5\u653e\u5728\u7684\u4f4d\u7f6e\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5b89\u597d<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5168\u7403VPS\u5927\u5b66 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-27 12:08<br \/>  \u52a0\u5728\u54ea\u91cc\u5462\uff0c\u80fd\u4e0d\u80fd\u622a\u4e2a\u4e00\u5c0f\u6bb5\u653e\u5728\u7684\u4f4d\u7f6e<\/p>\n<p> for \u91cc\u9762 \u968f\u4fbf\u54ea\u91cc\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5927\u7c73<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t&lt;?php<\/p>\n<p>  $fn = &#8216;this.txt&#8217;;<\/p>\n<p>  set_time_limit(0);<br \/>  $str = @file_get_contents($fn);<br \/>  if($str === false) die(&quot;return false, can&#8217;t get data from the file .&quot;);<br \/>  $array = explode(&quot;rn&quot;,$str);<br \/>  $new_str = &#8221;;<br \/>  foreach($array as $v){<br \/>  &nbsp; &nbsp; if(empty($v)) continue;<br \/>  &nbsp; &nbsp; $url = &#8216;http:\/\/127.0.0.1\/api.php?url=&#8217; . $v;<br \/>  &nbsp; &nbsp; $refer = $url;<br \/>  &nbsp; &nbsp; $ua = &#8216;Mozilla\/5.0 (Windows NT 6.2; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/27.0.1453.94 Safari\/537.36&#8217;;<br \/>  &nbsp; &nbsp; $option = array(&#8216;http&#8217; =&gt; array(&#8216;header&#8217; =&gt; &quot;Referer:$referrn&quot; .<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&quot;user_agent:$uarn&quot;));<br \/>  &nbsp; &nbsp; $json = @file_get_contents($url, false, stream_context_create($option));<br \/>  sleep(7);<br \/>  &nbsp; &nbsp; if($json === false){<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;echo &quot;Error connecting to the url rn&quot;;<br \/>  &nbsp; &nbsp;&nbsp; &nbsp;continue;<br \/>  &nbsp; &nbsp; }<br \/>  &nbsp; &nbsp; # {&quot;status&quot;:1,&quot;msg&quot;:&quot;OK&quot;}<br \/>  &nbsp; &nbsp; $json2array = json_decode($json, true);<br \/>  &nbsp; &nbsp; if(empty($json2array[&#8216;status&#8217;])) continue;<br \/>  &nbsp; &nbsp; if($json2array[&#8216;status&#8217;] !== 1) continue;<br \/>  &nbsp; &nbsp; else $new_str .= $v . &quot;rn&quot;;<br \/>  }<br \/>  file_put_contents($fn . &#8216;.1&#8217;, trim($new_str));<br \/>  echo &quot;It is all done&quot;;\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5168\u7403VPS\u5927\u5b66<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5b89\u597d \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-27 12:09<br \/>  for \u91cc\u9762 \u968f\u4fbf\u54ea\u91cc<\/p>\n<p> foreach($array as $v){<br \/>  &nbsp; &nbsp; sleep(7);<br \/>  &nbsp; &nbsp; if(empty($v)) continue;<br \/>  &nbsp; &nbsp; $url = &#8216;http:\/\/127.0.0.1\/api.php?url=&#8217; . $v;<br \/>  &nbsp; &nbsp; $refer = $url;<\/p>\n<p>  \u8fd9\u6837\u5c31\u53ef\u4ee5\u4e86\u5417\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u5168\u7403VPS\u5927\u5b66<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u5927\u7c73 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-2-27 12:10<\/p>\n<p> \u8c22\u8c22ok&nbsp; &nbsp;\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5168\u7403VPS\u5927\u5b66 \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u5e2e&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\/40417"}],"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=40417"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/40417\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=40417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40417"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}