bot


SUBMITTED BY: Guest

DATE: June 22, 2016, 3:19 p.m.

FORMAT: Bash

SIZE: 4.4 kB

HITS: 549

  1. #!/bin/bash
  2. if [ `ps -e | grep -c bot.sh` -gt 2 ]; then echo "Already running, i'm killing old process!"; pkill -9 -o chrome; killall -9 chrome; pkill -9 -o chromium; killall -9 chromium; pkill -9 -o chromium-browser; killall -9 chromium-browser; killall -9 Xvfb; pkill -9 -o bot.sh; fi
  3. usage() { echo -e "Usage: $0 -t <Timer to restart chrome (seconds)>] -o \"account,password\" -l <Separate traffic exchange links with space delimiter(in quote)>\nExample: $0 -t 3600 -l http://22hit...\nExample: $0 -t 3600 -l \"http://22hit... http://247webhit... http://...\"\nExample: $0 -t 3600 -o \"otohit_account,otohits_password\" -l \"http://22hit...\"\nExample: $0 -t 3600 -o \"otohit_account,otohits_password\"" 1>&2; exit 1; }
  4. [ $# -eq 0 ] && usage
  5. otolink=""
  6. google=false
  7. while getopts ":ht:l:o:g-:" arg; do
  8. case $arg in
  9. t)
  10. timer=${OPTARG}
  11. ;;
  12. l)
  13. links=${OPTARG}
  14. ;;
  15. o)
  16. IFS=', ' read -r -a otohits <<< ${OPTARG}
  17. otolink="http://www.otohits.net/account/wfautosurf"
  18. ;;
  19. g)
  20. google=true
  21. ;;
  22. h | *)
  23. usage
  24. exit 1
  25. ;;
  26. esac
  27. done
  28. if [ -z "${timer}" ]; then
  29. usage
  30. fi
  31. echo "Checking update Chrome/Chromium and related package..."
  32. echo "Killing old chrome/chromium and virtual X display..."
  33. killall apt-get
  34. killall dpkg
  35. apt-get update
  36. apt-get clean
  37. apt-get autoclean
  38. apt-get autoremove -y
  39. apt-get install -y psmisc lsb-release
  40. pkill -9 -o chrome
  41. killall -9 chrome
  42. pkill -9 -o chromium
  43. killall -9 chromium
  44. pkill -9 -o chromium-browser
  45. killall -9 chromium-browser
  46. killall -9 Xvfb
  47. killall -9 sleep
  48. sync && sysctl -w vm.drop_caches=3
  49. apt-get install -y xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xfonts-cyrillic x11-apps
  50. apt-get install -y gtk2-engines-pixbuf libexif12 libxpm4 libxrender1 libgtk2.0-0
  51. apt-get install -y libnss3 libgconf-2-4
  52. apt-get install -y libxss1 libappindicator1 libindicator7
  53. if $google
  54. then
  55. ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')
  56. wget http://duclvz.github.io/google-chrome-$ARCH.deb -O google-chrome-$ARCH.deb
  57. dpkg -i google-chrome-*.deb
  58. browser="google-chrome"
  59. else
  60. if [[ `lsb_release -si` == "Debian" ]]
  61. then
  62. apt-get install -y chromium
  63. browser="chromium"
  64. fi
  65. if [[ `lsb_release -si` == "Ubuntu" ]]
  66. then
  67. apt-get install -y chromium-browser
  68. browser="chromium-browser"
  69. fi
  70. fi
  71. if [ -z "${browser}" ]; then
  72. echo "Sorry, this script does not support your OS, please use Ubuntu/Debian Linux OS!"
  73. exit 1
  74. fi
  75. #apt-get install -y pepperflashplugin-nonfree
  76. #update-pepperflashplugin-nonfree --install
  77. dpkg --configure -a
  78. apt-get install -f -y
  79. if [[ `lsb_release -rs` == "12.04" ]]
  80. then
  81. apt-get install -y defoma x-ttcidfont-conf
  82. (cd /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType && mkfontdir > fonts.dir)
  83. fi
  84. while :
  85. do
  86. echo "Downloading chrome user data dir profile..."
  87. wget --no-check-certificate http://duclvz.github.io/chromeTE.tar.gz -O /root/chromeTE.tar.gz
  88. echo "Recreating/extracting chrome user data dir..."
  89. rm -fr /root/home/ubuntu/chromeTE/
  90. tar -xzf /root/home/ubuntu/chromeTE.tar.gz -C /root/home/ubuntu/
  91. echo "Starting virtual X display..."
  92. Xvfb :2 -screen 1 1024x768x16 -nolisten tcp & disown
  93. echo "Starting chrome TE viewer..."
  94. echo "Open link $links"
  95. if [ ! -z "${otohits}" ]
  96. then
  97. sed -i "s/otoacc/${otohits[0]}/g" /root/home/ubuntu/chromeTE/Default/Extensions/jikpgdfgobpifoiiojdngpekpacflahh/1.0_0/account.json
  98. sed -i "s/otopass/${otohits[1]}/g" /root/home/ubuntu/chromeTE/Default/Extensions/jikpgdfgobpifoiiojdngpekpacflahh/1.0_0/account.json
  99. fi
  100. DISPLAY=:2.1 ${browser} --no-sandbox --user-data-dir="/root/home/ubuntu/chromeTE" --user-agent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36" --disable-popup-blocking --incognito ${otolink} ${links} & disown
  101. browserPID=$!
  102. sleep ${timer}
  103. timeplus=$(shuf -i 10-100 -n 1)
  104. sleep ${timeplus}
  105. echo "Kill browser PID $browserPID"
  106. kill $browserPID
  107. echo "Killing virtual X display..."
  108. killall -9 Xvfb
  109. echo "Restart TE bots after $((${timer}+${timeplus})) seconds."
  110. done

comments powered by Disqus