AutoLogin Script

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Forum Index -> General Questions
Goto page 1, 2, 3  Next
Author Message
navigates
DD-WRT Novice


Joined: 28 Dec 2010
Posts: 20

PostPosted: Sat Jul 23, 2011 2:49    Post subject: AutoLogin Script Reply with quote
My internet requires me to login every two hours. The page opens and requests for a username and password and then click on a submit button. This is not a typical pppoe connection. This for hathway broadband.

I have a netgear router that is ddwrt capable. appreciate your help greatly.
Sponsor
zerobyte
DD-WRT Novice


Joined: 16 Jul 2011
Posts: 13

PostPosted: Wed Jul 27, 2011 13:10    Post subject: Reply with quote
You can use wget to login into this page. Just open the page source and search for the post fields.
e.g:
<input type="password name="password"/>
<input type="text" name="username"/>
...
than use wget to login into the page:
wget -O - --save-cookies /tmp/cookies.txt \
--post-data 'username=foo&password=bar' \
http://your-strange-login-host.com

It will output the target page, so you will know if it worked or not. After that i would add "2>&1 > /dev/null" to the end of the command to suppress output. Just create a simple shellscript and add the command. Then use cron to call the script every 1h or so. You can add cron task with the webgui -> Administration -> Additional Cron Jobs. For a task that gets called every hour use:

Code:

* */1 * * * root /jffs/usr/bin/isp-web-login
shaan7
DD-WRT Novice


Joined: 20 Dec 2011
Posts: 7

PostPosted: Tue Dec 20, 2011 13:33    Post subject: What if I dont have GNU wget Reply with quote
Hi, I use the following commands to login-

wget --keep-session-cookies --save-cookies /tmp/cookies http://reliancebroadband.co.in/reliance/startportal_isg.do?CPURL=null

wget --load-cookies /tmp/cookies --post-data 'userId=user&password=password' http://reliancebroadband.co.in/reliance/login.do?action=doLoginSubmit

But, the busybox wget doesnt support the cookie options Crying or Very sad and I can't use ipkg because it doesn't work properly with my tiny jffs as my router (Linksys E1000) doesn't have enough flash.

Is there any way out?
GeeVee
DD-WRT Novice


Joined: 21 Mar 2012
Posts: 3

PostPosted: Wed Mar 21, 2012 15:23    Post subject: Who has done this (autologon) already for a fon-hotspot ? Reply with quote
I want a router (TL-WR740N) to connect to a fon-hotspot on the WAN-side and use the LAN side only to connect a VOIP equipment.

As there will be no PC to pass the logon screen, I'm exploring the way to get the router autoconnected to the FON-hotspot

Did somebody already do this in the past
Which hardware ? Sample script ?
Thanks to share your experiences
GeeVee
DD-WRT Novice


Joined: 21 Mar 2012
Posts: 3

