AutoLogin Script

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


Joined: 09 Feb 2014
Posts: 4

PostPosted: Sat Jul 16, 2016 22:13    Post subject: Update script for NOS_WIFI Reply with quote
Another update due to changes in the captive portal (login page).

Code:
etc/hotplug.d/iface/98-login-nos

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://duckduckgo.com
   POST_URL=$(cat portal.html | grep 'name="loginNos"' | cut -d \" -f 6 | sed s/amp\;//g)
   if [ -n "$POST_URL" ]; then
      POST_URL='https://captiveportal.nos.pt'$POST_URL
      wget -qO- --output-document=/dev/null --no-check-certificate --load-cookies=cookie --keep-session-cookies --post-data="UserName=NOS/<your_email>&Password=<your_password>&rememberMe=true" $POST_URL
   fi
   rm cookie portal.html
fi
Sponsor
gfc
DD-WRT Novice


Joined: 28 Apr 2017
Posts: 10

PostPosted: Thu Jun 22, 2017 10:31    Post subject: Reply with quote
Hi,

I have a TPLINK WR1043ND with openwrt Chaos Calmer 15.05.1 and theres no hotplug on this version.

Is there an alternative location to insert the code?

If not, is there any way to install OpenWRT Backfire (10.03.1)in TPLINK WR1043ND?

Thank you in advanded.
mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Tue Aug 15, 2017 7:47    Post subject: Reply with quote
I need help for exactly hotspot autologin. I have tp-link 1043 v3.

My hotspot login url like http://xxxxx?user&pass

I can login if I try this url in my safari but wget doesn't work. No cookie support. It doesn't have curl support. How can fix that issue. Thanks.

_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Tue Aug 15, 2017 14:18    Post subject: Reply with quote
I have an idea. If I buy Raspberry Zero Wireless can ı run this on raspberry?

Quote:

#!/bin/sh
testserver="google.com"
ipaddsrc1="​http://xxxxxxxxxxxx/login?username=xxxxxxxx&password=xxxxxxxxx"
ipaddsrc2="​http://xxxxxxxxxx/login?username=xxxxxxxxxxxx&password=xxxxxxxxxxxx"

REACHEABLE=0;

while [ $REACHEABLE -ne "1" ];
do
ping -q -W 5 $testserver &> /dev/null; REACHEABLE=$?;
if [ $REACHEABLE -eq 0 ]
then
echo "Pingable"
else
echo "Not Pingable"
wget -O - --save-cookies /tmp/cookies.txt $ipaddsrc1;
fi

sleep 10

if [ $REACHEABLE -eq 0 ]
then
echo "Pingable"
else
echo "Not Pingable"
wget -O - --save-cookies /tmp/cookies.txt $ipaddsrc2;
REACHEABLE=0;
fi

sleep 10
done

_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Tue Aug 15, 2017 17:43    Post subject: Reply with quote
For my Raspberry Emulator tests, I am able to use wget to login this forum. I will order Raspberry Zero Wireless today. I use only this command to login this forum:

wget -O /tmp/kaan --post-data='username=yourusername&password=yourpassword&login=Log%20in' http://www.dd-wrt.com/phpBB2/login.php

I didn't use cookies. Looks like Raspberry can fix hotspot login issue.

https://www.samm.com/productv/5370/raspberry-pi-zero-wireless.html

_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
mkaand
DD-WRT User


Joined: 06 Jan 2008
Posts: 307
Location: Istanbul

PostPosted: Wed Aug 23, 2017 16:41    Post subject: Reply with quote
I made a tutorial about Auto-Login. IF someone needs they can check:

http://www.dd-wrt.com/phpBB2/viewtopic.php?p=1091714#1091714

I fixed my problem.

_________________
Kaan's World | @mkaand | PLEX Archive | Trakt.tv
gandamaluko
DD-WRT Novice


Joined: 18 Oct 2013
Posts: 10

PostPosted: Tue Aug 25, 2020 12:24    Post subject: Reply with quote
Hi. I know this is an old thread.. but anyone have any script updade for ZON or MEO portuguese providers?

At this moment I have the possibility receive both signals with a Ubiquiti (original firmware) connected to my Archer C7 v2 (OpenWrt 19.07.3 with installed packs:
libustream-openssl + ca-bundle + ca-certificates + zlib + wget - not working with dd-wrt).

When I try to access internet on mobiles/pc using Wi-fi or pc on Lan I'm able make login with success. When the internet goes down I need to do again the login... so I'm interested in this script Smile

Note: Ubiquiti NSM2 LAN1 - connected directly to Archer C7 LAN1

My /etc/config/network for lan:

config interface 'lan'
option type 'bridge'
option ifname 'eth1.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.1.20'
list dns '192.168.1.20'

I need to change the [ "$INTERFACE" = "wwan" ] to [ "$INTERFACE" = "lan wwan" ]???

Tested on NOS:

root@OpenWrt: wget -qO- --output-document=portal.html --no-check-certificate --save-cookies=cookie --keep-session-cookies http://duckduckgo.com
This creates file portal.html

grep:
root@OpenWrt: grep 'action="/nos' portal.html | cut -d \" -f 6 | sed -r 's/\&amp;/\&/g'

gave me this output:(I changed values of hmac/challenge/nasid/mac)

/noswifi?hmac=1111111111111111111111111111111111111111111111111111111111111111&res=notyet&uamip=192.168.3.1&uamport=80&userurl=&challenge=22222222222222222222222222222222&nasid=XX-XX-XX-XX-XX-XX&mac=YY-YY-YY-YY-YY-YY

This is the correct format? If yes, what command I need to test it with success?

Thanks in advance and best regards, P.A
msoengineer
DD-WRT Guru


Joined: 21 Jan 2017
Posts: 1782
Location: Illinois Moderator

PostPosted: Tue Aug 25, 2020 16:03    Post subject: Reply with quote
Locking this thread for non DD-WRT reasons.
_________________
FORUM RULES

TIPS/TRICKS: Best QCA Wifi Settings | Latency tricks | QoS Port priority | NEVER USE MU-MIMO |
Why to NOT use MU-MIMO | Max Wifi Pwr by Country | Linux Wifi Pwr | AC MCS & AX MCS | QCA 5Ghz chnls to use | WIFI Freq WIKI | TFTP R7800 | Don't buy AX | IPERF3 How-To

[R9000]52396 nightly (Main Router)
[EA8500]43192 & 45493 (2xOffsite)
[R7800] resting
[WDR3600]BS 44715 (Offsite)
[A7v5]BS 43038 (Offsite+spare napping)
Goto page Previous  1, 2, 3 Display posts from previous:    Page 3 of 3
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT 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