Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Using curl to authenticate on a public wireless network

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
dequeued
n00b
n00b
Posts: 19
Joined: Tue Oct 16, 2007 12:02 am
Location: NYC

Using curl to authenticate on a public wireless network

  • Quote

Post by dequeued » Tue Oct 16, 2007 12:34 am

This is a compound question that I hope someone can help with.

My school has an open wireless network, which, once you associate with it, firewalls all traffic, except for port 80 which uses a transparent proxy to redirect you to an https page where you enter your school userid and password, in order to be able to get access to the network.

What I wanted to do -- and I am sure it's possible, is run curl as soon as my computer associates with the school's network, and make a POST to the login server.
That way I could be online by the time xdm starts.

I can think of a few clumsy ways to do this, but I wanted your input on how the most elegant way to do this would be.

1. How would I run an external script when my wireless device associated with a specific ssid.
Can I do that from /etc/init.d/net? If not is there some kind of Daemon that can do certain actions when a connection is made under certain circumstances?

2. I looked through the html form code, and I didn't see any unique tokens or session data that would require me to fetch and process the login page, so I am assuming that I can just submit the same https form data over and over to authenticate.
Does anyone have any experience with this?
What would be the best way to capture http post data?
I could use a packet sniffer, or try to extrapolate it by dissecting the html form, but it feels like there should be an easier way to do this, especially for more complex forms, perhaps some firefox plugin I don't know about?


This may also apply to authenticating on any number of access points at coffee houses or businesses which require you to see a user agreement before use.

Cheers.
Top
no_hope
Guru
Guru
User avatar
Posts: 482
Joined: Mon Jun 23, 2003 8:50 pm

Re: Using curl to authenticate on a public wireless network

  • Quote

Post by no_hope » Tue Oct 16, 2007 8:14 pm

What you are trying to do will create a new security risk and you shouldn't do it.

With that out of the way, here are my 2 cents.
dequeued wrote:firewalls all traffic, except for port 80
Most likely DNS is not firewalled either. If you are hardcore,and have a little free time, you could come up with a way to piggyback all your traffic to DNS packets :)
dequeued wrote:1. How would I run an external script when my wireless device associated with a specific ssid.
you could use the postup function (see /etc/conf.d/net.example) or write a new gentoo init script (you'll want to use the depend function, see /etc/init.d/ for examples)

I think the easiest way to achieve what you want would be to use www-client/lynx and dev-tcltk/expect. lynx is a text-mode browser and expect is a "tool for automating interactive applications". The basic idea is to use lynx to authenticate once and then use expect to replay the keystrokes you used.

If you emerge expect with the doc useflag, you'll have autoexpect script installed in /usr/share/expect-XXX. Run it and a new shell will be started. run lynx and authenticate, quit lynx and the new shell. You should get the expect script to authenticate. It will require some modification to work reliably, but format is pretty simple.

The downside of the above approach is that it requires you to store your password in clear text. What you really should do is steal authenticated MAC addresses.
Top
Post Reply

2 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic