Advertisement
Guest User

s4m3l0

a guest
Dec 2nd, 2012
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.00 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. utime=`echo ICT-7 > /etc/TZ`
  4.  
  5. sleep 10
  6.  
  7. trueusername='username'
  8. truepassword='password'
  9. trueyourmac='AA-BB-CC-00-11-22'
  10. wlanip='xxx.xxx.xxx.xxx'
  11. nasip='xxx.xxx.xxx.xxx'
  12. VLAN='eth/x/x/x:xxx.xxx'
  13.  
  14. logout=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --insecure "https://portal.trueinternet.co.th/wifiauthen/logout_result.php"`
  15.  
  16. parameter=$(curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --location --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --insecure 'https://portal.trueinternet.co.th/wifiauthen/internet.co.th/wifiauthen/login.do?wlanuserip=$wlanip&nasip=$nasip&wlanparameter=$trueyourma c &VLAN=$VLAN' | grep param= | sed -e 's/.*param=//' -e 's/\".*>//)
  17.  
  18. login=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --location --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt  --insecure "https://portal.trueinternet.co.th/wifiauthen/web/wifi-login.php?param=$parameter"`
  19.  
  20. log_in=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --referer "https://portal.trueinternet.co.th/wifiauthen/login.php" --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --data "username=$trueusername&password=$truepassword&param=$parameter" --insecure "https://portal.trueinternet.co.th/wifiauthen/login_result.php"`
  21.  
  22. sleep 5
  23.  
  24. while [ 1 ]; do
  25.  
  26. up=`curl www.google.com | grep ' WISPAccessGatewayParam'` #check web external site
  27. if [ -z "$up" ]; then
  28.  
  29. ip=`wget -O /tmp/ip.txt http://automation.whatismyip.com/n09230945.asp`
  30. extip=`cat /tmp/ip.txt`
  31.  
  32. # synctime to avoid crontab time missing
  33. sync=`ntpdate ntp.ubuntu.com`
  34.  
  35. sleep 10500 # delay for 175 minute which is default truewifi disconnect every 180 minute
  36.  
  37. logout=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --insecure "https://portal.trueinternet.co.th/wifiauthen/logout_result.php"`
  38.  
  39. logouter=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --connect-timeout 5 --location --insecure --data "param=$parameter" 'https://portal.trueinternet.co.th/wifiauthen/web/wifi-logout-success.php?param=$parameter'`
  40.  
  41. parameter=$(curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --location --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --insecure 'https://portal.trueinternet.co.th/wifiauthen/internet.co.th/wifiauthen/login.do?wlanuserip=$wlanip&nasip=$nasip&wlanparameter=$trueyourmac&VLAN=$VLAN' | grep param= | sed -e 's/.*param=//' -e 's/\".*>//)
  42.  
  43. login=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --location --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt  --insecure "https://portal.trueinternet.co.th/wifiauthen/web/wifi-login.php?param=$parameter"`
  44.  
  45. log_in=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --referer "https://portal.trueinternet.co.th/wifiauthen/login.php" --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --data "username=$trueusername&password=$truepassword&param=$parameter" --insecure "https://portal.trueinternet.co.th/wifiauthen/login_result.php"`
  46.  
  47. else
  48.  
  49. logout=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --insecure "https://portal.trueinternet.co.th/wifiauthen/logout_result.php"`
  50.  
  51. logouter=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --connect-timeout 5 --location --insecure --data "param=$parameter" 'https://portal.trueinternet.co.th/wifiauthen/web/wifi-logout-success.php?param=$parameter'`
  52.  
  53. parameter=$(curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --location --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --insecure 'https://portal.trueinternet.co.th/wifiauthen/internet.co.th/wifiauthen/login.do?wlanuserip=$wlanip&nasip=$nasip&wlanparameter=$trueyourmac&VLAN=$VLAN' | grep param= | sed -e 's/.*param=//' -e 's/\".*>//)
  54.  
  55. login=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --location --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt  --insecure "https://portal.trueinternet.co.th/wifiauthen/web/wifi-login.php?param=$parameter"`
  56.  
  57. log_in=`curl --user-agent "Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" --referer "https://portal.trueinternet.co.th/wifiauthen/login.php" --cookie /tmp/cookiejar.txt --cookie-jar /tmp/cookiejar.txt --data "username=$trueusername&password=$truepassword&param=$parameter" --insecure "https://portal.trueinternet.co.th/wifiauthen/login_result.php"`
  58.  
  59. fi
  60.  
  61. sleep 2
  62. rm /tmp/cookiejar.txt
  63. rm /tmp/ip.txt
  64.  
  65. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement