LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-28-2010, 12:33 PM   #1
sidkdbl07
LQ Newbie
 
Registered: Jul 2003
Posts: 4

Rep: Reputation: 0
wget script question


I'm trying to get to a website that requires a login.

The login page has extra form variables (other than username and password)

Code:
<form name="form1" method="post" action="login.aspx" id="Form1">
  <input type="hidden" name="_VIEWSTATE" id="_VIEWSTATE" value="/sdfsdf......"" />
  <input type="hidden" name="_EVENTVALIDATION" value="/weENTKJJ..." />
  ...
  <input type="text" name="Login_cnttrl$txtUserName" />
  <input type="password" name="Login_cnttrl$txtPassword" />
  ...
  <input type="submit" name="Login_cntrl1$Button1" value="Login"
</form>
The _VIEWSTATE and _EVENTVALIDATION fields change everytime I load the page, so I assume they are important for the login.

When I try the following, the login is not successful:
Code:
wget -O - --save-cookies=cookies.txt --keep-session-cookies --post-data "Login_cnttrl$txtUserName=myUser&Login_cnttrl$txtPassword=myPassword&Login_cntrl1$Button1=Login" http://www.mysite.com
How do I gather the _VIEWSTATE and _EVENTVALIDATION values? I suspect I will need two wget statements, no?
 
Old 10-28-2010, 03:18 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Quote:
Originally Posted by sidkdbl07 View Post
How do I gather the _VIEWSTATE and _EVENTVALIDATION values? I suspect I will need two wget statements, no?
I would worry less about the values and spend more effort on understanding what those values represent. Once you know that, you can create your own at will. It could be a hash of your browser specs, or a coded time stamp for the page issue. Or anything else you can think of. Obviously using old values is not acceptable, so think outside the box ...

P.S. I suppose I ought to add, you would be surprised what passes for "security" sometimes.

Last edited by smoker; 10-28-2010 at 03:20 PM.
 
0 members found this post helpful.
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl Wget Script tarken Programming 4 11-11-2011 07:04 AM
Script to download file using wget linuxnewbie82 Programming 6 02-14-2007 04:48 AM
help making script with wget fakie_flip Programming 6 08-05-2006 11:18 PM
wget html grabbing script linuxhippy Slackware 4 11-25-2005 05:17 PM
script for wget EmOuBi Linux - Software 11 08-02-2005 01:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:31 PM.

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
Open Source Consulting | Domain Registration