Script to disconnect Linksys WRT54G wireless router on Windows

Script to disconnect Linksys WRT54G wireless router on Windows

am 19.11.2007 18:15:15 von wilson

Is there an existing wireless router linksys WRT54G script out there that
will run from Windows XP and hit the 'connect' & 'disconnect' button?

For example, I'd like to disconnect my wireless router (firmware 1.02.0) by
clicking on a single shortcut to replace the multiple button presses today.

That shortcut would (perhaps using wget or some other idea):
1. Connect to the wireless router IP address (https://192.168.0.1)
2. Log in with a blank username & enter 'letmein' as the password
3. Navigate to the "Status -> Router" Linksys WRT54G web page
4. Press the "Login Status = Disconnect" button

A similar shortcut would reconnect on demand.

Is "wget" the best way to accomplish this?

I can't believe I'm the first person to need this so some kind wireless guy
must have done this already. I googled for "linksys wrt54g connect script"
and found something called "slackware" in addition to "wget" but I'm not a
programmer so I would like to start with an existing script that does
SOMETHING like hit any button on the Linksys WRT54G router. Once I have
that, I can probably modify that program to do what I want.

I did find http://www.seattlewireless.net/index.cgi/LinksysWrt54g
interesting but I did not understand most of the detail (I have a lot to
learn).

Does anyone have a script that runs on windows that will connect to
https://192.168.x.y to then hit a button on the Linksys WRT54G router?

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 19.11.2007 18:41:48 von jack

Hi
Routers are propriety devices there is No one universal way to control them.
As a result you cab expect Windows as an OS to be programmed to control
every Independent 3rd party device.
If it really important you can learn simple scripting, or pay some one to do
it.
If you just want to disconnect a computer from the Router you can use the
IPCONFOG /release command.
http://www.ezlan.net/iprel.html
Jack (MVP-Networking).

"Wilson" wrote in message
news:Dwj0j.46096$eY.45009@newssvr13.news.prodigy.net...
> Is there an existing wireless router linksys WRT54G script out there that
> will run from Windows XP and hit the 'connect' & 'disconnect' button?
>
> For example, I'd like to disconnect my wireless router (firmware 1.02.0)
> by
> clicking on a single shortcut to replace the multiple button presses
> today.
>
> That shortcut would (perhaps using wget or some other idea):
> 1. Connect to the wireless router IP address (https://192.168.0.1)
> 2. Log in with a blank username & enter 'letmein' as the password
> 3. Navigate to the "Status -> Router" Linksys WRT54G web page
> 4. Press the "Login Status = Disconnect" button
>
> A similar shortcut would reconnect on demand.
>
> Is "wget" the best way to accomplish this?
>
> I can't believe I'm the first person to need this so some kind wireless
> guy
> must have done this already. I googled for "linksys wrt54g connect script"
> and found something called "slackware" in addition to "wget" but I'm not a
> programmer so I would like to start with an existing script that does
> SOMETHING like hit any button on the Linksys WRT54G router. Once I have
> that, I can probably modify that program to do what I want.
>
> I did find http://www.seattlewireless.net/index.cgi/LinksysWrt54g
> interesting but I did not understand most of the detail (I have a lot to
> learn).
>
> Does anyone have a script that runs on windows that will connect to
> https://192.168.x.y to then hit a button on the Linksys WRT54G router?

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 19.11.2007 19:01:16 von Jeff Liebermann

Wilson hath wroth:

>Is there an existing wireless router linksys WRT54G script out there that
>will run from Windows XP and hit the 'connect' & 'disconnect' button?

Sure. There are several Windoze "automation" tools. The one I like
to use is the ancient "Macro Recorder" from Windoze 3.1. However, I'm
not going to recommend this because of its age.

More modern incantations can be found at:
($23)


and so on. Search Google for "macro recorder" or "keystroke mouse
recorder". Lots to choose from.

You start the recorder, do whatever it takes with your mouse and
keyboard, stop the recorder when done, and save the macro. If you
want to repeat it again, just run the macro. Simple.

Another way to do this is to install DD-WRT or OpenWRT on your WRT54G,
and use various shell or expect scripts to turn the router on and off.
The command to turn on/off the WAN connection could be:
ifconfig eth1 up
ifconfig eth1 down
or something like that.



--
Jeff Liebermann jeffl@cruzio.com
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 20.11.2007 18:57:45 von wilson

On Mon, 19 Nov 2007 12:41:48 -0500, Jack (MVP-Networking). wrote:
> If you just want to disconnect a computer from the Router you can use the
> IPCONFOG /release command.
>> Does anyone have a script that runs on windows that will connect to
>> https://192.168.x.y to then hit a button on the Linksys WRT54G router?

Hi Jack,
I want to disconnect the router from the isp (not the pc from the router).
I dug some more and have some perl scripts (whatever perl is) and will see
if they will run on Windows.

Apparently they need to know the name of the Linksys WRT54G button. I
viewed the page source at https://192.168.1.0/StaRouter.htm and I think
that the button is called "connect" and then "disconnect".

I'll keep digging and asking questions and posting the answers as I find
them until we have a Linksys WRT54G script that runs from Windows to
a) Log into the Linksys WRT54G router
b) Navigate to the https://10.2.18.20/StaRouter.htm page
c) Press the disconnect button
d) Wait five or ten seconds
e) Press the connect button

This refreshes with a new IP address.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 20.11.2007 19:01:10 von wilson

On Mon, 19 Nov 2007 10:01:16 -0800, Jeff Liebermann wrote:
> Another way to do this is to install DD-WRT or OpenWRT on your WRT54G,
> and use various shell or expect scripts to turn the router on and off.
> The command to turn on/off the WAN connection could be:
> ifconfig eth1 up
> ifconfig eth1 down

Hi Jeff,
I know from googling that you are a God on this here newsgroup so I
appreciate your help even if I'm not quite sure how to install "DD-WRT".

I'll look it up and hopfully post an answer so the next guy can press a
button to log into the Linksys WRT54G router, navigate to the status router
page, press the disconnect button, wait five seconds, press the connect
button.

This will automatically get a new IP address (at least in my setup it does
when I do this manually).

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 20.11.2007 19:44:35 von wilson

On Mon, 19 Nov 2007 10:01:16 -0800, Jeff Liebermann wrote:
> Another way to do this is to install DD-WRT or OpenWRT on your WRT54G,
> and use various shell or expect scripts to turn the router on and off.

Hi Jeff,
Do you think this perl script modified to hit the disconnect & connect
button will work? I'm googling for just how I would change the script
below.

So far, I see the following changes needed:
1. I will google to see how to give the "null" set (blank?) as a login
2. I need to figure out how to press the disconnect button

Before I dig further, is this script below a good place to start in order
to create a Windows script that disconnects the Linksys WRT54G wireless
router from the ISP from a wireless portable PC client?

Wilson

#!/usr/bin/perl -w
use strict;

# check out this documentation:
# first, the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# oh but this is JUST what we want
# http://lwp.interglacial.com/ch05_05.htm

my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $user='root';
my $pass='letmein';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from
# looking at the page source.
# DD-WRT puts out a complicated page with Javascript that
# I don't understand how to deal with, so this doesn't work,
# but in principle (if I knew what to put in for action and reboot)
# it should.
my $req = HTTP::Request->new(POST => $adr,
['action','reboot']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);


# print the result
print $result->as_string;

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 20.11.2007 20:01:29 von wilson

Bearing in mind I don't know perl, in the previous perl script to press the
disconnect button on the Linksys WRT54G router ... do these changes seem
correct to you perl programmers?
-----
1. Log in from Windows to the Linksys WRT54G router with a blank username
and a password of "letmein".
INSTEAD OF:
> my $user='root';
> my $pass='letmein';
I WOULD USE:
my $user='';
$pass='letmein';
-----
2. Navigate to the Linksys WRT54G "Status -> Router" web page.
INSTEAD OF:
> my $adr='https://192.168.0.1/Services.asp'; # talk to this
I WOULD USE:
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this
-----
3. Press the disconnect button on that Status->Router web page.
INSTEAD OF:
> my $req = HTTP::Request->new(POST => $adr,
> ['action','reboot']);
I WOULD USE:
my $req = HTTP::Request->new(POST => $adr,
['action','disconnect']);
-----
4. Reconnect after a period of time, say 5 seconds.
INSTEAD OF:
my $req = HTTP::Request->new(POST => $adr,
['action','disconnect']);
I WOULD USE:
my $req = HTTP::Request->new(POST => $adr,
----- ['action','connect']);
Since I don't know perl (nor even how to run perl on Windows XP), I wish to
ask before trying to see if the approach seems like it will work for you.

Meanwhile, I'll try to get the script to work (so far, when I click on my
modified script, see below, it just brings up Notepad).

Wilson


#!/usr/bin/perl -w
use strict;

# check out this documentation:
# first, the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# oh but this is JUST what we want
# http://lwp.interglacial.com/ch05_05.htm

# my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this
my $user='';
# my $pass='mypassword';
my $pass='letmein';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from
# looking at the page source.
# DD-WRT puts out a complicated page with Javascript that
# I don't understand how to deal with, so this doesn't work,
# but in principle (if I knew what to put in for action and reboot)
# it should.
# my $req = HTTP::Request->new(POST => $adr,
# ['action','reboot']);
my $req = HTTP::Request->new(POST => $adr,
['action','disconnect']);

# I need to figure out how to wait 5 seconds in perl; then reconnect

my $req = HTTP::Request->new(POST => $adr,
['action','connect']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);


# print the result
print $result->as_string;

# The end of a perl script to run on Windows to tell the Linksys WRT54G
# router to disconnect from the ISP; then after 5 seconds, to reconnect.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 20.11.2007 20:01:29 von wilson

Bearing in mind I don't know perl, in the previous perl script to press the
disconnect button on the Linksys WRT54G router ... do these changes seem
correct to you perl programmers?
-----
1. Log in from Windows to the Linksys WRT54G router with a blank username
and a password of "letmein".
INSTEAD OF:
> my $user='root';
> my $pass='letmein';
I WOULD USE:
my $user='';
$pass='letmein';
-----
2. Navigate to the Linksys WRT54G "Status -> Router" web page.
INSTEAD OF:
> my $adr='https://192.168.0.1/Services.asp'; # talk to this
I WOULD USE:
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this
-----
3. Press the disconnect button on that Status->Router web page.
INSTEAD OF:
> my $req = HTTP::Request->new(POST => $adr,
> ['action','reboot']);
I WOULD USE:
my $req = HTTP::Request->new(POST => $adr,
['action','disconnect']);
-----
4. Reconnect after a period of time, say 5 seconds.
INSTEAD OF:
my $req = HTTP::Request->new(POST => $adr,
['action','disconnect']);
I WOULD USE:
my $req = HTTP::Request->new(POST => $adr,
----- ['action','connect']);
Since I don't know perl (nor even how to run perl on Windows XP), I wish to
ask before trying to see if the approach seems like it will work for you.

Meanwhile, I'll try to get the script to work (so far, when I click on my
modified script, see below, it just brings up Notepad).

Wilson


#!/usr/bin/perl -w
use strict;

# check out this documentation:
# first, the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# oh but this is JUST what we want
# http://lwp.interglacial.com/ch05_05.htm

# my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this
my $user='';
# my $pass='mypassword';
my $pass='letmein';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from
# looking at the page source.
# DD-WRT puts out a complicated page with Javascript that
# I don't understand how to deal with, so this doesn't work,
# but in principle (if I knew what to put in for action and reboot)
# it should.
# my $req = HTTP::Request->new(POST => $adr,
# ['action','reboot']);
my $req = HTTP::Request->new(POST => $adr,
['action','disconnect']);

# I need to figure out how to wait 5 seconds in perl; then reconnect

my $req = HTTP::Request->new(POST => $adr,
['action','connect']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);


# print the result
print $result->as_string;

# The end of a perl script to run on Windows to tell the Linksys WRT54G
# router to disconnect from the ISP; then after 5 seconds, to reconnect.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 02:35:08 von wilson

It's not working yet - but it's closer than it was
Here is the tutorial so far.

STEP 1:
Install ActiveState activeperl freeware on Windows XP
http://www.activestate.com/Products/activeperl

STEP 2:
Modify script to use YOUR password for your Linksys WRT54G router review

STEP 3:
Run script

At this point, I get the following error.
I will google for this package and see if I can find it on the web.

501 Protocol scheme 'https' is not supported (Crypt::SSLeay not installed)
Content-Type: text/plain
Client-Date: Wed, 21 Nov 2007 01:22:38 GMT
Client-Warning: Internal response

LWP will support https URLs if the Crypt::SSLeay module is installed.
More information at .

Wilson


#!/usr/bin/perl -w
use strict;
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this
# my $user='root';
my $user=''; # the Linksys WRT54G wireless router doesn't have login name
my $pass='letmein';
# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
# make a request object
# fill in the button name and value from
# looking at the page source.
my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);
sleep 5;
my $req = HTTP::Request->new(POST => $adr, ['action','connect']);
$req->authorization_basic($user, $pass);
# send the request
my $result = $ua->request($req);
# print the result
print $result->as_string;
# The end of a perl script to run on Windows to tell the Linksys WRT54G
# router to disconnect from the ISP; then after 5 seconds, to reconnect.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 02:35:08 von wilson

It's not working yet - but it's closer than it was
Here is the tutorial so far.

STEP 1:
Install ActiveState activeperl freeware on Windows XP
http://www.activestate.com/Products/activeperl

STEP 2:
Modify script to use YOUR password for your Linksys WRT54G router review

STEP 3:
Run script

At this point, I get the following error.
I will google for this package and see if I can find it on the web.

501 Protocol scheme 'https' is not supported (Crypt::SSLeay not installed)
Content-Type: text/plain
Client-Date: Wed, 21 Nov 2007 01:22:38 GMT
Client-Warning: Internal response

LWP will support https URLs if the Crypt::SSLeay module is installed.
More information at .

Wilson


#!/usr/bin/perl -w
use strict;
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this
# my $user='root';
my $user=''; # the Linksys WRT54G wireless router doesn't have login name
my $pass='letmein';
# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
# make a request object
# fill in the button name and value from
# looking at the page source.
my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);
sleep 5;
my $req = HTTP::Request->new(POST => $adr, ['action','connect']);
$req->authorization_basic($user, $pass);
# send the request
my $result = $ua->request($req);
# print the result
print $result->as_string;
# The end of a perl script to run on Windows to tell the Linksys WRT54G
# router to disconnect from the ISP; then after 5 seconds, to reconnect.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 03:00:43 von wilson

Here is my tutorial to press buttons on your router from the Windows
command line.

It's not working yet because I don't know how to modify the perl script to
load the Win32 OpenSSL package I installed in order to talk to https web
site.

Does anyone know what line to add to the script below in order to load the
Win32 OpenSSL freeware?

Wilson



----------------------------------------------------------
How to command your router from the Windows command line:
----------------------------------------------------------
0. Install ActiveState activeperl freeware on Windows XP
http://www.activestate.com/Products/activeperl
----------------------------------------------------------
1. Install Win32 OpenSSL freeware support for https URLs
http://www.openssl.org/related/binaries.html
------------------------------------------------------------
2. Add the following line to the perl script to load openssl
???? what is the line needed to load Win32 OpenSSL????
------------------------------------------------------------
3. Modify the script to press desired buttons on your router


#!/usr/bin/perl -w
use strict;

# Linksys WRT54G Router automation button pressing script
# Read the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# Read the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# Read this too
# http://lwp.interglacial.com/ch05_05.htm

# my $adr='https://192.168.0.1/Services.asp'; # talk to this router
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this router

# my $user='root';
my $user=''; # the Linksys WRT54G wireless router doesn't have login name
my $pass='letmein';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from looking at the page source.
# my $req = HTTP::Request->new(POST => $adr, ['action','reboot']);
#
# A view source on the browser web page seems to indicate the disconnect
# button is named "disconnect" so I'll substitute that instead of "reboot".
my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);

# Wait five seconds and then run the next command
sleep 5;

my $req = HTTP::Request->new(POST => $adr, ['action','connect']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);

# print the result
print $result->as_string;

# The end of a perl script to run on Windows to tell the Linksys WRT54G
# router to disconnect from the ISP; then after 5 seconds, to reconnect.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 03:00:43 von wilson

Here is my tutorial to press buttons on your router from the Windows
command line.

It's not working yet because I don't know how to modify the perl script to
load the Win32 OpenSSL package I installed in order to talk to https web
site.

Does anyone know what line to add to the script below in order to load the
Win32 OpenSSL freeware?

Wilson



----------------------------------------------------------
How to command your router from the Windows command line:
----------------------------------------------------------
0. Install ActiveState activeperl freeware on Windows XP
http://www.activestate.com/Products/activeperl
----------------------------------------------------------
1. Install Win32 OpenSSL freeware support for https URLs
http://www.openssl.org/related/binaries.html
------------------------------------------------------------
2. Add the following line to the perl script to load openssl
???? what is the line needed to load Win32 OpenSSL????
------------------------------------------------------------
3. Modify the script to press desired buttons on your router


#!/usr/bin/perl -w
use strict;

# Linksys WRT54G Router automation button pressing script
# Read the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# Read the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# Read this too
# http://lwp.interglacial.com/ch05_05.htm

# my $adr='https://192.168.0.1/Services.asp'; # talk to this router
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this router

# my $user='root';
my $user=''; # the Linksys WRT54G wireless router doesn't have login name
my $pass='letmein';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from looking at the page source.
# my $req = HTTP::Request->new(POST => $adr, ['action','reboot']);
#
# A view source on the browser web page seems to indicate the disconnect
# button is named "disconnect" so I'll substitute that instead of "reboot".
my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);

# Wait five seconds and then run the next command
sleep 5;

my $req = HTTP::Request->new(POST => $adr, ['action','connect']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);

# print the result
print $result->as_string;

# The end of a perl script to run on Windows to tell the Linksys WRT54G
# router to disconnect from the ISP; then after 5 seconds, to reconnect.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 03:08:41 von Ben Morrow

Quoth Wilson :
> It's not working yet - but it's closer than it was
> Here is the tutorial so far.
>
> STEP 1:
> Install ActiveState activeperl freeware on Windows XP
> http://www.activestate.com/Products/activeperl
>
> STEP 2:
> Modify script to use YOUR password for your Linksys WRT54G router review
>
> STEP 3:
> Run script
>
> At this point, I get the following error.
> I will google for this package and see if I can find it on the web.
>
> 501 Protocol scheme 'https' is not supported (Crypt::SSLeay not installed)

Under ActivePerl you can install Crypt::SSLeay with

C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

> #!/usr/bin/perl -w
> use strict;

use warnings;

is better than -w nowadays.

> my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this
> # my $user='root';
> my $user=''; # the Linksys WRT54G wireless router doesn't have login name
> my $pass='letmein';
> # make a User Agent
> use LWP::UserAgent;
> my $ua = LWP::UserAgent->new;
> # make a request object
> # fill in the button name and value from
> # looking at the page source.
> my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);

Huh? You surely want to do something with this request, like submit it
to $ua?

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 03:08:41 von Ben Morrow

Quoth Wilson :
> It's not working yet - but it's closer than it was
> Here is the tutorial so far.
>
> STEP 1:
> Install ActiveState activeperl freeware on Windows XP
> http://www.activestate.com/Products/activeperl
>
> STEP 2:
> Modify script to use YOUR password for your Linksys WRT54G router review
>
> STEP 3:
> Run script
>
> At this point, I get the following error.
> I will google for this package and see if I can find it on the web.
>
> 501 Protocol scheme 'https' is not supported (Crypt::SSLeay not installed)

Under ActivePerl you can install Crypt::SSLeay with

C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

> #!/usr/bin/perl -w
> use strict;

use warnings;

is better than -w nowadays.

> my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this
> # my $user='root';
> my $user=''; # the Linksys WRT54G wireless router doesn't have login name
> my $pass='letmein';
> # make a User Agent
> use LWP::UserAgent;
> my $ua = LWP::UserAgent->new;
> # make a request object
> # fill in the button name and value from
> # looking at the page source.
> my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);

Huh? You surely want to do something with this request, like submit it
to $ua?

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 06:30:44 von wilson

On Wed, 21 Nov 2007 02:08:41 +0000, Ben Morrow wrote:
> Under ActivePerl you can install Crypt::SSLeay with
> C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

Hi Ben,
Your suggestion is very helpful as I was clueless as to the next step.

I hope to write up a short tutorial to help others, so, in the spirit of
the tutorial, here is the output from your suggested "ppm" command
(whatever that is)...

I'm not sure what I just did, but a lot happened when I ran:
C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

See below for the log file.
Wilson



Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd
Syncing site PPM database with .packlists...done
Downloading Crypt-SSLeay-0.53...done
Unpacking Crypt-SSLeay-0.53...done
Generating HTML for Crypt-SSLeay-0.53...done
Updating files in site area...done
Downloading Crypt-SSLeay-0.53 install script...done
Running Crypt-SSLeay-0.53 install script...
************************************************************ **************
This software package uses strong cryptography, so even if it is created,
maintained and distributed from countries where it is legal to do this,
it falls under certain export/import and/or use restrictions in some
other parts of the world.

PLEASE REMEMBER THAT EXPORT/IMPORT AND/OR USE OF STRONG CRYPTOGRAPHY
SOFTWARE, PROVIDING CRYPTOGRAPHY HOOKS OR EVEN JUST COMMUNICATING
TECHNICAL DETAILS ABOUT CRYPTOGRAPHY SOFTWARE IS ILLEGAL IN SOME PARTS
OF THE WORLD. SO, WHEN YOU IMPORT THIS PACKAGE TO YOUR COUNTRY,
RE-DISTRIBUTE IT FROM THERE OR EVEN JUST EMAIL TECHNICAL SUGGESTIONS
OR EVEN SOURCE PATCHES TO THE AUTHOR OR OTHER PEOPLE YOU ARE STRONGLY
ADVISED TO PAY CLOSE ATTENTION TO ANY EXPORT/IMPORT AND/OR USE LAWS
WHICH APPLY TO YOU. THE AUTHORS OF OPENSSL ARE NOT LIABLE FOR ANY
VIOLATIONS YOU MAKE HERE. SO BE CAREFUL, IT IS YOUR RESPONSIBILITY.

CREDIT INFORMATION: This product includes cryptographic software
written by Eric A. Young (eay@cryptsoft.com). This product
includes software written by Tim J. Hudson (tjh@cryptsoft.com).
************************************************************ **************

Proceed with installation? [yes]

A copy of the needed library ssleay32.dll was found in
C:\WINDOWS\system32\ssleay32.dll.
If this is compatible with the version (0.9.8a)
used to compile the Perl module, all that is needed to
complete the installation is to ensure
C:\WINDOWS\system32\ssleay32.dll is in your PATH environment variable.

Fetch ssleay32.dll? [no]
Aborting download of ssleay32.dll.
done
13 files installed

C:\>

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 06:30:44 von wilson

On Wed, 21 Nov 2007 02:08:41 +0000, Ben Morrow wrote:
> Under ActivePerl you can install Crypt::SSLeay with
> C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

Hi Ben,
Your suggestion is very helpful as I was clueless as to the next step.

I hope to write up a short tutorial to help others, so, in the spirit of
the tutorial, here is the output from your suggested "ppm" command
(whatever that is)...

I'm not sure what I just did, but a lot happened when I ran:
C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

See below for the log file.
Wilson



Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd
Syncing site PPM database with .packlists...done
Downloading Crypt-SSLeay-0.53...done
Unpacking Crypt-SSLeay-0.53...done
Generating HTML for Crypt-SSLeay-0.53...done
Updating files in site area...done
Downloading Crypt-SSLeay-0.53 install script...done
Running Crypt-SSLeay-0.53 install script...
************************************************************ **************
This software package uses strong cryptography, so even if it is created,
maintained and distributed from countries where it is legal to do this,
it falls under certain export/import and/or use restrictions in some
other parts of the world.

PLEASE REMEMBER THAT EXPORT/IMPORT AND/OR USE OF STRONG CRYPTOGRAPHY
SOFTWARE, PROVIDING CRYPTOGRAPHY HOOKS OR EVEN JUST COMMUNICATING
TECHNICAL DETAILS ABOUT CRYPTOGRAPHY SOFTWARE IS ILLEGAL IN SOME PARTS
OF THE WORLD. SO, WHEN YOU IMPORT THIS PACKAGE TO YOUR COUNTRY,
RE-DISTRIBUTE IT FROM THERE OR EVEN JUST EMAIL TECHNICAL SUGGESTIONS
OR EVEN SOURCE PATCHES TO THE AUTHOR OR OTHER PEOPLE YOU ARE STRONGLY
ADVISED TO PAY CLOSE ATTENTION TO ANY EXPORT/IMPORT AND/OR USE LAWS
WHICH APPLY TO YOU. THE AUTHORS OF OPENSSL ARE NOT LIABLE FOR ANY
VIOLATIONS YOU MAKE HERE. SO BE CAREFUL, IT IS YOUR RESPONSIBILITY.

CREDIT INFORMATION: This product includes cryptographic software
written by Eric A. Young (eay@cryptsoft.com). This product
includes software written by Tim J. Hudson (tjh@cryptsoft.com).
************************************************************ **************

Proceed with installation? [yes]

A copy of the needed library ssleay32.dll was found in
C:\WINDOWS\system32\ssleay32.dll.
If this is compatible with the version (0.9.8a)
used to compile the Perl module, all that is needed to
complete the installation is to ensure
C:\WINDOWS\system32\ssleay32.dll is in your PATH environment variable.

Fetch ssleay32.dll? [no]
Aborting download of ssleay32.dll.
done
13 files installed

C:\>

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 06:52:24 von wilson

On Wed, 21 Nov 2007 02:08:41 +0000, Ben Morrow wrote:
>> my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);
> Huh? You surely want to do something with this request, like submit it
> to $ua?

Hi Ben,
I'm pretty confused about this part as I do not know Perl.

The original script I found googling did a "reboot" of the router.

I modified that original script to attempt to do a "disconnect" and then
five seconds later to do a "connect" (assuming I have the name of the
buttons correct for the Linksys WRT54G wireless router).

Here is the original script, in its entirety.
Does this original script perform "something" with the request?

Wilson


#!/usr/bin/perl -w
use strict;

# check out this documentation:
# first, the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# oh but this is JUST what we want
# http://lwp.interglacial.com/ch05_05.htm

my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $user='root';
my $pass='mypasswd';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from
# looking at the page source.
# DD-WRT puts out a complicated page with Javascript that
# I don't understand how to deal with, so this doesn't work,
# but in principle (if I knew what to put in for action and reboot)
# it should.
my $req = HTTP::Request->new(POST => $adr,
['action','reboot']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);


# print the result
print $result->as_string;

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 06:52:24 von wilson

On Wed, 21 Nov 2007 02:08:41 +0000, Ben Morrow wrote:
>> my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);
> Huh? You surely want to do something with this request, like submit it
> to $ua?

Hi Ben,
I'm pretty confused about this part as I do not know Perl.

The original script I found googling did a "reboot" of the router.

I modified that original script to attempt to do a "disconnect" and then
five seconds later to do a "connect" (assuming I have the name of the
buttons correct for the Linksys WRT54G wireless router).

Here is the original script, in its entirety.
Does this original script perform "something" with the request?

Wilson


#!/usr/bin/perl -w
use strict;

# check out this documentation:
# first, the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# oh but this is JUST what we want
# http://lwp.interglacial.com/ch05_05.htm

my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $user='root';
my $pass='mypasswd';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from
# looking at the page source.
# DD-WRT puts out a complicated page with Javascript that
# I don't understand how to deal with, so this doesn't work,
# but in principle (if I knew what to put in for action and reboot)
# it should.
my $req = HTTP::Request->new(POST => $adr,
['action','reboot']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);


# print the result
print $result->as_string;

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 07:33:30 von wilson

Well, I didn't get any results back yet and it's still not working but I'll
keep trying things .....

C:\freeware\perl>router.pl
500 Server closed connection without sending any data back
Content-Type: text/plain
Client-Date: Wed, 21 Nov 2007 06:10:15 GMT
Client-Warning: Internal response

500 Server closed connection without sending any data back

Here is the tutorial so far ....... (note it doesn't work yet) ......
All I'm trying to do is disconnect and reconnect using a command line
script.

Any and all help for this tutorial is appreciated as this is my very first
perl program ever.

Wilson

------------------------------------------------------------ -----
How to control your wireless router from the Windows command line
------------------------------------------------------------ -----
0. Obtain the basic Perl script to reboot the Linksys WRT54G:
(see sample Perl script below)
------------------------------------------------------------ -----
1. Install ActiveState activeperl freeware on Windows XP:
http://www.activestate.com/Products/activeperl

For example, install the msi file into c:\freeware\activeperl
------------------------------------------------------------ -----
2. Install "Crypt::SSLeay" under ActivePerl using ppm commands:
c:\> cd c:\freeware\activeperl
c:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd
------------------------------------------------------------ -----
3. Install Win32 OpenSSL freeware support for https URLs
http://www.openssl.org/related/binaries.html

For example, install into c:\freeware\activeperl\win32openssl
------------------------------------------------------------ -----
4. Make sure both Perl is in your Windows PATH shell variable:
Start » Settings » Control Panel » System » Advanced »
Environment Variables » System variables » Path
------------------------------------------------------------ -----
5. Test Win32 OpenSSL on Windows from the command line:
c:\> openssl version [hit Enter]
c:\> openssl s_client -connect www.openssl.org:443 [hit Enter]
GET / HTTP/1.0 [hit Enter twice]
------------------------------------------------------------ -----
6. Modify this script to press desired buttons on your router
#!/usr/bin/perl -w
use strict;

# check out this documentation:
# first, the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# oh but this is JUST what we want
# http://lwp.interglacial.com/ch05_05.htm

my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $user='root';
my $pass='mypasswd';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from
# looking at the page source.
# DD-WRT puts out a complicated page with Javascript that
# I don't understand how to deal with, so this doesn't work,
# but in principle (if I knew what to put in for action and reboot)
# it should.
my $req = HTTP::Request->new(POST => $adr,
['action','reboot']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);


# print the result
print $result->as_string;
------------------------------------------------------------ -----
7. Here is a modified script intended to disconnect & reconnect:

#!/usr/bin/perl
use strict;
use warnings;

# check out this documentation:
# first, the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# oh but this is JUST what we want
# http://lwp.interglacial.com/ch05_05.htm

# my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this

# my $user='root';
my $user=''; # the Linksys WRT54G wireless router doesn't have login name

# my $pass='mypassword';
my $pass='letmein';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from
# looking at the page source.
# DD-WRT puts out a complicated page with Javascript that
# I don't understand how to deal with, so this doesn't work,
# but in principle (if I knew what to put in for action and reboot)
# it should.
# my $req = HTTP::Request->new(POST => $adr,
# ['action','reboot']);
# A view source on the browser web page seems to indicate the disconnect
# button is named "disconnect" so I'll substitute that instead of "reboot".
my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);

# Wait 5 seconds - then reconnect as this will get you a new IP address
sleep 5;

my $req = HTTP::Request->new(POST => $adr, ['action','connect']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);

# print the result
print $result->as_string;

# The end of a perl script to run on Windows to tell the Linksys WRT54G
# router to disconnect from the ISP; then after 5 seconds, to reconnect.
------------------------------------------------------------ -----
------------------------------------------------------------ -----

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 07:33:30 von wilson

Well, I didn't get any results back yet and it's still not working but I'll
keep trying things .....

C:\freeware\perl>router.pl
500 Server closed connection without sending any data back
Content-Type: text/plain
Client-Date: Wed, 21 Nov 2007 06:10:15 GMT
Client-Warning: Internal response

500 Server closed connection without sending any data back

