[Wylug-help] Fw: Automate Web logins

James Holden wylug at jamesholden.net
Sat Jun 26 20:41:40 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Idris Fulat wrote:
| This is a multi-part message in MIME format. -- [ Picked text/plain
| from multipart/alternative ]
|
| Thanks for the response Smylers, but I'm begining to think that this
| may a bit out of my league. I am a total linux newbie and too used to
| GUI oriented stuff. Also I haven't done anything to do with Perl so
| it is a bit alien. Your wget option seems easy enough and I'll Google
| into it as the web page is basic i.e. username and password and
| submit. Unfortunately I can't fix a time to get my teeth in as I have
| alot of other tasks to fulfill at work and so play around with these
| things in 'spare' time. We have 3 Linux kiosks for public net access
| and want to automate the login process. Like I said I'll look into
| what you mentioned next week and take it from there. If I don't try I
| won't learn. I may also nudge Dave to see what he has:) Thanks.
[snip]

Idris,

(Sorry for the crumminess in replying, I've been a bit busy lately!)

The problem's a bit more complicated than you think, but not *that*
complicated.

The username and password need sending via a HTTP POST request, so you
could use 'lynx' to send the form data via it's -post_data option.

The login page I guess you're think of, however, has a unique number in
it every time it's issued to nobble people trying to do what you're
trying to do.

You'd need to:

1) Grab a fresh copy of the login page.
2) Search the page for the unique ID, which is somewhere as a hidden
form field, eg: <input type="hidden" name="whatever" value="123456789">
and store the value in a variable
3) Send the values to the script via a POST request through lynx.
Something like:
echo -e "username=foo\npassword=bar\nuniqueid=$id\n---\n" | lynx -dump
http://server/script

IIRC there's also a cookie involved.

James






- --
James Andrew Holden, Leeds, UK    (james at jamesholden dot net)
GPG Key: 1024D/8358863A    *Please encrypt mail where possible!*
Fingerprint:  32C9 A76F 3CFE A06C 1B00  5AAB 9877 4742 8358 863A
jamesholden.net ICQ: 11290827 >Buy Linux CDs from fastdiscs.com<
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA3dFzmHdHQoNYhjoRAjwnAJ9f8Skkgcwn8UJVKaLmfxZgC/HqjACgjohb
TN+Lsc+OHoE61TE+jxqk32I=
=4cDE
-----END PGP SIGNATURE-----




More information about the Wylug-help mailing list