hostloc一键获取积分shell脚本——多用户版

zdszf4天前7 次点击

本帖最后由 zdszf 于 2019-5-16 17:26 编辑

hostloc一键获取积分shell脚本————单用户版:https://www.hostloc.com/thread-545329-1-1.html
更新个多用户版,每个账号之间随机sleep 2-5分钟,每次空间访问之间随机sleep 12-21秒,自行按需调整sleep后变量防IP被BAN,目前参数用起来没问题。
  1. #!/usr/bin/env bash
  2. PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
  3. export PATH
  4. # Usage: bash hostloc_mu.sh

  5. declare -A account_list

  6. # user info: change them to your account username and password
  7. account_list=([user1]="password1" [user2]="password2" [user_n]="password_n")

  8. #
  9. UA="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"

  10. # workdir
  11. workdir="/root/hostloc_cookie"
  12. [[ ! -d "$workdir" ]] && mkdir $workdir

  13. function main() {
  14.   account_name=($(echo ${!account_list[*]}))
  15.   account_pswd=($(echo  ${account_list[*]}))

  16.   for ((i=0; i<${#account_list[*]}; i++)); do
  17.     [[ $i -eq 0 ]] && echo && echo $(date) Mission start...
  18.     [[ $i -gt 0 ]] && sleep $(shuf -i 123-321 -n 1)
  19.     username="${account_name[i]}"
  20.     password="${account_pswd[i]}"
  21.        
  22.     echo; echo -n $(date) $username登陆...
  23.     data="mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1&fastloginfield=username&username=$username&cookietime=$(shuf -i 1234567-7654321 -n 1)&password=$password&quickforward=yes&handlekey=ls"
  24.     curl -s -H "$UA" -c $workdir/cookie_$username --data "$data" "https://www.hostloc.com/member.php" | grep -o "www.hostloc.com" && status=0 || status=1
  25.     [[ $status -eq 0 ]] && username_good[i]=${account_name[i]} && echo $(date) 成功
  26.     [[ $status -eq 1 ]] && username_fail[i]=${account_name[i]} && echo && echo $(date) 失败 && continue
  27.        
  28.     echo $(date) 目前积分为:$(curl -s -H "$UA" -b $workdir/cookie_$username "https://www.hostloc.com/home.php?mod=spacecp&ac=credit&op=base" | grep -oE "积分: </em>\w*" | awk -F'[>]' '{print $2}')
  29.        
  30.     echo -n $(date) 访问空间
  31.        
  32.     for((j = 6610; j <= 6630; j++)); do
  33.     echo -n .
  34.     curl -s -H "$UA" -b $workdir/cookie_$username "https://www.hostloc.com/space-uid-$j.html" | grep -o "最近访客" >/dev/null && count[j]=$j
  35.     sleep $(shuf -i 12-21 -n 1) && [[ ${#count[*]} -eq 10 ]] && unset count && break
  36.     done
  37.        
  38.     echo; echo $(date) 完成
  39.        
  40.     echo $(date) 目前积分为:$(curl -s -H "$UA" -b $workdir/cookie_$username "https://www.hostloc.com/home.php?mod=spacecp&ac=credit&op=base" | grep -oE "积分: </em>\w*" | awk -F'[>]' '{print $2}')
  41.   done

  42.   # clean
  43.   rm -rf $workdir

  44.   # status
  45.   [[ -n ${username_fail[*]} ]] && echo && echo $(date) $(echo  ${username_fail[*]}) Login Failed.
  46.   [[ -n ${username_good[*]} ]] && echo && echo $(date) $(echo  ${username_good[*]}) Accomplished.
  47. }

  48. main
复制代码

地址:https://github.com/mixool/script/blob/debian-9/hostloc_mu.sh
最新回复 (21) 直到 2019-05-17 13:01
返回