Here is the tutorial so far ....... (note it doesn't work yet) ......
All I'm trying to do is disconnect and reconnect using a command line
script.

Any and all help for this tutorial is appreciated as this is my very first
perl program ever.

Wilson

------------------------------------------------------------ -----
How to control your wireless router from the Windows command line
------------------------------------------------------------ -----
0. Obtain the basic Perl script to reboot the Linksys WRT54G:
(see sample Perl script below)
------------------------------------------------------------ -----
1. Install ActiveState activeperl freeware on Windows XP:
http://www.activestate.com/Products/activeperl

For example, install the msi file into c:\freeware\activeperl
------------------------------------------------------------ -----
2. Install "Crypt::SSLeay" under ActivePerl using ppm commands:
c:\> cd c:\freeware\activeperl
c:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd
------------------------------------------------------------ -----
3. Install Win32 OpenSSL freeware support for https URLs
http://www.openssl.org/related/binaries.html

For example, install into c:\freeware\activeperl\win32openssl
------------------------------------------------------------ -----
4. Make sure both Perl is in your Windows PATH shell variable:
Start » Settings » Control Panel » System » Advanced »
Environment Variables » System variables » Path
------------------------------------------------------------ -----
5. Test Win32 OpenSSL on Windows from the command line:
c:\> openssl version [hit Enter]
c:\> openssl s_client -connect www.openssl.org:443 [hit Enter]
GET / HTTP/1.0 [hit Enter twice]
------------------------------------------------------------ -----
6. Modify this script to press desired buttons on your router
#!/usr/bin/perl -w
use strict;

# check out this documentation:
# first, the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# oh but this is JUST what we want
# http://lwp.interglacial.com/ch05_05.htm

my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $user='root';
my $pass='mypasswd';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from
# looking at the page source.
# DD-WRT puts out a complicated page with Javascript that
# I don't understand how to deal with, so this doesn't work,
# but in principle (if I knew what to put in for action and reboot)
# it should.
my $req = HTTP::Request->new(POST => $adr,
['action','reboot']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);


# print the result
print $result->as_string;
------------------------------------------------------------ -----
7. Here is a modified script intended to disconnect & reconnect:

#!/usr/bin/perl
use strict;
use warnings;

# check out this documentation:
# first, the cookbook
# http://search.cpan.org/~gaas/libwww-perl-5.805/lwpcook.pod
# the LWP reference
# http://search.cpan.org/~gaas/libwww-perl-5.805/lib/LWP.pm
# oh but this is JUST what we want
# http://lwp.interglacial.com/ch05_05.htm

# my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this

# my $user='root';
my $user=''; # the Linksys WRT54G wireless router doesn't have login name

# my $pass='mypassword';
my $pass='letmein';

# make a User Agent
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

# make a request object
# fill in the button name and value from
# looking at the page source.
# DD-WRT puts out a complicated page with Javascript that
# I don't understand how to deal with, so this doesn't work,
# but in principle (if I knew what to put in for action and reboot)
# it should.
# my $req = HTTP::Request->new(POST => $adr,
# ['action','reboot']);
# A view source on the browser web page seems to indicate the disconnect
# button is named "disconnect" so I'll substitute that instead of "reboot".
my $req = HTTP::Request->new(POST => $adr, ['action','disconnect']);

# Wait 5 seconds - then reconnect as this will get you a new IP address
sleep 5;

my $req = HTTP::Request->new(POST => $adr, ['action','connect']);

$req->authorization_basic($user, $pass);

# send the request
my $result = $ua->request($req);

# print the result
print $result->as_string;

# The end of a perl script to run on Windows to tell the Linksys WRT54G
# router to disconnect from the ISP; then after 5 seconds, to reconnect.
------------------------------------------------------------ -----
------------------------------------------------------------ -----

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 14:05:42 von wilson

Any idea how to debug this shortened freeware Perl script to disconnect the
Linksys WRT54G wireless router from the ISP? The Perl script just hangs
without any output or change in the router. Is there a way to insert debug
statements or to step through the Perl code using freeware debuggers on
Windows?

Here is, I think, the related "view -> source" code on the router at the
web page: https://192.168.0.1/StaRouter.htm

function ConnStats(obj)
{
var F=document.status;
if(flag == 1){
F.action.value="Connect";
}
else{
F.action.value="Disconnect";
}
F.submit();
}

And, here is the shortened perl script using "Disconnect" as the action:
#!/usr/bin/perl -w
use strict;
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this router
# my $user='root';
my $user=''; # the Linksys WRT54G wireless router doesn't have a username
my $pass='LetMeIn';
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(POST => $adr, ['action','Disconnect']);
$req->authorization_basic($user, $pass);
# send the request
my $result = $ua->request($req);
# print the result
print $result->as_string;
# The end

Unfortunately, when I run this router.pl script on Windows, it just hangs.
Do you have any suggestions for debugging this on Windows?

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 14:05:42 von wilson

Any idea how to debug this shortened freeware Perl script to disconnect the
Linksys WRT54G wireless router from the ISP? The Perl script just hangs
without any output or change in the router. Is there a way to insert debug
statements or to step through the Perl code using freeware debuggers on
Windows?

Here is, I think, the related "view -> source" code on the router at the
web page: https://192.168.0.1/StaRouter.htm

function ConnStats(obj)
{
var F=document.status;
if(flag == 1){
F.action.value="Connect";
}
else{
F.action.value="Disconnect";
}
F.submit();
}

And, here is the shortened perl script using "Disconnect" as the action:
#!/usr/bin/perl -w
use strict;
my $adr='https://192.168.0.1/StaRouter.htm'; # talk to this router
# my $user='root';
my $user=''; # the Linksys WRT54G wireless router doesn't have a username
my $pass='LetMeIn';
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(POST => $adr, ['action','Disconnect']);
$req->authorization_basic($user, $pass);
# send the request
my $result = $ua->request($req);
# print the result
print $result->as_string;
# The end

Unfortunately, when I run this router.pl script on Windows, it just hangs.
Do you have any suggestions for debugging this on Windows?

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 14:51:38 von wilson

I thought the script hung but it just took a while to output this.

500 read failed:
Content-Type: text/plain
Client-Date: Wed, 21 Nov 2007 13:32:50 GMT
Client-Warning: Internal response

500 read failed:


Do you have any suggestions for debugging freeware WIndows perl scripts?

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 14:51:38 von wilson

I thought the script hung but it just took a while to output this.

500 read failed:
Content-Type: text/plain
Client-Date: Wed, 21 Nov 2007 13:32:50 GMT
Client-Warning: Internal response

500 read failed:


Do you have any suggestions for debugging freeware WIndows perl scripts?

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 18:29:14 von Ben Morrow

[f'ups to clpm]

Quoth Wilson :
> On Wed, 21 Nov 2007 02:08:41 +0000, Ben Morrow wrote:
> > Under ActivePerl you can install Crypt::SSLeay with
> > C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd
>
> I hope to write up a short tutorial to help others, so, in the spirit of
> the tutorial, here is the output from your suggested "ppm" command
> (whatever that is)...

'ppm' stands for 'Perl package manager'; it is a utility which comes
with ActivePerl for installing Perl modules. If you run it with simply
'ppm' you'll get a GUI you can use to locate and install modules.

The reason for the complete URL (rather than simply 'ppm install
Crypt-SSLeay') is that ActiveState's repositry is located in Canada, so
they aren't allowed to provide cryptographic software without a license.
theoryx.uwinnipeg.ca is an alternative repositry which contains the
crypto modules most people need.

> I'm not sure what I just did, but a lot happened when I ran:
> C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

Everything seems to have happened as it should. You can test it has
installed correctly with

perl -MCrypt::SSLeay -e1

which should give no output.

> A copy of the needed library ssleay32.dll was found in
> C:\WINDOWS\system32\ssleay32.dll.
> If this is compatible with the version (0.9.8a)
> used to compile the Perl module, all that is needed to
> complete the installation is to ensure
> C:\WINDOWS\system32\ssleay32.dll is in your PATH environment variable.

This is saying you already have ssleay32.dll on your system. If you want
to use this copy instead of downloading a new one, you need to be sure
it is the correct version (0.9.8a), which you can probably check from
the Properties window in Explorer, and you need to be sure it is in your
PATH so perl can find it (system32 is already in your PATH, of course).

> Fetch ssleay32.dll? [no]
> Aborting download of ssleay32.dll.

Here ppm is offering to install a new copy of ssleay32.dll; since you
already have one, the default answer is no. Had you said 'yes' it would
have downloaded a new copy and put it somewhere perl could find it.

> done
> 13 files installed

The installation was successful.

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 18:29:14 von Ben Morrow

[f'ups to clpm]

Quoth Wilson :
> On Wed, 21 Nov 2007 02:08:41 +0000, Ben Morrow wrote:
> > Under ActivePerl you can install Crypt::SSLeay with
> > C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd
>
> I hope to write up a short tutorial to help others, so, in the spirit of
> the tutorial, here is the output from your suggested "ppm" command
> (whatever that is)...

'ppm' stands for 'Perl package manager'; it is a utility which comes
with ActivePerl for installing Perl modules. If you run it with simply
'ppm' you'll get a GUI you can use to locate and install modules.

The reason for the complete URL (rather than simply 'ppm install
Crypt-SSLeay') is that ActiveState's repositry is located in Canada, so
they aren't allowed to provide cryptographic software without a license.
theoryx.uwinnipeg.ca is an alternative repositry which contains the
crypto modules most people need.

> I'm not sure what I just did, but a lot happened when I ran:
> C:\> ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

Everything seems to have happened as it should. You can test it has
installed correctly with

perl -MCrypt::SSLeay -e1

which should give no output.

> A copy of the needed library ssleay32.dll was found in
> C:\WINDOWS\system32\ssleay32.dll.
> If this is compatible with the version (0.9.8a)
> used to compile the Perl module, all that is needed to
> complete the installation is to ensure
> C:\WINDOWS\system32\ssleay32.dll is in your PATH environment variable.

This is saying you already have ssleay32.dll on your system. If you want
to use this copy instead of downloading a new one, you need to be sure
it is the correct version (0.9.8a), which you can probably check from
the Properties window in Explorer, and you need to be sure it is in your
PATH so perl can find it (system32 is already in your PATH, of course).

> Fetch ssleay32.dll? [no]
> Aborting download of ssleay32.dll.

Here ppm is offering to install a new copy of ssleay32.dll; since you
already have one, the default answer is no. Had you said 'yes' it would
have downloaded a new copy and put it somewhere perl could find it.

> done
> 13 files installed

The installation was successful.

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 21.11.2007 18:45:18 von Jeff Liebermann

Wilson hath wroth:

>On Mon, 19 Nov 2007 10:01:16 -0800, Jeff Liebermann wrote:
>> Another way to do this is to install DD-WRT or OpenWRT on your WRT54G,
>> and use various shell or expect scripts to turn the router on and off.
>> The command to turn on/off the WAN connection could be:
>> ifconfig eth1 up
>> ifconfig eth1 down
>
>Hi Jeff,
>I know from googling that you are a God on this here newsgroup so I
>appreciate your help even if I'm not quite sure how to install "DD-WRT".

How to install DD-WRT:

Note that there are different firmware images and proceedures for the
various WRT54G hardware versions. You didn't specify yours. Check
the serial number label.

>I'll look it up and hopfully post an answer so the next guy can press a
>button to log into the Linksys WRT54G router, navigate to the status router
>page, press the disconnect button, wait five seconds, press the connect
>button.

I believe I suggested a method using a "macro recorder".

>This will automatically get a new IP address (at least in my setup it does
>when I do this manually).

Maybe. Most ISP's don't work that way. If you disconnect, the next
time you reconnect, you'll probably get the same IP address. That's
to keep their log files sane. Notable exceptions are the ISP's that
change IP addresses to discourage setting up servers.

I question why you would need to change IP's? If this is some
variation on trying to become anonymous or hidden while on the
internet, you're on your own.

I'm not a Perl programmer, so I can't help you learn Perl via usenet.

--
Jeff Liebermann jeffl@cruzio.com
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 22.11.2007 12:11:13 von wilson

I think I'm going to have to give up as there just seems to be no way that
any perl script can press any button on a linksys WRT54G router based on
all my hundreds of failed attempts and the lack of any successful perl
scripts on the Internet.

Advice for the next guy: Be forewarned; you can't press a button on a
Linksys WRT65G router using Perl. Some other approach might work; but not
Perl.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 22.11.2007 12:11:13 von wilson

I think I'm going to have to give up as there just seems to be no way that
any perl script can press any button on a linksys WRT54G router based on
all my hundreds of failed attempts and the lack of any successful perl
scripts on the Internet.

Advice for the next guy: Be forewarned; you can't press a button on a
Linksys WRT65G router using Perl. Some other approach might work; but not
Perl.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 22.11.2007 14:27:27 von Sherm Pendley

Wilson writes:

> I think I'm going to have to give up as there just seems to be no way that
> any perl script can press any button on a linksys WRT54G router based on
> all my hundreds of failed attempts and the lack of any successful perl
> scripts on the Internet.
>
> Advice for the next guy: Be forewarned; you can't press a button on a
> Linksys WRT65G router using Perl. Some other approach might work; but not
> Perl.

What nonsense. You said yourself that you're not a programmer and don't know
Perl - what makes you think that something is impossible simply because *you*
can't figure it out?

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 22.11.2007 14:27:27 von Sherm Pendley

Wilson writes:

> I think I'm going to have to give up as there just seems to be no way that
> any perl script can press any button on a linksys WRT54G router based on
> all my hundreds of failed attempts and the lack of any successful perl
> scripts on the Internet.
>
> Advice for the next guy: Be forewarned; you can't press a button on a
> Linksys WRT65G router using Perl. Some other approach might work; but not
> Perl.

What nonsense. You said yourself that you're not a programmer and don't know
Perl - what makes you think that something is impossible simply because *you*
can't figure it out?

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 01:43:08 von wilson

On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
> Perl - what makes you think that something is impossible simply because *you*
> can't figure it out?

I'd like to agree with you Sherman, but, it's pretty simple to prove my
point. Nobody else has figured it out either.

Keep in mind the Linksys WRT54G is one of the most common home routers on
the planet and that Cisco/Linksys makes very many others that are similar
and still - and still - even with all that going for it - nobody on the
planet has yet found or ever posted in the history of the Internet a
working perl script to press a button on the router. Any button. That isn't
proof - but how would you expect anyone to believe it can be done if nobody
has ever done it?

If someone provides a working perl script that, from windows, can press a
button (any button) on the Linksys WRT54G router in https mode - I'll agree
with you. Otherwise, it's either as you implied, nobody on earth has ever
tried using Perl to press a button (any button) on the most common router
on the planet - or - as I have sadly concluded, despite my attempt at a
tutorial for the masses, it just can't be done in perl.

I'm sure there is another way though so I'm not giving up on the project -
I'm just giving up on Perl as it seems to be a rather non-functional
language if it can't even do what takes me five manual presses with the
mouse.

The good news is I'm still the Internet for that as yet unknown method to
press a button on an https web page as I digest my holiday turkey. :)

Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 01:43:08 von wilson

On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
> Perl - what makes you think that something is impossible simply because *you*
> can't figure it out?

I'd like to agree with you Sherman, but, it's pretty simple to prove my
point. Nobody else has figured it out either.

Keep in mind the Linksys WRT54G is one of the most common home routers on
the planet and that Cisco/Linksys makes very many others that are similar
and still - and still - even with all that going for it - nobody on the
planet has yet found or ever posted in the history of the Internet a
working perl script to press a button on the router. Any button. That isn't
proof - but how would you expect anyone to believe it can be done if nobody
has ever done it?

If someone provides a working perl script that, from windows, can press a
button (any button) on the Linksys WRT54G router in https mode - I'll agree
with you. Otherwise, it's either as you implied, nobody on earth has ever
tried using Perl to press a button (any button) on the most common router
on the planet - or - as I have sadly concluded, despite my attempt at a
tutorial for the masses, it just can't be done in perl.

I'm sure there is another way though so I'm not giving up on the project -
I'm just giving up on Perl as it seems to be a rather non-functional
language if it can't even do what takes me five manual presses with the
mouse.

The good news is I'm still the Internet for that as yet unknown method to
press a button on an https web page as I digest my holiday turkey. :)

Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 01:50:18 von wilson

On Fri, 23 Nov 2007 00:43:08 GMT, Wilson wrote:

> The good news is I'm still the Internet for that as yet unknown method to
> press a button on an https web page as I digest my holiday turkey. :)

Oooooooops. I'm still *searching* the Internet for a method that works.
So, I haven't given up; I've just concluded Perl isn't able to perform the
three-step task of
* going to a certain web page
* logging into an https connection
* press a particular button

I've downloaded some of the suggested Windows freeware and am seeing if
that will do it.

I've given up on the Perl tutorial for doing the three steps above so I do
thank you all for your kind help. I know you didn't have to help me. You
have edified me more than I could have done so myself. This is my last post
on the subject, having concluded what I should have known before I started.

That's the one thing you should have told me but I don't blame you. If it
can't be done, only the ones who have tried would know. Right?

Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 01:50:18 von wilson

On Fri, 23 Nov 2007 00:43:08 GMT, Wilson wrote:

> The good news is I'm still the Internet for that as yet unknown method to
> press a button on an https web page as I digest my holiday turkey. :)

Oooooooops. I'm still *searching* the Internet for a method that works.
So, I haven't given up; I've just concluded Perl isn't able to perform the
three-step task of
* going to a certain web page
* logging into an https connection
* press a particular button

I've downloaded some of the suggested Windows freeware and am seeing if
that will do it.

I've given up on the Perl tutorial for doing the three steps above so I do
thank you all for your kind help. I know you didn't have to help me. You
have edified me more than I could have done so myself. This is my last post
on the subject, having concluded what I should have known before I started.

That's the one thing you should have told me but I don't blame you. If it
can't be done, only the ones who have tried would know. Right?

Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 01:57:26 von DTC

Wilson wrote:
> I dug some more and have some perl scripts (whatever perl is)

Pathologically Eclectic Rubbish Lister

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 03:12:08 von Volker Birk

In comp.security.firewalls Wilson wrote:
> Keep in mind the Linksys WRT54G is one of the most common home routers on
> the planet and that Cisco/Linksys makes very many others that are similar
> and still - and still - even with all that going for it - nobody on the
> planet has yet found or ever posted in the history of the Internet a
> working perl script to press a button on the router. Any button. That isn't
> proof - but how would you expect anyone to believe it can be done if nobody
> has ever done it?

You're just so incompetent and ridiculous, that I'm believing, you not
only know really nothing about Perl and HTTPS, but you also even know
nothing about pressing buttons ;-)

