LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 03-25-2013, 04:03 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Rep: Reputation: 86
public wifi with login web page


When I connect to a wireless access point, how can software detect that there is a web page interaction required before internet access is available?

In the simple case, I want to launch a notification as a reminder to go finish the access process.

In the complex case, I want to automatically or semi-automatically fill any web forms presented.

While I'm walk-about with my geek-ware, many wireless hotspots present a web page before they grant internet access. Some sites, like hotels, require various authentication details like room number, promo code, etc. Others simply want acknowledgement of terms of service and such and maybe an email address.

Thanks in advance,
~~~ 0;-Dan
 
Old 03-25-2013, 04:20 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
I believe that the mechanism at play is that the access point you are connecting to is making a determination as to whether or not to pass on your traffic (requests) based upon your 'status' in terms of authentication. In other words, it is acting as a router and your MAC, which is used in packets to and from that router, is either approved or not and if it is not approved then (typically port 80) web traffic will be intercepted and you will be HTTP redirected to the proper authentication page.

As far as how you can automatically detect whether or not such a system is in place and automatically respond to them? Good Question, as they seem to rely upon interaction via a webpage that you've been re-directed to. The only thing I can think of is to try a low level connection to a known location, preferably other than port 80, and see if you are able to establish a connection, even then it won't prove reliable and will be based upon their firewall setup.
 
Old 03-25-2013, 05:06 PM   #3
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Quote:
Originally Posted by Noway2 View Post
...
As far as how you can automatically detect whether or not such a system is in place and automatically respond to them? Good Question, as they seem to rely upon interaction via a webpage that you've been re-directed to. The only thing I can think of is to try a low level connection to a known location, preferably other than port 80, and see if you are able to establish a connection, even then it won't prove reliable and will be based upon their firewall setup.
I don't know of cases where other services are involved. My experience is that no connections to anything happen until you try to use your browser, get directed to the hotspot web page, and dance their dance. An example might look like this:
Code:
**  tell network tools to connect to the hotspot
**  use your browser and try to connect to anywhere
**  "magically" you get presented the hotspot web page
**  complete that dance
**  retry your connect to anywhere or other network use
My utility could be set to launch at the end of "network up" processing.
It would then mimic a web browser connection to somewhere.
The returning page is likely to be the hotspot gate keeper.
Scrape that page and try to do something with it.

I am aware of cases where the hotspot page is not automatic. In these cases,
the end-user must associate and authenticate wireless and then separately
connect to a designated page for the forms dance. After success with this dance,
the end-user will be able to use the internet.

Cheers,
~~~ 0;-Dan
 
Old 03-26-2013, 05:01 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
Your reply gave me an idea. How about using something like CURL to try to get to google and then scan the result set for a non google response? You could pattern match om what was returned for certain key words, or html tags. On 'known'(?) or recognized pages, you may be able to then resend a query with the proper GET or POST parameters to pass the login information. The idea of CURL comes from scripts that are used to respond in server-server payment processing.
 
1 members found this post helpful.
Old 03-26-2013, 08:43 PM   #5
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Quote:
Originally Posted by Noway2 View Post
Your reply gave me an idea. How about using something like CURL to try to get to google and then scan the result set for a non google response? You could pattern match om what was returned for certain key words, or html tags. On 'known'(?) or recognized pages, you may be able to then resend a query with the proper GET or POST parameters to pass the login information. The idea of CURL comes from scripts that are used to respond in server-server payment processing.
Your suggestion to use curl is exactly the sort of tool details I was hoping to learn. [I'm old enough to remember writing modem scripts for my olde Hayes modems: If( connect ) then do_something() ]

Now if only someone will arrive and explain the dance in detail.

Cheers,
~~~ 0;-Dan
 
Old 03-26-2013, 08:56 PM   #6
Bratmon
Member
 
Registered: Jul 2009
Location: 75.126.162.205:80
Distribution: Arch / Mint 17
Posts: 297
Blog Entries: 3

Rep: Reputation: 50
Actually, I know one way to do it is to check http://clients1.google.com/generate_204

If anything comes back, it's a login screen.
 
1 members found this post helpful.
Old 03-27-2013, 12:17 PM   #7
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: Austin, TX
Distribution: Mint-15 with Cinnamon & KDE
Posts: 1,368
Blog Entries: 3

Original Poster
Rep: Reputation: 86
Quote:
Originally Posted by Bratmon View Post
Actually, I know one way to do it is to check http://clients1.google.com/generate_204

If anything comes back, it's a login screen.
This offers an interesting approach to discovering that I've got a login screen pending.

Now for the hard part...
Question: Is there an API or Framework or other software that is ready for use that will make it straight forward to screen-scrape
the login screen once I have it available?

Thanks to all,
~~~ 0;-Dan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using nagios to check user login on web page venuwin Linux - Software 5 01-25-2009 08:11 AM
web login page using /etc/passwd database terryyip Linux - Server 1 03-18-2007 08:30 AM
ftp web page login paul_mat Linux - Software 9 11-16-2005 03:13 AM
login attempts to web-page. (time limits) ldp Linux - Security 2 01-20-2005 01:42 PM
Auto login and run firefox at a specific web page eraser Linux - Newbie 4 11-21-2004 06:34 PM


All times are GMT -5. The time now is 01:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration