Tikona broadband auto login from Raspberry pi / linux using shell script

max.4u

And the heavens shall >D
Just thought of sharing this script to automate Tikona login process.
if you are using Raspiberry pi as router, you can set this as startup script to login.

Replace userName & password.

Code:
LoginURL=$(curl 1.254.254.254 | grep -Po 'URL=\K[^"]*')
curl -c cookies2 --sslv3 $LoginURL --insecure
SessionId=$(grep 'JSESSIONID.{0,100}' cookies2 -o -P |rev| awk '{print substr($0,0,38)}'|rev)
curl --data-ascii "type=2&username=[B]<UserName>[/B]&password=[B]<Password>[/B]&act=null" --sslv3 --header "Host: login.tikona.in" --header "Content-Length: 53" --header "Content-Type: application/x-www-form-urlencoded" --cookie "JSESSIONID=$SessionId" *login.tikona.in/userportal/newlogin.do?phone=0

i have not tried this using Cygwin, but it should work on windows as well, note that Curl is also needed when running on windows.
hope some one finds it useful.
 
OP
M

max.4u

And the heavens shall >D
is this for 24Online based login? I got a Rpi 3 and looking to do this...

your login page screenshot would help

hi, my login looks something like this.
Untitled.png
but basically you should be able to modify script to login to 24online url.

for example, we need to send the cookie information & the login details to the login URL.
you can use Fiddler to see what information is being sent while doing a login.

To login to Tikona, i have to do 1.254.254.254. which redirects to *login.tikona.in.
with the cookie got from 1.254.254.254

your login data should be different/simple. All hardwork is done by Curl to get and send data to these URLs. we just have to know what has to be sent and where to do the login.
 

kARTechnology

Sony " VA" "IO"
hi, my login looks something like this.
but basically you should be able to modify script to login to 24online url.

for example, we need to send the cookie information & the login details to the login URL.
you can use Fiddler to see what information is being sent while doing a login.

To login to Tikona, i have to do 1.254.254.254. which redirects to *login.tikona.in.
with the cookie got from 1.254.254.254

your login data should be different/simple. All hardwork is done by Curl to get and send data to these URLs. we just have to know what has to be sent and where to do the login.

I figured it our, made a script for my Pi 3.
#!/bin/bash

### BEGIN INIT INFO
# Provides: 24online
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: 24online script by
# Description: This service is check and reconnect 24online at every 60 seconds pinging 8.8.4.4
### END INIT INFO



check_internet() {
echo checking
ping -qc 1 8.8.4.4 && return 1 || return 0
}


refresh() {
echo refreshing...
curl -k -G -d mode=192 -d username=<yourusername>*172.15.101.1/24online/servlet/E24onlineHTTPClient
}

connect() {
echo connecting...
curl -k -d mode=191 -d username=<yourusername>-d password=<yourpassword>*172.15.101.1/24online/servlet/E24onlineHTTPClient >nul
}

main () {
while [ true ]
do
check_internet
if [ $? == 1 ]
then
refresh
else
connect
fi
sleep 60
done
}

main
 
Top Bottom