BTW: to press Buttons "on the router" with Perl, maybe you need an extra
"module":

http://hackedgadgets.com/2006/08/31/lego-mindstorms-nxt/

SCNR,
VB.
--
The file name of an indirect node file is the string "iNode" immediately
followed by the link reference converted to decimal text, with no leading
zeroes. For example, an indirect node file with link reference 123 would
have the name "iNode123". - HFS Plus Volume Format, MacOS X

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 03:12:08 von Volker Birk

In comp.security.firewalls Wilson wrote:
> Keep in mind the Linksys WRT54G is one of the most common home routers on
> the planet and that Cisco/Linksys makes very many others that are similar
> and still - and still - even with all that going for it - nobody on the
> planet has yet found or ever posted in the history of the Internet a
> working perl script to press a button on the router. Any button. That isn't
> proof - but how would you expect anyone to believe it can be done if nobody
> has ever done it?

You're just so incompetent and ridiculous, that I'm believing, you not
only know really nothing about Perl and HTTPS, but you also even know
nothing about pressing buttons ;-)

BTW: to press Buttons "on the router" with Perl, maybe you need an extra
"module":

http://hackedgadgets.com/2006/08/31/lego-mindstorms-nxt/

SCNR,
VB.
--
The file name of an indirect node file is the string "iNode" immediately
followed by the link reference converted to decimal text, with no leading
zeroes. For example, an indirect node file with link reference 123 would
have the name "iNode123". - HFS Plus Volume Format, MacOS X

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 03:40:00 von Ben Morrow

Quoth Wilson :
> On Fri, 23 Nov 2007 00:43:08 GMT, Wilson wrote:
>
> > The good news is I'm still the Internet for that as yet unknown method to
> > press a button on an https web page as I digest my holiday turkey. :)
>
> Oooooooops. I'm still *searching* the Internet for a method that works.
> So, I haven't given up; I've just concluded Perl isn't able to perform the
> three-step task of
> * going to a certain web page
> * logging into an https connection
> * press a particular button

Have you tried using http://www.research.att.com/sw/tools/wsp/? If the
web page served by the router is being too clever (and they *always*
seem to be) then this may help.

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 03:40:00 von Ben Morrow

Quoth Wilson :
> On Fri, 23 Nov 2007 00:43:08 GMT, Wilson wrote:
>
> > The good news is I'm still the Internet for that as yet unknown method to
> > press a button on an https web page as I digest my holiday turkey. :)
>
> Oooooooops. I'm still *searching* the Internet for a method that works.
> So, I haven't given up; I've just concluded Perl isn't able to perform the
> three-step task of
> * going to a certain web page
> * logging into an https connection
> * press a particular button

Have you tried using http://www.research.att.com/sw/tools/wsp/? If the
web page served by the router is being too clever (and they *always*
seem to be) then this may help.

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 05:23:59 von tramp

On Fri, 23 Nov 2007 00:43:08 +0000, Wilson wrote:

> On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
>> Perl - what makes you think that something is impossible simply because
>> *you* can't figure it out?
>
> I'd like to agree with you Sherman, but, it's pretty simple to prove my
> point. Nobody else has figured it out either.

You're in way over your head and nobody here owes it to you to solve your
programming problems. Since your biggest difficulty is lack of Perl
experience, you might try perl.beginners.

People there will be more likely to help if they can be sure this is
purely a Perl-programming problem. If you haven't done so already, get
the original reboot script working before making any modifications. That
will verify that Perl and its libraries are properly installed and
configured, that nothing in Windows networking (or maybe a local
firewall?) is keeping Perl from talking to the network, that the router
is reachable by Perl, that the username/password pair is working as
expected, and that Perl can successfully issue commands to the router.
Then if your script doesn't work, you know that the problem lies
somewhere in your modifications to the reboot script.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 05:23:59 von tramp

On Fri, 23 Nov 2007 00:43:08 +0000, Wilson wrote:

> On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
>> Perl - what makes you think that something is impossible simply because
>> *you* can't figure it out?
>
> I'd like to agree with you Sherman, but, it's pretty simple to prove my
> point. Nobody else has figured it out either.

You're in way over your head and nobody here owes it to you to solve your
programming problems. Since your biggest difficulty is lack of Perl
experience, you might try perl.beginners.

People there will be more likely to help if they can be sure this is
purely a Perl-programming problem. If you haven't done so already, get
the original reboot script working before making any modifications. That
will verify that Perl and its libraries are properly installed and
configured, that nothing in Windows networking (or maybe a local
firewall?) is keeping Perl from talking to the network, that the router
is reachable by Perl, that the username/password pair is working as
expected, and that Perl can successfully issue commands to the router.
Then if your script doesn't work, you know that the problem lies
somewhere in your modifications to the reboot script.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 16:47:50 von Sherm Pendley

Wilson writes:

> On Fri, 23 Nov 2007 00:43:08 GMT, Wilson wrote:
>
>> The good news is I'm still the Internet for that as yet unknown method to
>> press a button on an https web page as I digest my holiday turkey. :)
>
> Oooooooops. I'm still *searching* the Internet for a method that works.
> So, I haven't given up; I've just concluded Perl isn't able to perform the
> three-step task of
> * going to a certain web page
> * logging into an https connection
> * press a particular button

Are you being deliberately argumentative?

WWW::Mechanize is *very* capable of all of the above. You need to be a Perl
programmer to know how to use it, of course. If you're not, that means that
*you* aren't able to perform the above tasks in Perl - it's a limitation of
your own skill set, not a limitation of Perl.

> That's the one thing you should have told me but I don't blame you. If it
> can't be done, only the ones who have tried would know. Right?

Wrong. The above steps *can* be done in the general sense, by anyone with a
little bit of Perl skill.

If someone *with* that skill tried to do so with this particular router, and
posted a specific reason why the attempt failed - then I would agree with the
assessment that it can't be done.

When someone who admits to not having any Perl knowledge, and to not being a
programmer at all, claims to know what Perl is capable of, I have serious
doubts about that claim. Someone who's at that level simply doesn't have the
experience or background to reasonably assess Perl's capabilities.

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 16:47:50 von Sherm Pendley

Wilson writes:

> On Fri, 23 Nov 2007 00:43:08 GMT, Wilson wrote:
>
>> The good news is I'm still the Internet for that as yet unknown method to
>> press a button on an https web page as I digest my holiday turkey. :)
>
> Oooooooops. I'm still *searching* the Internet for a method that works.
> So, I haven't given up; I've just concluded Perl isn't able to perform the
> three-step task of
> * going to a certain web page
> * logging into an https connection
> * press a particular button

Are you being deliberately argumentative?

WWW::Mechanize is *very* capable of all of the above. You need to be a Perl
programmer to know how to use it, of course. If you're not, that means that
*you* aren't able to perform the above tasks in Perl - it's a limitation of
your own skill set, not a limitation of Perl.

> That's the one thing you should have told me but I don't blame you. If it
> can't be done, only the ones who have tried would know. Right?

Wrong. The above steps *can* be done in the general sense, by anyone with a
little bit of Perl skill.

If someone *with* that skill tried to do so with this particular router, and
posted a specific reason why the attempt failed - then I would agree with the
assessment that it can't be done.

When someone who admits to not having any Perl knowledge, and to not being a
programmer at all, claims to know what Perl is capable of, I have serious
doubts about that claim. Someone who's at that level simply doesn't have the
experience or background to reasonably assess Perl's capabilities.

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 17:46:32 von wilson

On Fri, 23 Nov 2007 04:23:59 -0000, tramp wrote:
> You're in way over your head
agreed. That's why I'm asking here.

> nobody here owes it to you to
agreed.
I'm asking anyone with a Linksys WRT54G router to just run the script once
and report back if they see the same issue.

> your biggest difficulty is lack of Perl experience
agreed.
However an experienced programmer wrote the original script & it failed to
reboot the router.

> People will be more likely to help if they can be sure this is
> purely a Perl-programming problem.
It is and is not a perl-programming problem. If Perl can't do it (which I
seriously suspect), then it's not a perl programming problem, I agree. We
can't really ask perl to do what it just can not do.

> If you haven't done so already, get the original reboot script working
The original perl script never worked for anyone, not even the original
programmer. He did his best. So did I. Both failed.

> That will verify that Perl and its libraries are properly installed
I agree - we need to verify this somehow. What would be a good way to
verify that an https web page can be accessed via a perl script and a
button on that https web page pressed?

> nothing in Windows networking (or maybe a local firewall?)
I've turned off the software firewall for the testing

> that the router is reachable by Perl,
Another good one. What is the basic test of that?

> that the username/password pair is working
Yet another good one. How would we test this?

> that Perl can successfully issue commands to the router.
Ah. This is the big kehuna. Can perl issue commands to a router or not?

> Then if your script doesn't work, you know that the problem lies
> somewhere in your modifications to the reboot script.
The reboot script never worked even for the original programmer. He said it
was the best he could do in perl.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 17:46:32 von wilson

On Fri, 23 Nov 2007 04:23:59 -0000, tramp wrote:
> You're in way over your head
agreed. That's why I'm asking here.

> nobody here owes it to you to
agreed.
I'm asking anyone with a Linksys WRT54G router to just run the script once
and report back if they see the same issue.

> your biggest difficulty is lack of Perl experience
agreed.
However an experienced programmer wrote the original script & it failed to
reboot the router.

> People will be more likely to help if they can be sure this is
> purely a Perl-programming problem.
It is and is not a perl-programming problem. If Perl can't do it (which I
seriously suspect), then it's not a perl programming problem, I agree. We
can't really ask perl to do what it just can not do.

> If you haven't done so already, get the original reboot script working
The original perl script never worked for anyone, not even the original
programmer. He did his best. So did I. Both failed.

> That will verify that Perl and its libraries are properly installed
I agree - we need to verify this somehow. What would be a good way to
verify that an https web page can be accessed via a perl script and a
button on that https web page pressed?

> nothing in Windows networking (or maybe a local firewall?)
I've turned off the software firewall for the testing

> that the router is reachable by Perl,
Another good one. What is the basic test of that?

> that the username/password pair is working
Yet another good one. How would we test this?

> that Perl can successfully issue commands to the router.
Ah. This is the big kehuna. Can perl issue commands to a router or not?

> Then if your script doesn't work, you know that the problem lies
> somewhere in your modifications to the reboot script.
The reboot script never worked even for the original programmer. He said it
was the best he could do in perl.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 17:50:35 von wilson

On Fri, 23 Nov 2007 02:40:00 +0000, Ben Morrow wrote:
> Have you tried using http://www.research.att.com/sw/tools/wsp/? If the
> web page served by the router is being too clever (and they *always*
> seem to be) then this may help.

Hi Ben,
You were the only one, it seems, who actually offered real help that pushed
this project forward. I appreciate that.

I'm still trying some avenues but have lost most of my trust in perl as
there are no working scripts I can find to test it on my router. If I could
only find a working script for a Linksys router that did anything - it
would give me confidence in that approach.

I have a couple more ideas going that I am trying and if perl continues to
fail me, I will use the method you denoted and as always, post the results
so everyone benefits from the exchange of information.

Thank you Ben for helping me and by doing so, helping the next person with
the same request!

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 17:50:35 von wilson

On Fri, 23 Nov 2007 02:40:00 +0000, Ben Morrow wrote:
> Have you tried using http://www.research.att.com/sw/tools/wsp/? If the
> web page served by the router is being too clever (and they *always*
> seem to be) then this may help.

Hi Ben,
You were the only one, it seems, who actually offered real help that pushed
this project forward. I appreciate that.

I'm still trying some avenues but have lost most of my trust in perl as
there are no working scripts I can find to test it on my router. If I could
only find a working script for a Linksys router that did anything - it
would give me confidence in that approach.

I have a couple more ideas going that I am trying and if perl continues to
fail me, I will use the method you denoted and as always, post the results
so everyone benefits from the exchange of information.

Thank you Ben for helping me and by doing so, helping the next person with
the same request!

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 20:09:09 von wilson

On Fri, 23 Nov 2007 10:47:50 -0500, Sherman Pendley wrote:
> When someone who admits to not having any Perl knowledge, and to not being a
> programmer at all, claims to know what Perl is capable of, I have serious
> doubts about that claim. Someone who's at that level simply doesn't have the
> experience or background to reasonably assess Perl's capabilities.

Hi Sherman,

I understand your argument, however, one (or all) of us is missing the main
point (maybe I didn't make it well enough so I'll try again).

I don't know if it will push this project forward to continue to "discuss"
without actually progressing - but - my main point was there is no evidence
in the literature that it has ever been done with a Linksys WRT54G router.

.... no evidence in the literature that perl works for this purpose ...

That's a pretty strong statement given how prevalent the Linksys WRT54G
router is and how common Perl programming seems to be.

.... there is no working script on the Internet that anyone has posted ...

At least nobody has ever posted a solution for logging into https Linksys
WRT54G (other than me and my script didn't work) - so my main point is that
there is absolutely no evidence that perl can do these two steps:
a) Log into the Linksys WRT54G as https
b) Press a button

I'm not asking anyone to "program" for me but if they already have a script
that does this - please just post it and we all would benefit from the
proof.

Either that, or just run my posted script and let us know if you get the
SAME errors I posted.

It's all just talk which gets us nowhere forward unless someone posts a
script that works or tries the script that didn't work.

Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 20:09:09 von wilson

On Fri, 23 Nov 2007 10:47:50 -0500, Sherman Pendley wrote:
> When someone who admits to not having any Perl knowledge, and to not being a
> programmer at all, claims to know what Perl is capable of, I have serious
> doubts about that claim. Someone who's at that level simply doesn't have the
> experience or background to reasonably assess Perl's capabilities.

Hi Sherman,

I understand your argument, however, one (or all) of us is missing the main
point (maybe I didn't make it well enough so I'll try again).

I don't know if it will push this project forward to continue to "discuss"
without actually progressing - but - my main point was there is no evidence
in the literature that it has ever been done with a Linksys WRT54G router.

.... no evidence in the literature that perl works for this purpose ...

That's a pretty strong statement given how prevalent the Linksys WRT54G
router is and how common Perl programming seems to be.

.... there is no working script on the Internet that anyone has posted ...

At least nobody has ever posted a solution for logging into https Linksys
WRT54G (other than me and my script didn't work) - so my main point is that
there is absolutely no evidence that perl can do these two steps:
a) Log into the Linksys WRT54G as https
b) Press a button

I'm not asking anyone to "program" for me but if they already have a script
that does this - please just post it and we all would benefit from the
proof.

Either that, or just run my posted script and let us know if you get the
SAME errors I posted.

It's all just talk which gets us nowhere forward unless someone posts a
script that works or tries the script that didn't work.

Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 20:27:26 von Ben Morrow

Quoth Wilson :
>
> At least nobody has ever posted a solution for logging into https Linksys
> WRT54G (other than me and my script didn't work) - so my main point is that
> there is absolutely no evidence that perl can do these two steps:
> a) Log into the Linksys WRT54G as https
> b) Press a button

Don't be ridiculous: it almost certainly can, you just don't know how,
and we don't have the router in question or don't care enough to find
out.

About the only case where it's non-trivial to fake a browser's request
with Perl is when the page includes JavaScript that changes what is
about to be submitted in a non-trivial way. This would require that you
write a piece of Perl that has the same effect as the given piece of JS:
if you can't see that that is always possible, then you shouldn't be
attempting to write a program at all.

> I'm not asking anyone to "program" for me but if they already have a script
> that does this - please just post it and we all would benefit from the
> proof.

Download and install WSP that I pointed you to previously, set it as
your proxy, do whatever it is you are trying to do with your browser,
and WSP will write you a Perl program that does the same thing. That's
what it's for :).

> It's all just talk which gets us nowhere forward unless someone posts a
> script that works or tries the script that didn't work.

s/unless.*/until you stop making unfounded assertions about things you
don't understand and start trying to find out what requests the router
will actually respond to./s;

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 20:27:26 von Ben Morrow

Quoth Wilson :
>
> At least nobody has ever posted a solution for logging into https Linksys
> WRT54G (other than me and my script didn't work) - so my main point is that
> there is absolutely no evidence that perl can do these two steps:
> a) Log into the Linksys WRT54G as https
> b) Press a button

Don't be ridiculous: it almost certainly can, you just don't know how,
and we don't have the router in question or don't care enough to find
out.

About the only case where it's non-trivial to fake a browser's request
with Perl is when the page includes JavaScript that changes what is
about to be submitted in a non-trivial way. This would require that you
write a piece of Perl that has the same effect as the given piece of JS:
if you can't see that that is always possible, then you shouldn't be
attempting to write a program at all.

> I'm not asking anyone to "program" for me but if they already have a script
> that does this - please just post it and we all would benefit from the
> proof.

Download and install WSP that I pointed you to previously, set it as
your proxy, do whatever it is you are trying to do with your browser,
and WSP will write you a Perl program that does the same thing. That's
what it's for :).

> It's all just talk which gets us nowhere forward unless someone posts a
> script that works or tries the script that didn't work.

s/unless.*/until you stop making unfounded assertions about things you
don't understand and start trying to find out what requests the router
will actually respond to./s;

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 21:49:10 von wilson

On Fri, 23 Nov 2007 19:27:26 +0000, Ben Morrow wrote:
>> At least nobody has ever posted a solution for logging into https Linksys
>> WRT54G (other than me and my script didn't work)
> About the only case where it's non-trivial to fake a browser's request
> with Perl is when the page includes JavaScript that changes what is
> about to be submitted in a non-trivial way.

Hi Ben,
As before, you seem to be on to something here as the one posting the most
wisdom. I turned off javascript and java in my browser and guess what? I
could log into my Linksys WRT54G router but I could NOT access any of the
buttons. The web page was "garbled" (for lack of a better description)
without Javascript and/or Java.

Hmmmm... does this mean that Perl can "impersonate" java somehow?

Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 21:49:10 von wilson

On Fri, 23 Nov 2007 19:27:26 +0000, Ben Morrow wrote:
>> At least nobody has ever posted a solution for logging into https Linksys
>> WRT54G (other than me and my script didn't work)
> About the only case where it's non-trivial to fake a browser's request
> with Perl is when the page includes JavaScript that changes what is
> about to be submitted in a non-trivial way.

Hi Ben,
As before, you seem to be on to something here as the one posting the most
wisdom. I turned off javascript and java in my browser and guess what? I
could log into my Linksys WRT54G router but I could NOT access any of the
buttons. The web page was "garbled" (for lack of a better description)
without Javascript and/or Java.

Hmmmm... does this mean that Perl can "impersonate" java somehow?

Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 22:54:36 von Sherm Pendley

Wilson writes:

> On Fri, 23 Nov 2007 10:47:50 -0500, Sherman Pendley wrote:
>> When someone who admits to not having any Perl knowledge, and to not being a
>> programmer at all, claims to know what Perl is capable of, I have serious
>> doubts about that claim. Someone who's at that level simply doesn't have the
>> experience or background to reasonably assess Perl's capabilities.
>
> Hi Sherman,
>
> I understand your argument, however, one (or all) of us is missing the main
> point (maybe I didn't make it well enough so I'll try again).

You claimed that Perl can't log into an https server and simulate a button
click. My point is that this claim is false; that kind of "web scraping" is
a very common use of Perl.

> I don't know if it will push this project forward to continue to "discuss"
> without actually progressing - but - my main point was there is no evidence
> in the literature that it has ever been done with a Linksys WRT54G router.
>
> ... no evidence in the literature that perl works for this purpose ...

Absence of proof is not proof of absence.

> At least nobody has ever posted a solution for logging into https Linksys
> WRT54G (other than me and my script didn't work) - so my main point is that
> there is absolutely no evidence that perl can do these two steps:
> a) Log into the Linksys WRT54G as https
> b) Press a button

In a generic sense, there are literally hundreds of examples of Perl doing what
you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
to see them. There is absolutely no question that Perl is capable of logging
into an https web server and performing the moral equivalent of a button click.

> Either that, or just run my posted script and let us know if you get the
> SAME errors I posted.

I have a different model Linksys. I could adapt the script you posted to work
with my own router, and post that as "proof," but that wouldn't be useful for
you. It wouldn't work for *your* router, because mine is quite old and it's
quite likely that its admin interface is arranged differently.

The odds of your finding someone who owns the exact same model router, *and*
is capable of writing a script like this, are very small. You'll need to start
with a script that was originally written for another make and model router,
and adapt it to fit the admin interface for your own router.

I think your problem is one of unrealistic expectations. There is no standard
for browser-based router interfaces, and you can't reasonably expect a script
in *any* language that was written for a different router to work unchanged
with yours.

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 22:54:36 von Sherm Pendley

Wilson writes:

> On Fri, 23 Nov 2007 10:47:50 -0500, Sherman Pendley wrote:
>> When someone who admits to not having any Perl knowledge, and to not being a
>> programmer at all, claims to know what Perl is capable of, I have serious
>> doubts about that claim. Someone who's at that level simply doesn't have the
>> experience or background to reasonably assess Perl's capabilities.
>
> Hi Sherman,
>
> I understand your argument, however, one (or all) of us is missing the main
> point (maybe I didn't make it well enough so I'll try again).

You claimed that Perl can't log into an https server and simulate a button
click. My point is that this claim is false; that kind of "web scraping" is
a very common use of Perl.

> I don't know if it will push this project forward to continue to "discuss"
> without actually progressing - but - my main point was there is no evidence
> in the literature that it has ever been done with a Linksys WRT54G router.
>
> ... no evidence in the literature that perl works for this purpose ...

Absence of proof is not proof of absence.

> At least nobody has ever posted a solution for logging into https Linksys
> WRT54G (other than me and my script didn't work) - so my main point is that
> there is absolutely no evidence that perl can do these two steps:
> a) Log into the Linksys WRT54G as https
> b) Press a button

In a generic sense, there are literally hundreds of examples of Perl doing what
you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
to see them. There is absolutely no question that Perl is capable of logging
into an https web server and performing the moral equivalent of a button click.

> Either that, or just run my posted script and let us know if you get the
> SAME errors I posted.

I have a different model Linksys. I could adapt the script you posted to work
with my own router, and post that as "proof," but that wouldn't be useful for
you. It wouldn't work for *your* router, because mine is quite old and it's
quite likely that its admin interface is arranged differently.

The odds of your finding someone who owns the exact same model router, *and*
is capable of writing a script like this, are very small. You'll need to start
with a script that was originally written for another make and model router,
and adapt it to fit the admin interface for your own router.

I think your problem is one of unrealistic expectations. There is no standard
for browser-based router interfaces, and you can't reasonably expect a script
in *any* language that was written for a different router to work unchanged
with yours.

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 23:24:21 von Ben Morrow

Quoth Wilson :
> On Fri, 23 Nov 2007 19:27:26 +0000, Ben Morrow wrote:
> >> At least nobody has ever posted a solution for logging into https Linksys
> >> WRT54G (other than me and my script didn't work)
> > About the only case where it's non-trivial to fake a browser's request
> > with Perl is when the page includes JavaScript that changes what is
> > about to be submitted in a non-trivial way.
>
> I turned off javascript and java in my browser and guess what? I
> could log into my Linksys WRT54G router but I could NOT access any of the
> buttons. The web page was "garbled" (for lack of a better description)
> without Javascript and/or Java.
>
> Hmmmm... does this mean that Perl can "impersonate" java somehow?

Do you understand how http works? The client makes a request, and the
server returns a response. There is no way the server can tell if the
client is IE with javascript or something else that just happens to make
the same requests in the same order. For the last time: *you need to
find out what requests your browser is actually making*. Then you can
begin working out how to reproduce them from Perl, which will almost
certainly be straightforward.

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 23.11.2007 23:24:21 von Ben Morrow

Quoth Wilson :
> On Fri, 23 Nov 2007 19:27:26 +0000, Ben Morrow wrote:
> >> At least nobody has ever posted a solution for logging into https Linksys
> >> WRT54G (other than me and my script didn't work)
> > About the only case where it's non-trivial to fake a browser's request
> > with Perl is when the page includes JavaScript that changes what is
> > about to be submitted in a non-trivial way.
>
> I turned off javascript and java in my browser and guess what? I
> could log into my Linksys WRT54G router but I could NOT access any of the
> buttons. The web page was "garbled" (for lack of a better description)
> without Javascript and/or Java.
>
> Hmmmm... does this mean that Perl can "impersonate" java somehow?

Do you understand how http works? The client makes a request, and the
server returns a response. There is no way the server can tell if the
client is IE with javascript or something else that just happens to make
the same requests in the same order. For the last time: *you need to
find out what requests your browser is actually making*. Then you can
begin working out how to reproduce them from Perl, which will almost
certainly be straightforward.

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 00:36:51 von Mark McIntyre

Wilson wrote:
> On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
>> Perl - what makes you think that something is impossible simply because *you*
>> can't figure it out?
>
> I'd like to agree with you Sherman, but, it's pretty simple to prove my
> point. Nobody else has figured it out either.

FWIW this isn't a proof. It merely shows that /to date/ nobody smart
enough or interested enough has looked into it.

For three hundred years Fermat's Last Theorem stood unproven. That
doesn't mean it was impossible to prove. Someday someone will prove the
Riemann Hypothesis too.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 00:36:51 von Mark McIntyre

Wilson wrote:
> On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
>> Perl - what makes you think that something is impossible simply because *you*
>> can't figure it out?
>
> I'd like to agree with you Sherman, but, it's pretty simple to prove my
> point. Nobody else has figured it out either.

FWIW this isn't a proof. It merely shows that /to date/ nobody smart
enough or interested enough has looked into it.

For three hundred years Fermat's Last Theorem stood unproven. That
doesn't mean it was impossible to prove. Someday someone will prove the
Riemann Hypothesis too.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 06:25:23 von veatchla

Wilson wrote:
> On Fri, 23 Nov 2007 04:23:59 -0000, tramp wrote:
>> You're in way over your head
> agreed. That's why I'm asking here.
>
>> nobody here owes it to you to
> agreed.
> I'm asking anyone with a Linksys WRT54G router to just run the script once
> and report back if they see the same issue.
>
>> your biggest difficulty is lack of Perl experience
> agreed.
> However an experienced programmer wrote the original script & it failed to
> reboot the router.
>
>> People will be more likely to help if they can be sure this is
>> purely a Perl-programming problem.
> It is and is not a perl-programming problem. If Perl can't do it (which I
> seriously suspect), then it's not a perl programming problem, I agree. We
> can't really ask perl to do what it just can not do.
>
>> If you haven't done so already, get the original reboot script working
> The original perl script never worked for anyone, not even the original
> programmer. He did his best. So did I. Both failed.
>
>> That will verify that Perl and its libraries are properly installed
> I agree - we need to verify this somehow. What would be a good way to
> verify that an https web page can be accessed via a perl script and a
> button on that https web page pressed?
>
>> nothing in Windows networking (or maybe a local firewall?)
> I've turned off the software firewall for the testing
>
>> that the router is reachable by Perl,
> Another good one. What is the basic test of that?
>
>> that the username/password pair is working
> Yet another good one. How would we test this?
>
>> that Perl can successfully issue commands to the router.
> Ah. This is the big kehuna. Can perl issue commands to a router or not?
>
>> Then if your script doesn't work, you know that the problem lies
>> somewhere in your modifications to the reboot script.
> The reboot script never worked even for the original programmer. He said it
> was the best he could do in perl.

My WRT54G (v8.00.2) is not configured the same as yours so I can not
test the script for you. Nor does my device connect directly to the
internet, rather it sits behind my DSL modem. No connect/disconnect
buttons.

FWIW, by using Win32::Internet on a WinXPsp2 using Perl 5.6.1, I can
"click" the 'DHCP Clients Table' button located under Status | Local
Network.

Perhaps you should try cURL within a batch file and forgo the
programming, but you will still need to know how call a web site outside
of a web browser -- same as if you were using Perl.

--

Len

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 06:25:23 von veatchla

Wilson wrote:
> On Fri, 23 Nov 2007 04:23:59 -0000, tramp wrote:
>> You're in way over your head
> agreed. That's why I'm asking here.
>
>> nobody here owes it to you to
> agreed.
> I'm asking anyone with a Linksys WRT54G router to just run the script once
> and report back if they see the same issue.
>
>> your biggest difficulty is lack of Perl experience
> agreed.
> However an experienced programmer wrote the original script & it failed to
> reboot the router.
>
>> People will be more likely to help if they can be sure this is
>> purely a Perl-programming problem.
> It is and is not a perl-programming problem. If Perl can't do it (which I
> seriously suspect), then it's not a perl programming problem, I agree. We
> can't really ask perl to do what it just can not do.
>
>> If you haven't done so already, get the original reboot script working
> The original perl script never worked for anyone, not even the original
> programmer. He did his best. So did I. Both failed.
>
>> That will verify that Perl and its libraries are properly installed
> I agree - we need to verify this somehow. What would be a good way to
> verify that an https web page can be accessed via a perl script and a
> button on that https web page pressed?
>
>> nothing in Windows networking (or maybe a local firewall?)
> I've turned off the software firewall for the testing
>
>> that the router is reachable by Perl,
> Another good one. What is the basic test of that?
>
>> that the username/password pair is working
> Yet another good one. How would we test this?
>
>> that Perl can successfully issue commands to the router.
> Ah. This is the big kehuna. Can perl issue commands to a router or not?
>
>> Then if your script doesn't work, you know that the problem lies
>> somewhere in your modifications to the reboot script.
> The reboot script never worked even for the original programmer. He said it
> was the best he could do in perl.

My WRT54G (v8.00.2) is not configured the same as yours so I can not
test the script for you. Nor does my device connect directly to the
internet, rather it sits behind my DSL modem. No connect/disconnect
buttons.

FWIW, by using Win32::Internet on a WinXPsp2 using Perl 5.6.1, I can
"click" the 'DHCP Clients Table' button located under Status | Local
Network.

Perhaps you should try cURL within a batch file and forgo the
programming, but you will still need to know how call a web site outside
of a web browser -- same as if you were using Perl.

--

Len

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:25:51 von wilson

On Fri, 23 Nov 2007 17:29:57 -0600, DTC wrote:
> I was just reminded by my partner we used it on the Linksys WRT54G four
> years ago.

Can you post that Perl script? I'd love to try it out on my Linksys WRT54G
wireless router!

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:25:51 von wilson

On Fri, 23 Nov 2007 17:29:57 -0600, DTC wrote:
> I was just reminded by my partner we used it on the Linksys WRT54G four
> years ago.

Can you post that Perl script? I'd love to try it out on my Linksys WRT54G
wireless router!

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:28:23 von wilson

On Fri, 23 Nov 2007 23:25:23 -0600, l v wrote:
> My WRT54G (v8.00.2) is not configured the same as yours so I can not
> test the script for you. Nor does my device connect directly to the
> internet, rather it sits behind my DSL modem. No connect/disconnect
> buttons.

Hi lv,
My WRT54G also sits "behind" a DSL modem.

If you navigate to the Linksys WRT54G "Status -> Router" page, do you see
the "Disconnect" or "Connect" button?

This connects or disconnects from the DSL modem (depending on whether you
are already connected or disconnected).

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:28:23 von wilson

On Fri, 23 Nov 2007 23:25:23 -0600, l v wrote:
> My WRT54G (v8.00.2) is not configured the same as yours so I can not
> test the script for you. Nor does my device connect directly to the
> internet, rather it sits behind my DSL modem. No connect/disconnect
> buttons.

Hi lv,
My WRT54G also sits "behind" a DSL modem.

If you navigate to the Linksys WRT54G "Status -> Router" page, do you see
the "Disconnect" or "Connect" button?

This connects or disconnects from the DSL modem (depending on whether you
are already connected or disconnected).

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:29:01 von wilson

On Fri, 23 Nov 2007 23:36:51 +0000, Mark McIntyre wrote:
> FWIW this isn't a proof. It merely shows that /to date/ nobody smart
> enough or interested enough has looked into it.

OK. Agreed.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:29:01 von wilson

On Fri, 23 Nov 2007 23:36:51 +0000, Mark McIntyre wrote:
> FWIW this isn't a proof. It merely shows that /to date/ nobody smart
> enough or interested enough has looked into it.

OK. Agreed.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:31:21 von wilson

On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
> In a generic sense, there are literally hundreds of examples of Perl doing what
> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
> to see them. There is absolutely no question that Perl is capable of logging
> into an https web server and performing the moral equivalent of a button click.

Even web pages which seem to require "javascript" in order to view the
buttons?

BTW, I tested the router - it does not need java; just javascript.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:31:21 von wilson

On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
> In a generic sense, there are literally hundreds of examples of Perl doing what
> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
> to see them. There is absolutely no question that Perl is capable of logging
> into an https web server and performing the moral equivalent of a button click.

Even web pages which seem to require "javascript" in order to view the
buttons?

BTW, I tested the router - it does not need java; just javascript.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:32:06 von wilson

On Fri, 23 Nov 2007 22:24:21 +0000, Ben Morrow wrote:

> *you need to find out what requests your browser is actually making*.

Hi Ben,
I'm working on it.
Thanks
Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:32:06 von wilson

On Fri, 23 Nov 2007 22:24:21 +0000, Ben Morrow wrote:

> *you need to find out what requests your browser is actually making*.

Hi Ben,
I'm working on it.
Thanks
Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:43:46 von wilson

On Fri, 23 Nov 2007 22:24:21 +0000, Ben Morrow wrote:
> *you need to find out what requests your browser is actually making*.
> Then you can begin working out how to reproduce them from Perl

I do not know if this helps but this is the web page at the Linksys WRT54G
router page "Status -> Router" https://192.168.0.1/StaRouter.htm

































border=0> style="FONT-SIZE: 7pt" color=#ffffff> face=Arial>: v1.02.0
   
src="UI_10.gif" width=809 border=0>

border=0>



style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
borderColor=#000000 align=middle width=163 height=49>

style="FONT-SIZE: 15pt" face=Arial
color=#ffffff>

style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
vAlign=center borderColor=#000000 width=646 bgColor=#000000 height=49>
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black;
FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif;
BORDER-COLLAPSE: collapse; FONT-VARIANT: normal"
height=33 cellSpacing=0 cellPadding=0 bgColor=#6666cc border=0>








bgColor=#6666cc height=33> color=#ffffff>   width=109 bgColor=#000000 borderColorDark=#000000 height=12
rowSpan=2> style="FONT-SIZE: 8pt">WRT54G
style="FONT-WEIGHT: normal; FONT-SIZE: 1pt; COLOR: black;
FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif;
FONT-VARIANT: normal"
width=537 bgColor=#000000 height=1> 

style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black;
FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif;
BORDER-COLLAPSE: collapse; FONT-VARIANT: normal"
height=6 cellSpacing=0 cellPadding=0 width=637 border=0>

style="BORDER-RIGHT: medium none; BORDER-TOP: medium none;
FONT-WEIGHT: normal; FONT-SIZE: 1pt; BORDER-LEFT: medium none; COLOR:
black; BORDER-BOTTOM: medium none; FONT-STYLE: normal; FONT-FAMILY: Arial,
Helvetica, sans-serif; FONT-VARIANT: normal"
align=middle bgColor=#6666cc>



















src="UI_06.gif" width=83 border=0> src="UI_06.gif" width=83 border=0> src="UI_06.gif" width=83 border=0> src="UI_06.gif" width=103 border=0> src="UI_06.gif" width=100 border=0> src="UI_06.gif" width=115 border=0> src="UI_07.gif" width=79 border=0>
style="FONT-WEIGHT: 700" color=#ffffff> style="TEXT-DECORATION: none"

href="basic.htm">
style="FONT-WEIGHT: 700" color=#ffffff> style="TEXT-DECORATION: none"

href="Wireless.htm">
style="FONT-WEIGHT: 700" color=#ffffff> style="TEXT-DECORATION: none"

href="Firewall.htm">
style="FONT-WEIGHT: 700" color=#ffffff> style="TEXT-DECORATION: none"

href="Filters.htm">

color=#ffffff>
href="Forward.htm">
&

    


color=#ffffff>
href="Manage.htm">
    


color=#ffffff>
href="StaRouter.htm">
    


cellPadding="0">












color=white>|


href="StaLan.htm">

color=white>|

 
href="StaWlan.htm">

border=0>



style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
borderColor=#e7e7e7 width=163 bgColor=#e7e7e7 height=1> src="UI_03.gif" width=164 border=0>
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
width=646 height=1> border=0>





height=23 cellSpacing=0 cellPadding=0 width=809 border=0>

















































































































































































color=#ffffff>

               
      height=25>: v1.02.0, . 16, 2007
   
      height=25>: ,
23 2007 22:35:32
   
      height=25>: B1:B1:A1:A1:32:00    
      height=25>:    
      height=25>:    
      height=25>:    

color=#ffffff>

     

    height=25> style="FONT-SIZE: 8pt">: PPPoE    
      : 69.110.22.230    
  width=8 border=0>   style="FONT-SIZE:
8pt">:
style="FONT-SIZE: 8pt">255.255.255.255   src="UI_05.gif" width=15 border=0>
  width=8 border=0>   style="FONT-SIZE:
8pt">
style="FONT-SIZE: 8pt">151.164.184.81   src="UI_05.gif" width=15 border=0>
      : 68.94.156.1    
      : 68.94.157.1    
      :    
      : 1492    
   







   


 
 
           
      height=5> 








  color=#ffffff>


href="HStatus.htm">




target=_blank>
height=25> 
















          src="UI_Cisco.gif" width=176 border=0>
     


height=19 cellSpacing=0 cellPadding=0 width=33 border=0>






bgColor=#6666cc> 

height=33> 

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 07:43:46 von wilson

On Fri, 23 Nov 2007 22:24:21 +0000, Ben Morrow wrote:
> *you need to find out what requests your browser is actually making*.
> Then you can begin working out how to reproduce them from Perl

I do not know if this helps but this is the web page at the Linksys WRT54G
router page "Status -> Router" https://192.168.0.1/StaRouter.htm

































border=0> style="FONT-SIZE: 7pt" color=#ffffff> face=Arial>: v1.02.0
   
src="UI_10.gif" width=809 border=0>

border=0>



style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
borderColor=#000000 align=middle width=163 height=49>

style="FONT-SIZE: 15pt" face=Arial
color=#ffffff>

style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
vAlign=center borderColor=#000000 width=646 bgColor=#000000 height=49>
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black;
FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif;
BORDER-COLLAPSE: collapse; FONT-VARIANT: normal"
height=33 cellSpacing=0 cellPadding=0 bgColor=#6666cc border=0>








bgColor=#6666cc height=33> color=#ffffff>   width=109 bgColor=#000000 borderColorDark=#000000 height=12
rowSpan=2> style="FONT-SIZE: 8pt">WRT54G
style="FONT-WEIGHT: normal; FONT-SIZE: 1pt; COLOR: black;
FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif;
FONT-VARIANT: normal"
width=537 bgColor=#000000 height=1> 

style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black;
FONT-STYLE: normal; FONT-FAMILY: Arial, Helvetica, sans-serif;
BORDER-COLLAPSE: collapse; FONT-VARIANT: normal"
height=6 cellSpacing=0 cellPadding=0 width=637 border=0>

style="BORDER-RIGHT: medium none; BORDER-TOP: medium none;
FONT-WEIGHT: normal; FONT-SIZE: 1pt; BORDER-LEFT: medium none; COLOR:
black; BORDER-BOTTOM: medium none; FONT-STYLE: normal; FONT-FAMILY: Arial,
Helvetica, sans-serif; FONT-VARIANT: normal"
align=middle bgColor=#6666cc>



















src="UI_06.gif" width=83 border=0> src="UI_06.gif" width=83 border=0> src="UI_06.gif" width=83 border=0> src="UI_06.gif" width=103 border=0> src="UI_06.gif" width=100 border=0> src="UI_06.gif" width=115 border=0> src="UI_07.gif" width=79 border=0>
style="FONT-WEIGHT: 700" color=#ffffff> style="TEXT-DECORATION: none"

href="basic.htm">
style="FONT-WEIGHT: 700" color=#ffffff> style="TEXT-DECORATION: none"

href="Wireless.htm">
style="FONT-WEIGHT: 700" color=#ffffff> style="TEXT-DECORATION: none"

href="Firewall.htm">
style="FONT-WEIGHT: 700" color=#ffffff> style="TEXT-DECORATION: none"

href="Filters.htm">

color=#ffffff>
href="Forward.htm">
&

    


color=#ffffff>
href="Manage.htm">
    


color=#ffffff>
href="StaRouter.htm">
    


cellPadding="0">












color=white>|


href="StaLan.htm">

color=white>|

 
href="StaWlan.htm">

border=0>



style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
borderColor=#e7e7e7 width=163 bgColor=#e7e7e7 height=1> src="UI_03.gif" width=164 border=0>
style="FONT-WEIGHT: normal; FONT-SIZE: 10pt; COLOR: black; FONT-STYLE:
normal; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-VARIANT: normal"
width=646 height=1> border=0>





height=23 cellSpacing=0 cellPadding=0 width=809 border=0>

















































































































































































color=#ffffff>

               
      height=25>: v1.02.0, . 16, 2007
   
      height=25>: ,
23 2007 22:35:32
   
      height=25>: B1:B1:A1:A1:32:00    
      height=25>:    
      height=25>:    
      height=25>:    

color=#ffffff>

     

    height=25> style="FONT-SIZE: 8pt">: PPPoE    
      : 69.110.22.230    
  width=8 border=0>   style="FONT-SIZE:
8pt">:
style="FONT-SIZE: 8pt">255.255.255.255   src="UI_05.gif" width=15 border=0>
  width=8 border=0>   style="FONT-SIZE:
8pt">
style="FONT-SIZE: 8pt">151.164.184.81   src="UI_05.gif" width=15 border=0>
      : 68.94.156.1    
      : 68.94.157.1    
      :    
      : 1492    
   







   


 
 
           
      height=5> 








  color=#ffffff>


href="HStatus.htm">




target=_blank>
height=25> 
















          src="UI_Cisco.gif" width=176 border=0>
     


height=19 cellSpacing=0 cellPadding=0 width=33 border=0>






bgColor=#6666cc> 

height=33> 

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 15:13:48 von rvtol+news

Wilson schreef:

> If you navigate to the Linksys WRT54G "Status -> Router" page, do you
> see the "Disconnect" or "Connect" button?
>
> This connects or disconnects from the DSL modem (depending on whether
> you are already connected or disconnected).

Most WAN-routers also have a textual interface (like telnet) that is
much easier to handle programmatically, so why go the non-easy way?

--
Affijn, Ruud

"Gewoon is een tijger."

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 15:13:48 von rvtol+news

Wilson schreef:

> If you navigate to the Linksys WRT54G "Status -> Router" page, do you
> see the "Disconnect" or "Connect" button?
>
> This connects or disconnects from the DSL modem (depending on whether
> you are already connected or disconnected).

Most WAN-routers also have a textual interface (like telnet) that is
much easier to handle programmatically, so why go the non-easy way?

--
Affijn, Ruud

"Gewoon is een tijger."

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 18:14:22 von DTC

Wilson wrote:
> On Fri, 23 Nov 2007 17:29:57 -0600, DTC wrote:
>> I was just reminded by my partner we used it on the Linksys WRT54G four
>> years ago.
>
> Can you post that Perl script? I'd love to try it out on my Linksys WRT54G
> wireless router!

I'll see if we have it saved somewhere. We haven't worked with Linksys
units for some time.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 18:14:22 von DTC

Wilson wrote:
> On Fri, 23 Nov 2007 17:29:57 -0600, DTC wrote:
>> I was just reminded by my partner we used it on the Linksys WRT54G four
>> years ago.
>
> Can you post that Perl script? I'd love to try it out on my Linksys WRT54G
> wireless router!

I'll see if we have it saved somewhere. We haven't worked with Linksys
units for some time.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 18:58:47 von wilson

On Sat, 24 Nov 2007 11:14:22 -0600, DTC wrote:

>> Can you post that Perl script?
>
> I'll see if we have it saved somewhere.

Thanks.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 18:58:47 von wilson

On Sat, 24 Nov 2007 11:14:22 -0600, DTC wrote:

>> Can you post that Perl script?
>
> I'll see if we have it saved somewhere.

Thanks.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:01:40 von wilson

On Sat, 24 Nov 2007 15:13:48 +0100, Dr.Ruud wrote:

> Most WAN-routers also have a textual interface (like telnet) that is
> much easier to handle programmatically, so why go the non-easy way?

I am almost to the point of giving up on Perl so I think I'll follow Ben's
prior suggestions which seem to be more powerful than Perl.

I think, based on my experience only, that for Perl to interpret Javascript
is something nobody has ever posted, so, who am I, an avowed beginner and
non programmer, to get it working first.

I have just one or two more experiments to try. I don't have a programmers'
mind, but I do see a few more things I can tweak and try as every time I
try something, I see something else that "might" be the culprit or the
solution.

I find that part fun even though I don't know how to program. I sure hope
to post a solution for the world to benefit - but first I have to get it
working.

Thanks for the advice.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:01:40 von wilson

On Sat, 24 Nov 2007 15:13:48 +0100, Dr.Ruud wrote:

> Most WAN-routers also have a textual interface (like telnet) that is
> much easier to handle programmatically, so why go the non-easy way?

I am almost to the point of giving up on Perl so I think I'll follow Ben's
prior suggestions which seem to be more powerful than Perl.

I think, based on my experience only, that for Perl to interpret Javascript
is something nobody has ever posted, so, who am I, an avowed beginner and
non programmer, to get it working first.

I have just one or two more experiments to try. I don't have a programmers'
mind, but I do see a few more things I can tweak and try as every time I
try something, I see something else that "might" be the culprit or the
solution.

I find that part fun even though I don't know how to program. I sure hope
to post a solution for the world to benefit - but first I have to get it
working.

Thanks for the advice.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:06:40 von wilson

On Fri, 23 Nov 2007 02:40:00 +0000, Ben Morrow wrote:

> Have you tried using http://www.research.att.com/sw/tools/wsp/? If the
> web page served by the router is being too clever (and they *always*
> seem to be) then this may help.

Hi Ben,
You have always been the one useful voice of reason. The rest were voices
of reason, but not useful (like the ones who lambasted my lack of
programming experience or those who claimed it could be done w/o any
evidence). They were right, of course, but they weren't helpful to getting
the task accomplished.

For your insight, I appreciate. I will try just a couple more experiments
with the Perl approach as I hate to lose. I'm not a programmer, nor do I
have a programmer's mentality, but, I just hate it when something should
work but it doesn't for some unknown reason. That irks me and irked me in
my dreams all night, sadly to say.

Anyway, I'll be re-reading your posts and attempting the closest thing to
what looks like it will work to perform the following:

a) Open an https web page on the Linksys WRT54G router
b) Log in with a username of null and a password of "letmein"
c) Press a javascripted button on that web page called "Disconnect"

Thanks!

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:06:40 von wilson

On Fri, 23 Nov 2007 02:40:00 +0000, Ben Morrow wrote:

> Have you tried using http://www.research.att.com/sw/tools/wsp/? If the
> web page served by the router is being too clever (and they *always*
> seem to be) then this may help.

Hi Ben,
You have always been the one useful voice of reason. The rest were voices
of reason, but not useful (like the ones who lambasted my lack of
programming experience or those who claimed it could be done w/o any
evidence). They were right, of course, but they weren't helpful to getting
the task accomplished.

For your insight, I appreciate. I will try just a couple more experiments
with the Perl approach as I hate to lose. I'm not a programmer, nor do I
have a programmer's mentality, but, I just hate it when something should
work but it doesn't for some unknown reason. That irks me and irked me in
my dreams all night, sadly to say.

Anyway, I'll be re-reading your posts and attempting the closest thing to
what looks like it will work to perform the following:

a) Open an https web page on the Linksys WRT54G router
b) Log in with a username of null and a password of "letmein"
c) Press a javascripted button on that web page called "Disconnect"

Thanks!

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:13:08 von wilson

On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
> What nonsense. You said yourself that you're not a programmer and don't know
> Perl - what makes you think that something is impossible simply because *you*
> can't figure it out?

Hi Sherman,
After calming down, I must apologize for saying "Perl can't do it", as, as
you noted, I am not a programmer, nor do I have a programmer's mentality
.... so who am I to say whether it can be done or not. In my frustration, I
guess I was "blaming" perl but I did not mean to malign that language.

It's just that I really hate it when I have to do anything manual and,
despite the fact I'm not a programmer-type person, I always try to cut down
on the number of button clicks I do, even if it's only three or five clicks
when I do it a lot. I find that makes me much more efficient even if there
is a lot of up-front work to get the job done.

So, I _will_ automate the task of disconnecting and reconnecting from the
ISP - I just don't know how yet. I have just a few more things to try
(although I said that days ago) and I'll get the damn thing working.

Thanks and sorry for not being of the mind and body like you guys are!
I admire you and what you can do with code!
Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:13:08 von wilson

On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
> What nonsense. You said yourself that you're not a programmer and don't know
> Perl - what makes you think that something is impossible simply because *you*
> can't figure it out?

Hi Sherman,
After calming down, I must apologize for saying "Perl can't do it", as, as
you noted, I am not a programmer, nor do I have a programmer's mentality
.... so who am I to say whether it can be done or not. In my frustration, I
guess I was "blaming" perl but I did not mean to malign that language.

It's just that I really hate it when I have to do anything manual and,
despite the fact I'm not a programmer-type person, I always try to cut down
on the number of button clicks I do, even if it's only three or five clicks
when I do it a lot. I find that makes me much more efficient even if there
is a lot of up-front work to get the job done.

So, I _will_ automate the task of disconnecting and reconnecting from the
ISP - I just don't know how yet. I have just a few more things to try
(although I said that days ago) and I'll get the damn thing working.

Thanks and sorry for not being of the mind and body like you guys are!
I admire you and what you can do with code!
Wilson

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:55:11 von Sherm Pendley

Wilson writes:

> On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
>> In a generic sense, there are literally hundreds of examples of Perl doing what
>> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
>> to see them. There is absolutely no question that Perl is capable of logging
>> into an https web server and performing the moral equivalent of a button click.
>
> Even web pages which seem to require "javascript" in order to view the
> buttons?

No, WWW::Mechanize doesn't run the JavaScript. But to be fair, you didn't mention
the JavaScript requirement - all you said was that Perl couldn't fetch an https
page and click a button. :-)

One approach you might try is viewing the source of the HTML page in your browser,
figuring out what the JS does in a browser, and then writing the same behavior into
your Perl script.

> BTW, I tested the router - it does not need java; just javascript.

JS is annoying enough. Makes me happy I haven't upgraded my ancient BEFSR41. :-)

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:55:11 von Sherm Pendley

Wilson writes:

> On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
>> In a generic sense, there are literally hundreds of examples of Perl doing what
>> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
>> to see them. There is absolutely no question that Perl is capable of logging
>> into an https web server and performing the moral equivalent of a button click.
>
> Even web pages which seem to require "javascript" in order to view the
> buttons?

No, WWW::Mechanize doesn't run the JavaScript. But to be fair, you didn't mention
the JavaScript requirement - all you said was that Perl couldn't fetch an https
page and click a button. :-)

One approach you might try is viewing the source of the HTML page in your browser,
figuring out what the JS does in a browser, and then writing the same behavior into
your Perl script.

> BTW, I tested the router - it does not need java; just javascript.

JS is annoying enough. Makes me happy I haven't upgraded my ancient BEFSR41. :-)

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:56:46 von Bit Twister

On Sat, 24 Nov 2007 18:13:08 GMT, Wilson wrote:

> After calming down, I must apologize for saying "Perl can't do it", as, as
> you noted, I am not a programmer, nor do I have a programmer's mentality
> ... so who am I to say whether it can be done or not. In my frustration, I
> guess I was "blaming" perl but I did not mean to malign that language.

Hey, you can learn to work the computer, or let the computer work you.


> It's just that I really hate it when I have to do anything manual and,
> despite the fact I'm not a programmer-type person, I always try to cut down
> on the number of button clicks I do, even if it's only three or five clicks
> when I do it a lot. I find that makes me much more efficient even if there
> is a lot of up-front work to get the job done.

Yep, computer is nice for automation and repetitive tasks.

> So, I _will_ automate the task of disconnecting and reconnecting from the
> ISP - I just don't know how yet. I have just a few more things to try
> (although I said that days ago) and I'll get the damn thing working.

I do not do windows, I run Mandriva Linux.
I plugged Mechanize into my Software Management application search
box, and 7t'h selection click gave me

perl-WWW-Mechanize-Shell - WWW::Mechanize::Shell - An interactive
shell for WWW::Mechanize

This module implements a www-like shell above WWW::Mechanize and also
has the capability to output crude Perl code that recreates the
recorded session. Its main use is as an interactive starting point for
automating a session through WWW::Mechanize.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 19:56:46 von Bit Twister

On Sat, 24 Nov 2007 18:13:08 GMT, Wilson wrote:

> After calming down, I must apologize for saying "Perl can't do it", as, as
> you noted, I am not a programmer, nor do I have a programmer's mentality
> ... so who am I to say whether it can be done or not. In my frustration, I
> guess I was "blaming" perl but I did not mean to malign that language.

Hey, you can learn to work the computer, or let the computer work you.


> It's just that I really hate it when I have to do anything manual and,
> despite the fact I'm not a programmer-type person, I always try to cut down
> on the number of button clicks I do, even if it's only three or five clicks
> when I do it a lot. I find that makes me much more efficient even if there
> is a lot of up-front work to get the job done.

Yep, computer is nice for automation and repetitive tasks.

> So, I _will_ automate the task of disconnecting and reconnecting from the
> ISP - I just don't know how yet. I have just a few more things to try
> (although I said that days ago) and I'll get the damn thing working.

I do not do windows, I run Mandriva Linux.
I plugged Mechanize into my Software Management application search
box, and 7t'h selection click gave me

perl-WWW-Mechanize-Shell - WWW::Mechanize::Shell - An interactive
shell for WWW::Mechanize

This module implements a www-like shell above WWW::Mechanize and also
has the capability to output crude Perl code that recreates the
recorded session. Its main use is as an interactive starting point for
automating a session through WWW::Mechanize.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 20:04:42 von veatchla

Wilson wrote:
> On Fri, 23 Nov 2007 23:25:23 -0600, l v wrote:
>> My WRT54G (v8.00.2) is not configured the same as yours so I can not
>> test the script for you. Nor does my device connect directly to the
>> internet, rather it sits behind my DSL modem. No connect/disconnect
>> buttons.
>
> Hi lv,
> My WRT54G also sits "behind" a DSL modem.
>
> If you navigate to the Linksys WRT54G "Status -> Router" page, do you see
> the "Disconnect" or "Connect" button?
>
> This connects or disconnects from the DSL modem (depending on whether you
> are already connected or disconnected).

Wilson

As I stated, my WRT54G is configured differently than yours -- no
"disconnect" or "connect" button under "Status -> Router".

While c.l.p.m is not the proper newsgroup for this, I see from your HTML
posting, that you have your WRT54G set to use PPPoE. Mine is not.

Let me guess at your problem. Your DSL modem changes public IP address
on occasion. When it does you need to re-connect your WRT54G to get the
new pubic IP address as well. Am I correct?

I set my WRT54G to use a Static IP (Setup -> Basic Setup). My DSL
modem's IP address is 192.168.1.1

I use the following settings for the WRT54G:
Internet IP Address: . . . 192.168.1.10
Subnet Mask: . . . 255.255.255.0
Gateway: . . .
Static DNS 1: . . . my ISPs 1st DNS server
Static DNS 2: . . . my ISPs 2nd DNS server
Static DNS 3: . . . 0.0.0.0

Local IP Address: . . . 192.168.2.1
Subnet Mask: . . . 255.255.255.0

I then have no need to disconnect and re-connect the WRT54G when my
DSL's pubic ip address changes.

--

Len

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 20:04:42 von veatchla

Wilson wrote:
> On Fri, 23 Nov 2007 23:25:23 -0600, l v wrote:
>> My WRT54G (v8.00.2) is not configured the same as yours so I can not
>> test the script for you. Nor does my device connect directly to the
>> internet, rather it sits behind my DSL modem. No connect/disconnect
>> buttons.
>
> Hi lv,
> My WRT54G also sits "behind" a DSL modem.
>
> If you navigate to the Linksys WRT54G "Status -> Router" page, do you see
> the "Disconnect" or "Connect" button?
>
> This connects or disconnects from the DSL modem (depending on whether you
> are already connected or disconnected).

Wilson

As I stated, my WRT54G is configured differently than yours -- no
"disconnect" or "connect" button under "Status -> Router".

While c.l.p.m is not the proper newsgroup for this, I see from your HTML
posting, that you have your WRT54G set to use PPPoE. Mine is not.

Let me guess at your problem. Your DSL modem changes public IP address
on occasion. When it does you need to re-connect your WRT54G to get the
new pubic IP address as well. Am I correct?

I set my WRT54G to use a Static IP (Setup -> Basic Setup). My DSL
modem's IP address is 192.168.1.1

I use the following settings for the WRT54G:
Internet IP Address: . . . 192.168.1.10
Subnet Mask: . . . 255.255.255.0
Gateway: . . .
Static DNS 1: . . . my ISPs 1st DNS server
Static DNS 2: . . . my ISPs 2nd DNS server
Static DNS 3: . . . 0.0.0.0

Local IP Address: . . . 192.168.2.1
Subnet Mask: . . . 255.255.255.0

I then have no need to disconnect and re-connect the WRT54G when my
DSL's pubic ip address changes.

--

Len

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 20:06:56 von veatchla

Dr.Ruud wrote:
> Wilson schreef:
>
>> If you navigate to the Linksys WRT54G "Status -> Router" page, do you
>> see the "Disconnect" or "Connect" button?
>>
>> This connects or disconnects from the DSL modem (depending on whether
>> you are already connected or disconnected).
>
> Most WAN-routers also have a textual interface (like telnet) that is
> much easier to handle programmatically, so why go the non-easy way?
>

I port scanned my WRT54G when I first got it. Unlike my DSL modem, it
does not respond to telnet nor ssh. I am guessing the OP's wireless
device is the same.

--

Len

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 20:06:56 von veatchla

Dr.Ruud wrote:
> Wilson schreef:
>
>> If you navigate to the Linksys WRT54G "Status -> Router" page, do you
>> see the "Disconnect" or "Connect" button?
>>
>> This connects or disconnects from the DSL modem (depending on whether
>> you are already connected or disconnected).
>
> Most WAN-routers also have a textual interface (like telnet) that is
> much easier to handle programmatically, so why go the non-easy way?
>

I port scanned my WRT54G when I first got it. Unlike my DSL modem, it
does not respond to telnet nor ssh. I am guessing the OP's wireless
device is the same.

--

Len

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 21:36:58 von Ben Morrow

Quoth Wilson :
> On Sat, 24 Nov 2007 15:13:48 +0100, Dr.Ruud wrote:
>
> > Most WAN-routers also have a textual interface (like telnet) that is
> > much easier to handle programmatically, so why go the non-easy way?
>
> I am almost to the point of giving up on Perl so I think I'll follow Ben's
> prior suggestions which seem to be more powerful than Perl.

Err, no; you misunderstood me. The tool I pointed you at (WSP) helps
find out what's actually going on between the browser and the router, so
you can then emulate that in Perl (or anything else, for that matter).
If you were feeling macho you could just run tcpdump and work from
there... :)

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 24.11.2007 21:36:58 von Ben Morrow

Quoth Wilson :
> On Sat, 24 Nov 2007 15:13:48 +0100, Dr.Ruud wrote:
>
> > Most WAN-routers also have a textual interface (like telnet) that is
> > much easier to handle programmatically, so why go the non-easy way?
>
> I am almost to the point of giving up on Perl so I think I'll follow Ben's
> prior suggestions which seem to be more powerful than Perl.

Err, no; you misunderstood me. The tool I pointed you at (WSP) helps
find out what's actually going on between the browser and the router, so
you can then emulate that in Perl (or anything else, for that matter).
If you were feeling macho you could just run tcpdump and work from
there... :)

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 25.11.2007 09:48:30 von hjp-usenet2

["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-11-24 06:31, Wilson wrote:
> On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
>> In a generic sense, there are literally hundreds of examples of Perl doing what
>> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
>> to see them. There is absolutely no question that Perl is capable of logging
>> into an https web server and performing the moral equivalent of a button click.
>
> Even web pages which seem to require "javascript" in order to view the
> buttons?

In the general case, no: You need a JavaScript interpreter for that.

In most realistic cases, yes: The JavaScript code on the page is always
the same, so you just need to find out what it does and reimplement it
in Perl.

hp


--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 25.11.2007 09:48:30 von hjp-usenet2

["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-11-24 06:31, Wilson wrote:
> On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
>> In a generic sense, there are literally hundreds of examples of Perl doing what
>> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
>> to see them. There is absolutely no question that Perl is capable of logging
>> into an https web server and performing the moral equivalent of a button click.
>
> Even web pages which seem to require "javascript" in order to view the
> buttons?

In the general case, no: You need a JavaScript interpreter for that.

In most realistic cases, yes: The JavaScript code on the page is always
the same, so you just need to find out what it does and reimplement it
in Perl.

hp


--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 25.11.2007 10:04:36 von hjp-usenet2

["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-11-24 18:56, Bit Twister wrote:
> On Sat, 24 Nov 2007 18:13:08 GMT, Wilson wrote:
>> It's just that I really hate it when I have to do anything manual and,
>> despite the fact I'm not a programmer-type person, I always try to cut down
>> on the number of button clicks I do, even if it's only three or five clicks
>> when I do it a lot. I find that makes me much more efficient even if there
>> is a lot of up-front work to get the job done.

So Wilson does have a programmer's mind after all.

>> So, I _will_ automate the task of disconnecting and reconnecting from the
>> ISP - I just don't know how yet. I have just a few more things to try
>> (although I said that days ago) and I'll get the damn thing working.
>
> I do not do windows, I run Mandriva Linux.

I didn't realize Wilson is using Windows. If he does he should be able
to use WWW::Mechanize::IE, which lets him use IE's JavaScript
interpreter.

hp

--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 25.11.2007 10:04:36 von hjp-usenet2

["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-11-24 18:56, Bit Twister wrote:
> On Sat, 24 Nov 2007 18:13:08 GMT, Wilson wrote:
>> It's just that I really hate it when I have to do anything manual and,
>> despite the fact I'm not a programmer-type person, I always try to cut down
>> on the number of button clicks I do, even if it's only three or five clicks
>> when I do it a lot. I find that makes me much more efficient even if there
>> is a lot of up-front work to get the job done.

So Wilson does have a programmer's mind after all.

>> So, I _will_ automate the task of disconnecting and reconnecting from the
>> ISP - I just don't know how yet. I have just a few more things to try
>> (although I said that days ago) and I'll get the damn thing working.
>
> I do not do windows, I run Mandriva Linux.

I didn't realize Wilson is using Windows. If he does he should be able
to use WWW::Mechanize::IE, which lets him use IE's JavaScript
interpreter.

hp

--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 25.11.2007 10:23:55 von hjp-usenet2

["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-11-24 18:06, Wilson wrote:
> You have always been the one useful voice of reason. The rest were voices
> of reason, but not useful (like the ones who lambasted my lack of
> programming experience or those who claimed it could be done w/o any
> evidence).

The proof is rather simple.

1) Perl is a turing-complete programming language which provides the
means to communicate over TCP. Therefore any task which can be
described by an algorithm and which only requires communication over
TCP can be implemented in Perl.

2) The task at hand can be done by a human using a standard web browser.

3) The part done by the browser can of course be implemented by a
program since a browser is a program.

4) So the part done by the human remains: Can this be described by an
algorithm? Yes: It requires only a series of simple, precicely
defined steps.

Therefore the whole task can be implemented in Perl.

Of course that proof is not very useful. Writing a whole web-browser in
Perl just to automate such a simple task would be a bit over the top.
But it shows that it can be done in principle, and once you know one way
to do it you can search for simpler ways.

hp


--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 25.11.2007 10:23:55 von hjp-usenet2

["Followup-To:" header set to comp.lang.perl.misc.]
On 2007-11-24 18:06, Wilson wrote:
> You have always been the one useful voice of reason. The rest were voices
> of reason, but not useful (like the ones who lambasted my lack of
> programming experience or those who claimed it could be done w/o any
> evidence).

The proof is rather simple.

1) Perl is a turing-complete programming language which provides the
means to communicate over TCP. Therefore any task which can be
described by an algorithm and which only requires communication over
TCP can be implemented in Perl.

2) The task at hand can be done by a human using a standard web browser.

3) The part done by the browser can of course be implemented by a
program since a browser is a program.

4) So the part done by the human remains: Can this be described by an
algorithm? Yes: It requires only a series of simple, precicely
defined steps.

Therefore the whole task can be implemented in Perl.

Of course that proof is not very useful. Writing a whole web-browser in
Perl just to automate such a simple task would be a bit over the top.
But it shows that it can be done in principle, and once you know one way
to do it you can search for simpler ways.

hp


--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 25.11.2007 10:27:41 von hjp-usenet2

On 2007-11-25 08:48, Peter J. Holzer wrote:
> ["Followup-To:" header set to comp.lang.perl.misc.]
> On 2007-11-24 06:31, Wilson wrote:
>> On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
>>> In a generic sense, there are literally hundreds of examples of Perl doing what
>>> you claim it can't do - just google for "WWW::Mechanize" or "perl web scraping"
>>> to see them. There is absolutely no question that Perl is capable of logging
>>> into an https web server and performing the moral equivalent of a button click.
>>
>> Even web pages which seem to require "javascript" in order to view the
>> buttons?
>
> In the general case, no: You need a JavaScript interpreter for that.

Let me qualify that: It is of course possible to write a JavaScript
interpreter in Perl, so Perl is certainly capable of doing it, it would
just be much more work than you are probably willing to do.

On some platforms there may already be a JavaScript interpreter you can
use from Perl, so you don't have to implement it yourself.

hp

--
_ | Peter J. Holzer | It took a genius to create [TeX],
|_|_) | Sysadmin WSR | and it takes a genius to maintain it.
| | | hjp@hjp.at | That's not engineering, that's art.
__/ | http://www.hjp.at/ | -- David Kastrup in comp.text.tex

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 26.11.2007 14:41:09 von wilson

>> Can you post any working Perl script?
> I'll see if we have it saved somewhere.

I think I've narrowed down the problem to the acceptance of the Linksys
security certificate when the Linksys WRT54G router is first contacted.

The way I tested that was to set it to http instead of https in the router
configuration. Just a few more tries before I give up totally on Perl and
go with something else.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 26.11.2007 14:41:09 von wilson

>> Can you post any working Perl script?
> I'll see if we have it saved somewhere.

I think I've narrowed down the problem to the acceptance of the Linksys
security certificate when the Linksys WRT54G router is first contacted.

The way I tested that was to set it to http instead of https in the router
configuration. Just a few more tries before I give up totally on Perl and
go with something else.

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 26.11.2007 15:37:09 von wilson

On Mon, 26 Nov 2007 05:41:09 -0800, Wilson wrote:
> The way I tested that was to set it to http instead of https

Drat. Failed again.
Does anyone know what a "read timeout" is telling me?
Wilson

C:\perl>fixrouter.pl
500 read timeout
Content-Type: text/plain
Client-Date: Mon, 26 Nov 2007 14:17:22 GMT
Client-Warning: Internal response

500 read timeout

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 26.11.2007 15:37:09 von wilson

On Mon, 26 Nov 2007 05:41:09 -0800, Wilson wrote:
> The way I tested that was to set it to http instead of https

Drat. Failed again.
Does anyone know what a "read timeout" is telling me?
Wilson

C:\perl>fixrouter.pl
500 read timeout
Content-Type: text/plain
Client-Date: Mon, 26 Nov 2007 14:17:22 GMT
Client-Warning: Internal response

500 read timeout

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 26.11.2007 16:17:00 von Ben Morrow

[f'ups set to clpm. Please stop cross-posting everything.]

Quoth Wilson :
> On Mon, 26 Nov 2007 05:41:09 -0800, Wilson wrote:
> > The way I tested that was to set it to http instead of https
>
> Drat. Failed again.
> Does anyone know what a "read timeout" is telling me?
>
> C:\perl>fixrouter.pl
> 500 read timeout
> Content-Type: text/plain
> Client-Date: Mon, 26 Nov 2007 14:17:22 GMT
> Client-Warning: Internal response
>
> 500 read timeout

The Client-Warning says this response is faked by LWP, and the message
says that, well, a read timed out. The server isn't responding
sufficiently promptly: set a longer timeout with $ua->timeout, or find
out why it's failing to respond.

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 26.11.2007 16:17:00 von Ben Morrow

[f'ups set to clpm. Please stop cross-posting everything.]

Quoth Wilson :
> On Mon, 26 Nov 2007 05:41:09 -0800, Wilson wrote:
> > The way I tested that was to set it to http instead of https
>
> Drat. Failed again.
> Does anyone know what a "read timeout" is telling me?
>
> C:\perl>fixrouter.pl
> 500 read timeout
> Content-Type: text/plain
> Client-Date: Mon, 26 Nov 2007 14:17:22 GMT
> Client-Warning: Internal response
>
> 500 read timeout

The Client-Warning says this response is faked by LWP, and the message
says that, well, a read timed out. The server isn't responding
sufficiently promptly: set a longer timeout with $ua->timeout, or find
out why it's failing to respond.

Ben

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 26.11.2007 19:00:12 von wilson

On Mon, 26 Nov 2007 15:17:00 +0000, Ben Morrow wrote:

> The Client-Warning says this response is faked by LWP, and the message
> says that, well, a read timed out. The server isn't responding
> sufficiently promptly: set a longer timeout with $ua->timeout, or find
> out why it's failing to respond.

Since it takes a good minute or two to timeout, I suspect it's the former
and not the latter. I think the server isn't responding. Dunno why yet.

When I telnet to the router's port 80 (with https disabled), I can *talk*
to the Linksys WRT54G router, for example

c:\perl> telnet 192.168.0.1 80
HEAD / HTTP/1.0

Going further, I can "access" the desired web page
c:\perl> telnet 192.168.0.1 80
GET /StaRouter.htm HTTP/1.0

Which spits out:
HTTP/1.0 401 Unauthorized Access Denied
Server: Intoto Http Server v1.0
WWW-Authenticate: Basic realm="WRT54G"
Content-type: text/html
Pragma: no-cache
Connection: Close

401 Unauthorized

401 Unauthorized


Authorization required.


So, I think I'll look up the commands to log into the router using telnet
to port 80. If that works, I can write a telnetrc script. I'm no
programmer, but, I really hate to lose something that should be as simple
as a few lines of code.

Wilson



Connection to host lost.

C:\Documents and Settings\admin>

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 29.11.2007 00:58:34 von christoph_un

Hello,
I managed to reconnect my WRT54GL via perl from my Linux box.

Here is my script:

#!/usr/bin/perl -w

use strict;
use warnings;
use LWP;
use HTTP::Request::Common;

our $ua = LWP::UserAgent->new;

$ua->request(POST 'http://admin:letmein@192.168.10.10/apply.cgi',
[submit_button => 'Status_Router', submit_type => 'Disconnect_pppoe',
change_action => 'gozila_cgi', wan_proto => 'pppoe']);

sleep 5;

$ua->request(POST 'http://admin:letmein@192.168.10.10/apply.cgi',
[submit_button => 'Status_Router', submit_type => 'Connect_pppoe',
change_action => 'gozila_cgi', wan_proto => 'pppoe']);



This might not work for your router right away, but you may tweak it
to
your own needs. The important thing is setting the correct POST
variables. A network sniffer like Wireshark (www.wireshark.org) is
really handy for that. Just sniff a disconnect and right click on any
of
the packets of your HTTP Session and choose "Follow TCP stream". On
top
of the output you will find the whole header and beneath it there is a
line with all the POST variables. Mine looked like this:

submit_button=Status_Router&submit_type=Disconnect_pppoe&cha nge_action=gozila_cgi&wan_proto=pppoe

Repeat this procedure for connecting and you are done.

Also make sure which script is called (first line of the header). My
Status_Router.asp did not call itself but apply.cgi.

Note that my way of parsing username and password via URL is really
insecure so only use it in a trusted network.

Greetings,

Christoph

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 17.01.2008 18:14:00 von John Navas

You omitted the security issue. Leaving the router wide open for a Perl
script is like unprotected sex, and the security programming in Perl is
non-trivial to do safely.


On Thu, 17 Jan 2008 03:05:57 -0800 (PST), stuart.t.taylor@gmail.com
wrote in
:

>I stumbled across this posting quite by chance.
>
>I don't own that router, but what you are trying to archive is a cake
>walk for perl even without the mechanize stuff.
>
>Your main problem is that your are focusing on the perl and not on the
>html that controls the router. I see you posted the complete source of
>the page, but i'll be buggered if i work my way through that for you,
>after all i have no interest in your "project" other than to nudge you
>in the right direction.
>
>You need to go back to square one.
>
>Get firefox if haven't got it already, and install the live headers
>plugin.
>The with the plugin activated, browse to the page and click the button
>as you normally would.
>You should now have captured all of the conversation between your
>browser and you router. Among the general noise of HTTP will be the
>small requests actually required to send the connect / disconnect
>command to the router.
>
>At the end of the day, the button are on an html form (regardless of
>the javascript functions) and they will submit some data to the router
>via get or post, and you need to determine what that is.
>
>Recreating the steps in perl will be trivial (you will kick yourself).
>
>Good luck.
>
>Stuart
>
>
>On 26 Nov 2007, 14:37, Wilson wrote:
>> On Mon, 26 Nov 2007 05:41:09 -0800, Wilson wrote:
>> > The way I tested that was to set it to http instead of https
>>
>> Drat. Failed again.
>> Does anyone know what a "read timeout" is telling me?
>> Wilson
>>
>> C:\perl>fixrouter.pl
>> 500 read timeout
>> Content-Type: text/plain
>> Client-Date: Mon, 26 Nov 2007 14:17:22 GMT
>> Client-Warning: Internal response
>>
>> 500 read timeout

--
Best regards, FAQ for Wireless Internet:
John Navas FAQ for Wi-Fi:
Wi-Fi How To:
Fixes to Wi-Fi Problems:

Re: Script to disconnect Linksys WRT54G wireless router on Windows

am 17.01.2008 18:14:00 von John Navas

You omitted the security issue. Leaving the router wide open for a Perl
script is like unprotected sex, and the security programming in Perl is
non-trivial to do safely.


On Thu, 17 Jan 2008 03:05:57 -0800 (PST), stuart.t.taylor@gmail.com
wrote in
:

>I stumbled across this posting quite by chance.
>
>I don't own that router, but what you are trying to archive is a cake
>walk for perl even without the mechanize stuff.
>
>Your main problem is that your are focusing on the perl and not on the
>html that controls the router. I see you posted the complete source of
>the page, but i'll be buggered if i work my way through that for you,
>after all i have no interest in your "project" other than to nudge you
>in the right direction.
>
>You need to go back to square one.
>
>Get firefox if haven't got it already, and install the live headers
>plugin.
>The with the plugin activated, browse to the page and click the button
>as you normally would.
>You should now have captured all of the conversation between your
>browser and you router. Among the general noise of HTTP will be the
>small requests actually required to send the connect / disconnect
>command to the router.
>
>At the end of the day, the button are on an html form (regardless of
>the javascript functions) and they will submit some data to the router
>via get or post, and you need to determine what that is.
>
>Recreating the steps in perl will be trivial (you will kick yourself).
>
>Good luck.
>
>Stuart
>
>
>On 26 Nov 2007, 14:37, Wilson wrote:
>> On Mon, 26 Nov 2007 05:41:09 -0800, Wilson wrote:
>> > The way I tested that was to set it to http instead of https
>>
>> Drat. Failed again.
>> Does anyone know what a "read timeout" is telling me?
>> Wilson
>>
>> C:\perl>fixrouter.pl
>> 500 read timeout
>> Content-Type: text/plain
>> Client-Date: Mon, 26 Nov 2007 14:17:22 GMT
>> Client-Warning: Internal response
>>
>> 500 read timeout

--
Best regards, FAQ for Wireless Internet:
John Navas FAQ for Wi-Fi:
Wi-Fi How To:
Fixes to Wi-Fi Problems: