
Script to disconnect Linksys WRT54G wireless router on Windows
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
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" <davewilson69 [at] sbcglobal.net> wrote in message
news:Dwj0j.46096$eY.45009 [at] 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
Wilson <davewilson69 [at] sbcglobal.net> 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:
<http://www.kratronic.com/recorder/> ($23)
<http://www.aldostools.com/macro.html>
<http://www.jitbit.com/macrorecorder.aspx>
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 [at] 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
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
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
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
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
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
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 <http://www.linpro.no/lwp/libwww-perl/README.SSL>.
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
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
Quoth Wilson <davewilson69 [at] sbcglobal.net>:
> 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
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 [at] cryptsoft.com). This product
includes software written by Tim J. Hudson (tjh [at] 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
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
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
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
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
[f'ups to clpm]
Quoth Wilson <davewilson69 [at] sbcglobal.net>:
> 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
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 <http://www.linpro.no/lwp/libwww-perl/README.SSL>.
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
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
Quoth Wilson <davewilson69 [at] sbcglobal.net>:
> 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
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 [at] cryptsoft.com). This product
includes software written by Tim J. Hudson (tjh [at] 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
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
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
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
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
[f'ups to clpm]
Quoth Wilson <davewilson69 [at] sbcglobal.net>:
> 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
Wilson <davewilson69 [at] sbcglobal.net> 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:
<http://www.dd-wrt.com/wiki/index.php/Installation>
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 [at] 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
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
Wilson <davewilson69 [at] sbcglobal.net> 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
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
Wilson <davewilson69 [at] sbcglobal.net> 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
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
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
In comp.security.firewalls Wilson <davewilson69 [at] sbcglobal.net> 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
Quoth Wilson <davewilson69 [at] sbcglobal.net>:
> 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
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
Wilson <davewilson69 [at] sbcglobal.net> 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
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
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
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