how to hack this setTimeout() ??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hoc Phan

    how to hack this setTimeout() ??

    I wonder if there is a way to change some variable of Javascript in an
    html while running? For example, I load this page in IE. The page use
    setTimeout() in order to call Submit of a form in 10 min. I wonder if
    there is a way to change the time. Generally speaking, is there a way
    to access into variables of Javascript while running?
    Thank you.
  • Evertjan.

    #2
    Re: how to hack this setTimeout() ??

    Hoc Phan wrote on 13 jun 2004 in comp.lang.javas cript:
    [color=blue]
    > I wonder if there is a way to change some variable of Javascript in an
    > html while running? For example, I load this page in IE. The page use
    > setTimeout() in order to call Submit of a form in 10 min. I wonder if
    > there is a way to change the time. Generally speaking, is there a way
    > to access into variables of Javascript while running?
    >[/color]

    mytimeout = setTimeout('do( )',20000)

    later reset the time by:

    mytimeout = setTimeout('do( )',400)


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • Hoc Phan

      #3
      Re: how to hack this setTimeout() ??

      You misunderstand my point. The page from the internet is opened by IE
      and I need to change the timeout without edit html code. I'm looking
      for a way to interfere with javascript variables in PC memory. Or is
      there anyway to make this timeout stop working? Thanks.

      Comment

      • Jim Ley

        #4
        Re: how to hack this setTimeout() ??

        On 14 Jun 2004 06:02:39 -0700, quanghoc@netzer o.net (Hoc Phan) wrote:
        [color=blue]
        >You misunderstand my point. The page from the internet is opened by IE
        >and I need to change the timeout without edit html code. I'm looking
        >for a way to interfere with javascript variables in PC memory. Or is
        >there anyway to make this timeout stop working? Thanks.[/color]

        go to the urlbar and go:

        javascript:clea rTimeout(Moomin );void 0

        where Moomin is the part of the script that says:

        Moomin=setTimeo ut( ... )

        if it doesn't say Moomin = .... but just a bare setTimeout - then
        you'll need to get proxomitron or similar into the act to change the
        behaviour.

        Jim.
        --
        comp.lang.javas cript FAQ - http://jibbering.com/faq/

        Comment

        • Evertjan.

          #5
          Re: how to hack this setTimeout() ??

          Hoc Phan wrote on 14 jun 2004 in comp.lang.javas cript:[color=blue]
          > You misunderstand my point. The page from the internet is opened by IE
          > and I need to change the timeout without edit html code. I'm looking
          > for a way to interfere with javascript variables in PC memory. Or is
          > there anyway to make this timeout stop working? Thanks.[/color]

          So what timeout are you talking about ?

          The caching timeout perhaps ?
          [The one you set in the header]

          Clientside javascript cannot and should not be able to get at such
          variables.



          --
          Evertjan.
          The Netherlands.
          (Please change the x'es to dots in my emailaddress)

          Comment

          • Hoc Phan

            #6
            Re: how to hack this setTimeout() ??

            Well, here is the example. There is a page, let say, giving a quiz,
            which have setTimeout() to submit after 15 min. How to stop this
            javascript from running and submit the form automatically after 15
            min? I'm looking for a way to increase the time by changing some hex
            value in the memory. Just like hacking into software.

            Comment

            • Richard Cornford

              #7
              Re: how to hack this setTimeout() ??

              Hoc Phan wrote:[color=blue]
              > Well, here is the example. There is a page, let say, giving a quiz,
              > which have setTimeout() to submit after 15 min. How to stop this
              > javascript from running and submit the form automatically after 15
              > min? I'm looking for a way to increase the time by changing some hex
              > value in the memory. Just like hacking into software.[/color]

              Isn't that cheating? However, it serves whoever wrote the quiz right for
              relying on client-side scripting for the timing information (the server
              should be doing that, and may be doing it anyway).

              Almost certainly you will be able to do what you want, but nobody can
              tell you how without seeing the code in question (hacking hex values is
              not how it is done in javascript). First we will need to see the
              setTimeout call, and maybe some of the HTML, like the opining FORM tag
              (a URL might be useful). It might also be useful to know which browser
              you intend to be using.

              Richard.



              Comment

              • Evertjan.

                #8
                Re: how to hack this setTimeout() ??

                Hoc Phan wrote on 15 jun 2004 in comp.lang.javas cript:[color=blue]
                > Well, here is the example. There is a page, let say, giving a quiz,
                > which have setTimeout() to submit after 15 min. How to stop this
                > javascript from running and submit the form automatically after 15
                > min? I'm looking for a way to increase the time by changing some hex
                > value in the memory. Just like hacking into software.[/color]

                Memory has no hex values only binaries, unless they are burried in a
                string [consisting of binaries too]. A interpreting programme like a
                Javascript engine uses it's own internal representations of [typed]
                numbers in memory.
                For hacking into software, you have still much to learn.

                =============== ==========

                If you know the string of the clientside timeout and it has a name,
                you clould make a favelet (IE).

                Say the string is:

                mytimot = setTimeout('do( )',15*60*1000);

                The favelet called "ImCheatingImBa d.url" could contain:

                [InternetShortcu t]
                URL=javascript: mytimot=setTime out('do()',60*6 0*1000);void 0

                Put the favelet in the links Toolbar.

                =============== ===========

                But why the bother? Just rewrite the offending page as a local html,
                Phan, including a <base href=''> to the original location.

                --
                Evertjan.
                The Netherlands.
                (Please change the x'es to dots in my emailaddress)

                Comment

                • Richard Cornford

                  #9
                  Re: how to hack this setTimeout() ??

                  Evertjan. wrote:
                  <snip>[color=blue]
                  > If you know the string of the clientside timeout and it has a name,
                  > you clould make a favelet (IE).
                  >
                  > Say the string is:
                  >
                  > mytimot = setTimeout('do( )',15*60*1000);
                  >
                  > The favelet called "ImCheatingImBa d.url" could contain:
                  >
                  > [InternetShortcu t]
                  > URL=javascript: mytimot=setTime out('do()',60*6 0*1000);void 0[/color]
                  <snip>

                  I don't see this helping much because it is scheduling a second
                  execution of the - do - function. The first is still going to happen
                  approximately 15 minutes after the first call to setTimeout. In this
                  case I would be inclined to attack the - do - function, replacing it
                  with a dummy. But that might not be so simple if the call is:-

                  setTimeout('doc ument.forms[0].submit()', 15*60*1000);

                  - depending on the browser. And if the call was along the lines of:-

                  setTiemout(do, 15*60*1000);

                  - (by function reference) it might be necessary to look into the - do -
                  function and see what it was up to.

                  On the other hand Proxomitron has a built in filter that will kill all
                  calls to setTimeout/Interval.

                  Richard.


                  Comment

                  • Evertjan.

                    #10
                    Re: how to hack this setTimeout() ??

                    Richard Cornford wrote on 15 jun 2004 in comp.lang.javas cript:
                    [color=blue][color=green]
                    >> mytimot = setTimeout('do( )',15*60*1000);
                    >>
                    >> The favelet called "ImCheatingImBa d.url" could contain:
                    >>
                    >> [InternetShortcu t]
                    >> URL=javascript: mytimot=setTime out('do()',60*6 0*1000);void 0[/color]
                    > <snip>
                    >
                    > I don't see this helping much because it is scheduling a second
                    > execution of the - do - function. The first is still going to happen
                    > approximately 15 minutes after the first call to setTimeout.[/color]

                    Not true.

                    If you give the timeouts the same name "mytimot" the first one is
                    automatically cancelled.

                    If you do not want to prolong but to cancel the timeout:

                    [InternetShortcu t]
                    URL=javascript: window.clearTim eout(mytimot);v oid 0

                    will do.

                    --
                    Evertjan.
                    The Netherlands.
                    (Please change the x'es to dots in my emailaddress)

                    Comment

                    • Richard Cornford

                      #11
                      Re: how to hack this setTimeout() ??

                      Evertjan. wrote:[color=blue]
                      > Richard Cornford wrote:[/color]
                      <snip>[color=blue][color=green]
                      >> I don't see this helping much because it is scheduling a second
                      >> execution of the - do - function. The first is still going to happen
                      >> approximately 15 minutes after the first call to setTimeout.[/color]
                      >
                      > Not true.[/color]

                      ?
                      [color=blue]
                      > If you give the timeouts the same name "mytimot" the
                      > first one is automatically cancelled.[/color]
                      <snip>

                      In your code "mytimot" is not given to the - setTimeout - call,
                      "mytimot" receives the return value from the call. The second time it
                      happens "mytimot" receives a different value, but the timeout system
                      doesn't know about that, or have any interest. The first time out will
                      still trigger the execution of its string argument as originally
                      scheduled. Try it:-

                      <script type="text/javascript">
                      var m = setTimeout('ale rt(\'1\')',500) ;
                      m = setTimeout('ale rt(\'2\')',1500 );
                      </script>

                      Richard.


                      Comment

                      • Evertjan.

                        #12
                        Re: how to hack this setTimeout() ??

                        Richard Cornford wrote on 15 jun 2004 in comp.lang.javas cript:
                        [color=blue]
                        > In your code "mytimot" is not given to the - setTimeout - call,
                        > "mytimot" receives the return value from the call. The second time it
                        > happens "mytimot" receives a different value, but the timeout system
                        > doesn't know about that, or have any interest. The first time out will
                        > still trigger the execution of its string argument as originally
                        > scheduled. Try it:-
                        >
                        > <script type="text/javascript">
                        > var m = setTimeout('ale rt(\'1\')',500) ;
                        > m = setTimeout('ale rt(\'2\')',1500 );
                        > </script>
                        >[/color]

                        You are right.

                        So use clearTimeout() instead.

                        --
                        Evertjan.
                        The Netherlands.
                        (Please change the x'es to dots in my emailaddress)

                        Comment

                        Working...