PostPosted: Wed Sep 12, 2012 21:31    Post subject: So far I got last time (and still blocked) .... Reply with quote
For the fon in belgium (belgacomfon) these commands work from a commandline on a pc connected to the box.
However, I could not manage to get my TL-WR740N box to execute itselves these commands (basically because I couldn't get wget on the TL-WR740N and it has no free memory to store the script on ...)

1/
wget --no-check-certificate --save-cookies=cookie.txt --keep-session-cookies http://www.google.be

2/
wget --no-check-certificate --keep-session-cookies --load-cookies=cookie.txt --post-data="login%5Buser%5D=<uid>@belgacomfon.be&login%5Bpass%5D=<pswd>&commit=Inloggen&login_reminder=on" https://belgacom.portal.fon.com/login/processLogin

(replace <uid> and <pswd>)
Vaako
DD-WRT User


Joined: 10 Jun 2009
Posts: 333

PostPosted: Sat Jan 04, 2014 14:52    Post subject: Reply with quote
I need such script for Telenet Hotspot and Homespot.

Can someone tell me how it's done?

_________________
Regards,
Vaako

1x Netgear R7800 Nighthawk - firmware not decided yet !!!!
1x Netgear R7000 Nighthawk r36410
1x Ubiquiti RouterStation Pro DD-WRT r23204 std (12/24/13)
1x Asus RT-N16 SVN revision 20675 NEWD-2 K2.6
1x Linksys E4200 v3.0 r34777 mega (01/31/18 )
1x Buffalo WZR-HP-G300NH B0 B0 Gargoyle FW
1x Linksys WRT600N v1.1 (Bricked)
1x Linksys WRT54GL v1.1 (DD-WRT 26446)
1x Linksys WRT54GS v2.2 (DD-WRT 26446)
1x Linksys RVS4000 (stock fw)
3x D-Link DWL-7100AP (openWRT)
2x TP-Link TL-WA801ND (Bridge mode) 100mW TX-Power
Asus WL-520GU SVN 16403M NEWD-2 Eko std-nokaid
4x Fonera with Gargoyle FW
dllud
DD-WRT Novice


Joined: 09 Feb 2014
Posts: 4

PostPosted: Sun Feb 09, 2014 2:23    Post subject: Scripts for FON in Portugal (ZON) Reply with quote
GeeVee, thanks for the wget commands. Based upon them I was able to create scripts to auto login in FON in Portugal. They were tested in OpenWRT using the wget package with SSL. wget-nossl or the small wget in BusyBox lack some required options.

The scripts are crafted for hotplug in order to be run when the wireless interface is set up or updated.

For FON_ZON_FREE_INTERNET:
Code:
etc/hotplug.d/iface/99-login-zon

Code:
#!/bin/sh

if [ "$INTERFACE" = "wwan" ] && ([ "$ACTION" = "ifup" ] || [ "$ACTION" = "update" ]); then
   wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies http://search.yacy.net
   POST_URL=$(cat portal.html | grep 'action="https://zon' | cut -d \" -f 4)
   if [ -n "$POST_URL" ]; then
      wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="USERNAME=<your_email>&PASSWORD=<your_pswd>&remember=on" $POST_URL
   fi
   rm cookie portal.html
fi



For FON_FREE_INTERNET (from original FON routers):
Code:
etc/hotplug.d/iface/99-login-fon

Code:
#!/bin/sh

if [ "$INTERFACE" = "wwan" ] && ([ "$ACTION" = "ifup" ] || [ "$ACTION" = "update" ]); then
   wget -qO- --output-document=/dev/null --no-check-certificate --save-cookies=cookie --keep-session-cookies http://search.yacy.net
   wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="login_email=<your_email>&login_password=<your_pswd>&login_reminder=checked" https://www.fon.com/login/gateway/processLoginCustom
   rm cookie
fi
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 131

PostPosted: Tue Mar 18, 2014 0:49    Post subject: Re: Scripts for FON in Portugal (ZON) Reply with quote
dllud wrote:
GeeVee, thanks for the wget commands. Based upon them I was able to create scripts to auto login in FON in Portugal. They were tested in OpenWRT using the wget package with SSL. wget-nossl or the small wget in BusyBox lack some required options.

The scripts are crafted for hotplug in order to be run when the wireless interface is set up or updated.

For FON_ZON_FREE_INTERNET:



Hi.

Im trying to get this script running a fonera 2201 with dd-wrt. But got some issue with wget, a lot of error like this one
" wget: unrecognized option `--no-check-certificate'"

I downloaded some vers for FON atheros based, over open-wrt ipk package repo, but no success at all, what was the version of openwrt did you tested that script ?

Boas, tambem sou tuga, e ando por aqui a ver se consigo por isso a funcionar. qq ajuda agradecia
dllud
DD-WRT Novice


Joined: 09 Feb 2014
Posts: 4

PostPosted: Tue Mar 18, 2014 9:19    Post subject: Re: What if I dont have GNU wget Reply with quote
arssant wrote:
But got some issue with wget, a lot of error like this one
" wget: unrecognized option `--no-check-certificate'"


shaan7 wrote:

the busybox wget doesnt support the cookie options Crying or Very sad


Thus you have to install the full wget using ipkg (DD-WRT) or opkg (OpenWrt).


Last edited by dllud on Fri Mar 21, 2014 8:44; edited 1 time in total
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Tue Mar 18, 2014 23:15    Post subject: Reply with quote
dllud, I'm using a TP-LINK WR841ND router to receive/transmit the Fon Zon signal, and everything is working ok.

Now, of course I'm interested to do the automatic login on FON... but I have some doubts:

Did you use this wget - http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/packages/wget_1.13.4-1_ar71xx.ipk ?
The script is to to be copied in "Administration - Commands" using the webinterface?

I don't want to brick my router.. lol

Thanks in advance and best regards,
P.A (e também sou tuga :p)
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Sun Mar 23, 2014 14:20    Post subject: Reply with quote
UP!!!

Anyone help me?

Best regards,
P.A
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Tue Mar 25, 2014 20:15    Post subject: Reply with quote
Sorry to insist... but no one can give me some help?

regards,
P.A
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 131

PostPosted: Wed Mar 26, 2014 15:29    Post subject: Re: What if I dont have GNU wget Reply with quote
dllud wrote:
arssant wrote:
But got some issue with wget, a lot of error like this one
" wget: unrecognized option `--no-check-certificate'"


shaan7 wrote:

the busybox wget doesnt support the cookie options Crying or Very sad


Thus you have to install the full wget using ipkg (DD-WRT) or opkg (OpenWrt).



Hi.

Success, with fon ZON ( Portugal )
I used a fon2201. Ironical, it was originally provided from FON for ZON ISP customers.

But worked with openwrt backfire 10.03.1.
With dd-wrt got issue, as Buss error when running wget. I tried all packages from openwrt ( kamikase, backfire, even adjustment )
One thing I need to fix, only got firsts 11 channels available, can't get 12,13,14 channel working, even not scanning on client mode. Country regulatory regdomain blocked to USA channel 1-11.


Tanks all of you for this script.
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Fri Mar 28, 2014 20:16    Post subject: Re: What if I dont have GNU wget Reply with quote
arssant wrote:
dllud wrote:
arssant wrote:
But got some issue with wget, a lot of error like this one
" wget: unrecognized option `--no-check-certificate'"


shaan7 wrote:

the busybox wget doesnt support the cookie options Crying or Very sad


Thus you have to install the full wget using ipkg (DD-WRT) or opkg (OpenWrt).



Hi.

Success, with fon ZON ( Portugal )
I used a fon2201. Ironical, it was originally provided from FON for ZON ISP customers.

But worked with openwrt backfire 10.03.1.
With dd-wrt got issue, as Buss error when running wget. I tried all packages from openwrt ( kamikase, backfire, even adjustment )
One thing I need to fix, only got firsts 11 channels available, can't get 12,13,14 channel working, even not scanning on client mode. Country regulatory regdomain blocked to USA channel 1-11.


Tanks all of you for this script.


Hi! Can you please give me some help concerning my previous posts?

Thanks. regards,
P.A
arssant
DD-WRT User


Joined: 14 Aug 2013
Posts: 131

PostPosted: Fri Mar 28, 2014 22:43    Post subject: Re: What if I dont have GNU wget Reply with quote
gandamaluko wrote:

Hi! Can you please give me some help concerning my previous posts?

Thanks. regards,
P.A


Hi,

look at dllud post.

Code:
   
/etc/hotplug.d/iface/99-login-zon


This is the right place for the script.
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum