Script to disconnect Linksys WRT54G wireless router on Windows - Page 2

Have a question or want to start a discussion? Post it! No Registration Necessary.  Now with pictures!

Threaded View
Re: Script to disconnect Linksys WRT54G wireless router on Windows
On Thu, 22 Nov 2007 08:27:27 -0500, Sherman Pendley wrote:
Quoted text here. Click to load it

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:

Quoted text here. Click to load it

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

Quoted text here. Click to load it

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 02:40:00 +0000, Ben Morrow wrote:
Quoted text here. Click to load it

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 02:40:00 +0000, Ben Morrow wrote:

Quoted text here. Click to load it

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
["Followup-To:" header set to comp.lang.perl.misc.]
Quoted text here. Click to load it

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

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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 10:47:50 -0500, Sherman Pendley wrote:
Quoted text here. Click to load it

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

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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 :).

Quoted text here. Click to load it

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
On Fri, 23 Nov 2007 19:27:26 +0000, Ben Morrow wrote:
Quoted text here. Click to load it

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

Quoted text here. Click to load it

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
On Fri, 23 Nov 2007 22:24:21 +0000, Ben Morrow wrote:

Quoted text here. Click to load it

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

Re: Script to disconnect Linksys WRT54G wireless router on Windows
On Fri, 23 Nov 2007 22:24:21 +0000, Ben Morrow wrote:
Quoted text here. Click to load it

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


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- <HTML><HEAD><TITLE>Router Status</TITLE> -->
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=expires content=0>
<META http-equiv=cache-control content=no-cache>
<META http-equiv=pragma content=no-cache>

<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">

<LINK href="style.css" type=text/css rel=stylesheet>
<STYLE fprolloverstyle>A:hover {
    COLOR: #00ffff
}
.small A:hover {
    COLOR: #00ffff
}
</STYLE>

<SCRIPT src="common.js"></SCRIPT>
<script language="javascript" type="text/javascript"
src="capstatus.js"></script>

<script language="javascript" type="text/javascript"
src="share.js"></script>
<script language="javascript" type="text/javascript"
src="help.js"></script>
<SCRIPT language=JavaScript>
var refresh_time = "";
var flag=0;
function DHCPAction(F,I)
{
    F.action.value=I;
    F.submit();
}

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

function GetWAN()
{
var F=document.status;
    var wan_num=F.wan_pro.value;
        if(wan_num==2){
        if
(((F.conn_stats.value=="-1")&&(status2!="Connecting"))||((F.conn_stats.value=="201")&&(status2!="Connecting"))||((F.conn_stats.value=="202")&&(status2!="Connecting"))||((F.conn_stats.value=="203")&&(status2!="Connecting"))||((F.conn_stats.value=="200")&&(status2!="Connecting"))){
            flag = 1;
            F.butConn.value=stacontent.connect;
        }
        else{
            F.butConn.value=stacontent.disconnect;
            flag = 0;
        }
    }
    else if((wan_num==3) || (wan_num==4) || (wan_num==5)){
        if((F.conn_stats.value=="-1")&&(status2!="Connecting")){
            flag = 1;
            F.butConn.value=stacontent.connect;
        }
        else{
            flag = 0;
            F.butConn.value=stacontent.disconnect;
        }
    }
}
function ShowAlert(M)
{
    var str = "";
    var mode = "";
    /* */
    var wan_ip = "69.110.22.230";

    if(document.status.wan_pro.value == 2)
        mode = "PPPoE";
    else if(document.status.wan_pro.value == 3)
           mode = "PPTP";
    else if(document.status.wan_pro.value == 4)
           mode = "L2TP";
    else if(document.status.wan_pro.value == 5)
        mode = "HBS";          
    else
               mode = "PPPoE";

    if(M == "AUTH_FAIL" || M == "PAP_AUTH_FAIL" || M == "CHAP_AUTH_FAIL")
        str = mode +  stacontent.authfail;
    else if(M == "IP_FAIL" || (M == "TIMEOUT" && wan_ip == "0.0.0.0"))
                str = stacontent.notgetip + mode + stacontent.wansrv +
stacontent.wansrvlastwords;
        else if(M == "LCP_FAIL")
                str = mode + stacontent.lcpfail;
        else if(M == "TCP_FAIL" || (M == "TIMEOUT" && wan_ip != "0.0.0.0"
&& (document.status.wan_pro.value == 5)))
            str = stacontent.notcpconn + mode + stacontent.wansrv;                
           else
        str = stacontent.notconn + mode + stacontent.wansrv;

    alert(str);

    Refresh();
}
var value=0;
function Refresh()
{
    if(refresh_time == "")    refresh_time = 60000;    
    if (value>=1)
    {
        window.location.replace("StaRouter.htm");
    }
    value++;
    timerID=setTimeout("Refresh()",refresh_time);
}
function ViewDHCP()
{
    dhcp_win =
self.open('DHCPTable.htm','inLogTable','alwaysRaised,resizable,scrollbars,width=720,height=600');
    dhcp_win.focus();
}
function init()
{
  var F=document.status;
  var wan_num=F.wan_pro.value;
  if((wan_num>=2) && (wan_num <= 5)){
    document.status.butConn.value=stacontent.connect;
  }  
  if(wan_num==0){
    document.status.dhcprelease.value=share.dhcprelease;
    document.status.dhcprenew.value=share.dhcprenew;
  }
    document.title=share.router;
    document.status.refresh.value=sbutton.refresh;
    GetWAN();

    Refresh();
/**/
}

</SCRIPT>

<META content="MSHTML 6.00.2800.1226" name=GENERATOR></HEAD>
<BODY onload=init()>
<DIV align=center>
<FORM name=status action="rstatus.tri" method=post>
<input type="hidden" name="action">
<TABLE cellSpacing=0 cellPadding=0 width=809 border=0>
  <TBODY>
  <TR>

    <TD width=95><IMG height=57 src="UILinksys.gif" width=165
      border=0></TD>
    <TD vAlign=bottom align=right width=714 bgColor=#6666cc><FONT
      style="FONT-SIZE: 7pt" color=#ffffff><FONT
face=Arial><script>Capture(share.firmwarever)</script>:&nbsp;v1.02.0
&nbsp;&nbsp;&nbsp;</FONT></FONT></TD></TR>
  <TR>
    <TD width=808 bgColor=#6666cc colSpan=2><IMG height=11
      src="UI_10.gif" width=809 border=0></TD></TR></TBODY></TABLE>
<TABLE height=77 cellSpacing=0 cellPadding=0 width=809 bgColor=black
border=0>
  <TBODY>
  <TR>
    <TD
    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>

      <H3 style="MARGIN-TOP: 1px; MARGIN-BOTTOM: 1px"><FONT
      style="FONT-SIZE: 15pt" face=Arial
color=#ffffff><script>Capture(bmenu.statu)</script></FONT></H3></TD>
    <TD
    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>
      <TABLE
      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>
        <TBODY>
        <TR>
          <TD style="FONT-WEIGHT: bolder; FONT-SIZE: 10pt" align=right
          bgColor=#6666cc height=33><FONT
color=#ffffff><script>Capture(share.productname)</script>&nbsp;&nbsp;</FONT></TD>
          <TD borderColor=#000000 borderColorLight=#000000 align=middle
          width=109 bgColor=#000000 borderColorDark=#000000 height=12
            rowSpan=2><FONT color=#ffffff><SPAN
            style="FONT-SIZE: 8pt"><B>WRT54G</B></SPAN></FONT></TD></TR>

        <TR>
          <TD
          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>&nbsp;</TD></TR>
        <TR>
          <TD width=646 bgColor=#000000 colSpan=2 height=32>
            <TABLE id=AutoNumber1
            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>
              <TBODY>
              <TR
              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>
                <TD width=83 height=1><IMG height=10
                  src="UI_06.gif" width=83 border=0></TD>
                <TD width=73 height=1><IMG height=10
                  src="UI_06.gif" width=83 border=0></TD>

                <TD width=113 height=1><IMG height=10
                  src="UI_06.gif" width=83 border=0></TD>
                <TD width=103 height=1><IMG height=10
                  src="UI_06.gif" width=103 border=0></TD>
                <TD width=85 height=1><IMG height=10
                  src="UI_06.gif" width=100 border=0></TD>
                <TD width=115 height=1><IMG height=10
                  src="UI_06.gif" width=115 border=0></TD>
                <TD width=74 height=1><IMG height=10
                  src="UI_07.gif" width=79 border=0></TD></TR>
              <TR>
                <TD align=middle bgColor=#000000 height=20><FONT
                  style="FONT-WEIGHT: 700" color=#ffffff><A
                  style="TEXT-DECORATION: none"

href="basic.htm"><script>Capture(bmenu.setup)</script></A></FONT></TD>
                <TD align=middle bgColor=#000000 height=20><FONT
                  style="FONT-WEIGHT: 700" color=#ffffff><A
                  style="TEXT-DECORATION: none"

href="Wireless.htm"><script>Capture(bmenu.wireless)</script></A></FONT></TD>

                <TD align=middle bgColor=#000000 height=20><FONT
                  style="FONT-WEIGHT: 700" color=#ffffff><A
                  style="TEXT-DECORATION: none"

href="Firewall.htm"><script>Capture(bmenu.security)</script></A></FONT></TD>
                <TD align=middle bgColor=#000000 height=20><FONT
                  style="FONT-WEIGHT: 700" color=#ffffff><A
                  style="TEXT-DECORATION: none"

href="Filters.htm"><script>Capture(bmenu.accrestriction)</script></A></FONT></TD>
                <TD align=middle bgColor=#000000 height=20>
                  <P style="MARGIN-BOTTOM: 4px"><FONT style="FONT-WEIGHT:
700"
                  color=#ffffff><A style="TEXT-DECORATION: none"

href="Forward.htm"><script>Capture(bmenu.applications)</script><BR>&amp;

<script>Capture(bmenu.gaming)</script></A>&nbsp;&nbsp;&nbsp;&nbsp;</FONT></P></TD>
                <TD align=middle bgColor=#000000 height=20>
                  <P style="MARGIN-BOTTOM: 4px"><FONT style="FONT-WEIGHT:
700"
                  color=#ffffff><A style="TEXT-DECORATION: none"

href="Manage.htm"><script>Capture(bmenu.admin)</script></A>&nbsp;&nbsp;&nbsp;&nbsp;</FONT></P></TD>

                <TD align=middle bgColor=#6666cc height=20>
                  <P style="MARGIN-BOTTOM: 4px"><FONT style="FONT-WEIGHT:
700"
                  color=#ffffff><A style="TEXT-DECORATION: none"

href="StaRouter.htm"><script>Capture(bmenu.statu)</script></A>&nbsp;&nbsp;&nbsp;&nbsp;</FONT></P></TD></TR>
              <TR>
                <TD width=643 bgColor=#6666cc colSpan=7 height=21>
                  <TABLE borderColor="black" height="21" cellSpacing="0"
cellPadding="0">
                    <TBODY>
                    <TR align=left>
                      <TD width=25></TD>

                      <TD width=65><FONT style="COLOR:
white"><script>Capture(share.router)</script></FONT></TD>
                      <TD>
                        <P class=bar><FONT
color=white><B>|</B></FONT></P></TD>
                      <TD width=25></TD>
                      <TD class=small width=100><A

href="StaLan.htm"><script>Capture(share.localnet)</script></A></TD>
                      <TD>
                        <P class=bar><FONT
color=white><B>|</B></FONT></P></TD>

                      <TD width=25></TD>
                      <TD class=small width=100><SPAN>&nbsp;</SPAN><A

href="StaWlan.htm"><script>Capture(bmenu.wireless)</script></A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE height=5 cellSpacing=0 cellPadding=0 width=806 bgColor=black
border=0>
  <TBODY>
  <TR bgColor=black>
    <TD
    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><IMG height=15
      src="UI_03.gif" width=164 border=0></TD>
    <TD
    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><IMG height=15 src="UI_02.gif" width=645
      border=0></TD></TR></TBODY></TABLE>

<INPUT type=hidden value="2" name=wan_pro>
<INPUT type=hidden value="300" name=conn_stats>

<TABLE id=AutoNumber9 style="BORDER-COLLAPSE: collapse" borderColor=#111111
height=23 cellSpacing=0 cellPadding=0 width=809 border=0>
  <TBODY>
  <TR>
    <TD width=633>
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD width=156 bgColor=#000000 height=25>
            <P align=right><B><FONT style="FONT-SIZE: 9pt" face=Arial

color=#ffffff><script>Capture(share.routerinfo)</script></B></P></FONT></TD>

          <TD width=8 bgColor=#000000 height=25>&nbsp;</TD>
          <TD width=14 height=25>&nbsp;</TD>
          <TD width=17 height=25>&nbsp;</TD>
          <TD width=13 height=25>&nbsp;</TD>
          <TD width=101 height=25>&nbsp;</TD>
          <TD width=296 height=25>&nbsp;</TD>
          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>

          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD width=101
height=25><script>Capture(share.firmwarever)</script>:</TD>
          <TD><B>v1.02.0, <script>Capture(month.num1)</script>. 16, 2007
</B></TD>
          <TD width=13 height=25>&nbsp;</TD>

          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD width=101
height=25><script>Capture(share.curtime)</script>:</TD>
          <TD><B><script>Capture(week.num6)</script>,
<script>Capture(month.num11)</script> 23 2007 22:35:32 </B></TD>

          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD width=101
height=25><script>Capture(share.macaddr)</script>:</TD>
          <TD><B>B1:B1:A1:A1:32:00</B></TD>

          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD width=101
height=25><script>Capture(share.routename)</script>:</TD>
          <TD style="word-wrap:break-word;
word-break:break-all"><B><script>Capture("WRT54G")</script></B></TD>

          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD width=101
height=25><script>Capture(share.hostname)</script>:</TD>
          <TD style="word-wrap:break-word;
word-break:break-all"><B><script>Capture("")</script></B></TD>

          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD width=101
height=25><script>Capture(share.domainname)</script>:</TD>
          <TD style="word-wrap:break-word;
word-break:break-all"><B><script>Capture("")</script></B></TD>

          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#000000 height=25>
            <P align=right><B><FONT style="FONT-SIZE: 9pt"
color=#ffffff><SPAN><script>Capture(share.internet)</script></SPAN></FONT></B></P></TD>
          <TD width=8 bgColor=#000000 height=25>&nbsp;</TD>
          <TD colSpan=6>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>

        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>
            <P align=right><FONT style="FONT-WEIGHT:
700"><SPAN><script>Capture(share.cfgtype)</script></SPAN></FONT></P></TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD width=101
height=25><SPAN><script>Capture(stacontent.logtype)</script></SPAN><FONT
            style="FONT-SIZE: 8pt">:</FONT></TD>
          <TD><B>PPPoE</B></TD>

          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
<script language="javascript">
      if((document.status.wan_pro.value>=2) &&
(document.status.wan_pro.value<=5)){
        document.write("<TR>");
        document.write("<TD width=156 bgColor=#e7e7e7
height=25>&nbsp;</TD>");
        document.write("<TD width=8 background=UI_04.gif
height=25>&nbsp;</TD>");
        document.write("<TD colSpan=3 height=25>&nbsp;</TD>");
        document.write("<TD><FONT style='FONT-SIZE:
8pt'>"+stacontent.logsta+":</FONT></TD>");
        document.write("<TD><FONT style='FONT-SIZE: 8pt'><B>");
        var F=document.status;
        
        var status2 = "Connected";
        if(status2 == "Connecting")         sta2 = stacontent.connecting;
        else    if(status2 == "Disconnected")   sta2 = stacontent.disconn;
        else    if(status2 == "Connected")      sta2 = stacontent.conn;
    document.write(sta2);
    document.write("&nbsp;&nbsp;");

        /*
        if( (F.conn_stats.value=="200") || (F.conn_stats.value=="201")||
(F.conn_stats.value=="202")|| (F.conn_stats.value=="203") )
              document.write("Connecting");
        else if(F.conn_stats.value=="300")
             document.write("Connected");
        else
             document.write("Disconnected");        
        Disconnected=stacontent.disconn;
        Connected=stacontent.conn;
        if(document.forms[0].conn_stats.value=="0")
          document.write(Disconnected);
        else
          document.write(Connected);
          */

          
        document.write("<INPUT type=button name=butConn value='Connect'
onClick='ConnStats(this)'>");
        document.write("</B></FONT></TD>");
        document.write("<TD width=13 height=25>&nbsp;</TD>");
        document.write("<TD width=15 background=UI_05.gif
height=25>&nbsp;</TD></TR>");
        }
</script>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD><FONT style="FONT-SIZE:
8pt"><script>Capture(share.ipaddr)</script>:</FONT></TD>

          <TD><FONT style="FONT-SIZE: 8pt"><B>69.110.22.230</B></FONT></TD>
          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 height=25><IMG height=30 src="UI_04.gif"
            width=8 border=0></TD>
          <TD bgColor=#ffffff colSpan=3 height=25>&nbsp;</TD>
          <TD width=101 bgColor=#ffffff height=25><FONT
            style="FONT-SIZE:
8pt"><script>Capture(share.submask)</script>:</FONT></TD>

          <TD width=296 bgColor=#ffffff height=25><FONT
            style="FONT-SIZE: 8pt"><B>255.255.255.255</B></FONT></TD>
          <TD width=13 bgColor=#ffffff height=25>&nbsp;</TD>
          <TD width=15 bgColor=#ffffff height=25><IMG height=30
            src="UI_05.gif" width=15 border=0></TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 height=25><IMG height=30 src="UI_04.gif"
            width=8 border=0></TD>
          <TD bgColor=#ffffff colSpan=3 height=25>&nbsp;</TD>
          <TD width=101 bgColor=#ffffff height=25><FONT
            style="FONT-SIZE:
8pt"><script>Capture(share.defgateway)</script></FONT></TD>

          <TD width=296 bgColor=#ffffff height=25><FONT
            style="FONT-SIZE: 8pt"><B>151.164.184.81</B></FONT></TD>
          <TD width=13 bgColor=#ffffff height=25>&nbsp;</TD>
          <TD width=15 bgColor=#ffffff height=25><IMG height=30
            src="UI_05.gif" width=15 border=0></TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD><FONT style="FONT-SIZE:
8pt"><script>Capture(stacontent.dns1)</script>:</FONT></TD>

          <TD><FONT style="FONT-SIZE: 8pt"><B>68.94.156.1</B></FONT></TD>
          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD height=25><FONT style="FONT-SIZE:
8pt"><script>Capture(stacontent.dns2)</script>:</FONT></TD>

          <TD height=25><FONT style="FONT-SIZE:
8pt"><B>68.94.157.1</B></FONT></TD>
          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD height=25><FONT style="FONT-SIZE:
8pt"><script>Capture(stacontent.dns3)</script>:</FONT></TD>

          <TD height=25><FONT style="FONT-SIZE: 8pt"><B></B></FONT></TD>
          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD height=25><FONT style="FONT-SIZE:
8pt"><script>Capture(share.mtu)</script>:</FONT></TD>

          <TD height=25><FONT style="FONT-SIZE:
8pt"><B>1492</B></FONT></TD>
          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=1>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=1>&nbsp;</TD>
          <TD colSpan=6>
            <TABLE>

              <TBODY>
              <TR>
                <TD width=16 height=1>&nbsp;</TD>
                <TD width=13 height=1>&nbsp;</TD>
                <TD width=410 colSpan=3 height=1>
                  <HR color=#b5b5e6 SIZE=1>
                </TD>
                <TD width=15 height=1>&nbsp;</TD></TR></TBODY></TABLE></TD>
          <TD width=15 background=UI_05.gif height=1>&nbsp;</TD></TR>


     <TR>
          <TD width=156 bgColor=#e7e7e7 height=25>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=25>&nbsp;</TD>
          <TD colSpan=3 height=25>&nbsp;</TD>
          <TD height=25><INPUT type=hidden value=en name=layout></TD>
          <TD height=25>&nbsp;</TD>
          <TD width=13 height=25>&nbsp;</TD>
          <TD width=15 background=UI_05.gif height=25>&nbsp;</TD></TR>

<script language=javascript>
if(document.status.layout.value=="de"){
document.write(other.block6);
}
</script>
<script language="javascript">
            if(document.status.wan_pro.value==0){
              document.write("<TR><TD width=156 bgColor=#e7e7e7
height=25>&nbsp;</TD>");
              document.write("<TD width=8 background=UI_04.gif
height=25>&nbsp;</TD>");
              document.write("<TD colSpan=3 height=25>&nbsp;</TD>");
              document.write("<TD colSpan=2 height=25><INPUT
onclick=DHCPAction(this.form,'release') name='dhcprelease' type=button
value="+share.dhcprelease+">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT
onclick=DHCPAction(this.form,'renew') name='dhcprenew' type=button
value="+share.dhcprenew+">&nbsp;</TD>");
<!--          document.write("<TD colSpan=2 height=25><INPUT
onclick=DHCPAction(this.form,'release') name='dhcprelease' type=button
value='DHCP Release'>&nbsp;&nbsp;&nbsp;&nbsp;<INPUT
onclick=DHCPAction(this.form,'renew') name='dhcprenew' type=button
value='DHCP Renew'>&nbsp;</TD>"); -->              
              document.write("<TD width=13 height=25>&nbsp;</TD>");
              document.write("<TD width=15 background=UI_05.gif
height=25>&nbsp;</TD></TR>");
            }
</script>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=5>&nbsp;</TD>
          <TD width=8 background=UI_04.gif height=5>&nbsp;</TD>
          <TD colSpan=6>&nbsp;</TD>
          <TD width=15 background=UI_05.gif
height=5>&nbsp;</TD></TR></TBODY></TABLE></TD>
    <TD vAlign=top width=176 bgColor=#6666cc>

      <TABLE cellSpacing=0 cellPadding=0 width=176 border=0>
        <TBODY>
        <TR>
          <TD width=11 bgColor=#6666cc height=25>&nbsp;</TD>
          <TD width=156 bgColor=#6666cc height=25><FONT
color=#ffffff><SPAN><br>
<script>Capture(hstatus.phase23)</script>
<b><a target="_blank"
href="HStatus.htm"><script>Capture(share.more)</script></a></b></span><br><br>
<script>Capture(hstatus.phase24)</script>
            <b><A href="HStatus.htm"
target=_blank><script>Capture(share.more)</script></A></b></SPAN></FONT></TD>

          <TD width=9 bgColor=#6666cc
  height=25>&nbsp;</TD></TR></TBODY></TABLE></TD></TR>
  <TR>
    <TD width=809 colSpan=2>
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD width=156 bgColor=#e7e7e7 height=30>&nbsp;</TD>
          <TD width=8 background=UI_04.gif>&nbsp;</TD>
          <TD width=131>&nbsp;</TD>

          <TD width=323>&nbsp;</TD>
          <TD width=15 background=UI_05.gif>&nbsp;</TD>
          <TD width=176 bgColor=#6666cc rowSpan=2><IMG height=64
            src="UI_Cisco.gif" width=176 border=0></TD></TR>
        <TR>
          <TD width=156 bgColor=#000000>&nbsp;</TD>
          <TD width=8 bgColor=#000000>&nbsp;</TD>
          <TD width=131 bgColor=#6666cc>&nbsp;</TD>
          <TD width=323 bgColor=#6666cc>
            <DIV align=right>

            <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111
            height=19 cellSpacing=0 cellPadding=0 width=33 border=0>
              <TBODY>
              <TR>
                <TD align=middle width=61>
                <script language="javascript">
                document.write("<INPUT
onclick=window.location.replace('StaRouter.htm') type=button name=refresh
value="+sbutton.refresh+">")
                </script>
                </TD>
<!--                <INPUT
onclick="window.location.replace('StaRouter.htm')" type=button
name="refresh" value="Refresh"> -->
                <TD align=middle width=4
            bgColor=#6666cc>&nbsp;</TD></TR></TBODY></TABLE></DIV></TD>
          <TD width=15 bgColor=#000000

height=33>&nbsp;</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></FORM></DIV></BODY></HTML>

Re: Script to disconnect Linksys WRT54G wireless router on Windows

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

Absence of proof is not proof of absence.

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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
On Fri, 23 Nov 2007 16:54:36 -0500, Sherman Pendley wrote:
Quoted text here. Click to load it

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

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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
["Followup-To:" header set to comp.lang.perl.misc.]
Quoted text here. Click to load it

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
Quoted text here. Click to load 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
On Fri, 23 Nov 2007 00:43:08 +0000, Wilson wrote:

Quoted text here. Click to load it

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
On Fri, 23 Nov 2007 04:23:59 -0000, tramp wrote:
Quoted text here. Click to load it
agreed. That's why I'm asking here.

Quoted text here. Click to load it
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.

Quoted text here. Click to load it
agreed.
However an experienced programmer wrote the original script & it failed to
reboot the router.

Quoted text here. Click to load it
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.

Quoted text here. Click to load it
The original perl script never worked for anyone, not even the original
programmer. He did his best. So did I. Both failed.

Quoted text here. Click to load it
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?

Quoted text here. Click to load it
I've turned off the software firewall for the testing

Quoted text here. Click to load it
Another good one. What is the basic test of that?

Quoted text here. Click to load it
Yet another good one. How would we test this?
 
Quoted text here. Click to load it
Ah. This is the big kehuna. Can perl issue commands to a router or not?

Quoted text here. Click to load it
The reboot script never worked even for the original programmer. He said it
was the best he could do in perl.

Site Timeline