羊毛之家

这里总有一款属于你的菜

hostloc刷分脚本php多用户版

原来的网页版脚本不能用了,今天找到了大佬提供的 php 多用户版本,大家请食用。

1.把下面脚本保存为.php文件放在服务器内

  1. <?php
  2. $useList = array(
  3. //用户名/密码可添加多行
  4. 'username'=>'passwd',
  5. 'username'=>'passwd',
  6. 'username'=>'passwd',
  7. );
  8. header("Content-Type: text/html; charset=utf-8");
  9. foreach($useList as $k=>$v){
  10. locSign($k,$v);
  11. }
  12. function locSign($use,$pwd){
  13. $html = http_post('https://www.<a href="https://www.4uvm.com/tag/hostloc" title="查看更多关于 hostloc 的文章" target="_blank">hostloc</a>.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1','fastloginfield=username&username='.urlencode($use).'&cookietime=2592000&password='.urlencode($pwd).'&quickforward=yes&handlekey=ls');
  14. if(!strrpos($html,'window.location.href')){echo $use.' login error<br>';return false;}
  15. $cookie = getCookie($html,'Set-Cookie: ',';');
  16. for($i=26200; $i<=26230; $i++){ //访问空间 id 可改变 建议多于 10 次,因为有可能访问到封号或者删号的空间
  17. $html = http_get("https://www.hostloc.com/space-uid-{$i}.html",$cookie);
  18. }
  19. echo $use.' Sign ok!!!<br>';
  20. }
  21. function http_get($url,$cookie) {
  22. $ch = curl_init($url);
  23. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  24. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  25. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  26. curl_setopt($ch, CURLOPT_HTTPHEADER,array('User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0','Referer: https://www.hostloc.com/forum-45-1.html','Cookie: '.$cookie));
  27. curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  28. $src = curl_exec($ch);
  29. curl_close($ch);
  30. return $src;
  31. }
  32. function http_post($url,$body){
  33. $ch = curl_init();
  34. curl_setopt($ch, CURLOPT_URL,$url);
  35. curl_setopt($ch, CURLOPT_HEADER, 1);
  36. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  37. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
  38. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  39. curl_setopt($ch, CURLOPT_HTTPHEADER,array('User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0','Referer: https://www.hostloc.com/forum.php'));
  40. curl_setopt($ch, CURLOPT_POST, 1);
  41. curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
  42. $result = curl_exec($ch);
  43. curl_close($ch);
  44. return $result;
  45. }
  46. function getCookie($str,$leftStr,$rightStr){
  47. if(strrpos($str,$leftStr) == false || strrpos($str,$rightStr) == false){return '';}
  48. $arr1 = explode($leftStr,$str);$i = 0;$cookie = '';
  49. foreach($arr1 as $k=>$v){$i++;if($i > 1){$arr2 = explode($rightStr,$v);$cookie .= $arr2[0].'; ';}}
  50. return $cookie;
  51. }

安装宝塔的朋友可以在计划任务里添加

设定每天访问一次脚本即可。

免责声明:内容均来自网络或网友投稿,如有侵权请联系管理员,我们会第一时间为您处理!谢谢您的合作!

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址