[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

wget and captcha puzzle !!!

Dear list,

My internet provider provides an online form accessed by local IP (the connection
is based on eth); so that the subscriber can provide username and password to activate
the login; additionally it also has a captcha as added security. I am trying to make a 
daemon which just do the login and activate the connection. Within the source of the
form the captcha link embedded as     src="";
And the long string at end changes everytime I reload the form.

Anyways I can read the captcha code with



#extract the captcha string like captcha.phtml?r=72eb74eb980688ae730dbb9cb7d6a5d8

cap_string=`cat index.php | grep src=\"captcha.phtml | cut -f 10 -d '"'`

wget$cap_string -O /tmp/captcha.png

gocr /tmp/captcha.png 
And it really do the tricks, reading the captcha :-)

Though sending the same code through wget along-with username and password doesn't work.

wget --post-date 'username=xxx&password=xxx&captcha_code=<retrieved_code>'


If I visit the url
again and again; every time I get a new captcha. So when I submitting the captcha
by wget; it is already changes to a new one !!!! How can I overcome this puzzle ?
The form (through browser) gives a failure notice when captcha code doesn't match. Is it possible to collect
the failure notice through wget somehow for debugging ?

Please give me some clue. I just like my linux script do the login and activate internet.

Reply to: