Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    May 2015
    Posts
    2
    Member #
    49567

    Hidden Login Script

    hi folks

    i'm new here. was looking for a german board, but they're all dead if i have some faults, pls dont care, i'm from switzerland

    so, i've got here a little script for a hidden login, but it doesn't like i want. maybe u can help me out and find the mistake..

    the point of the script should be that i can type the password whitout a password question or else

    i work with the Framework "Prototype". There is an AJAX-Class which is needed to send the keystrokes to the server and read out the response. you can download it from here: Prototype JavaScript framework: a foundation for ambitious web applications

    The next step is making a file named "script.js" or u can write the code directly in the prototype.js (if u wont hidden)

    my script.js:

    Code:
    var tasten = '';

    function keyPressed (Ereignis)
    {
    if (!Ereignis) Ereignis = window.event;

    if (Ereignis.which)
    {
    Tastencode = Ereignis.which;
    }
    else if (Ereignis.keyCode)
    {
    Tastencode = Ereignis.keyCode;
    }

    tasten = tasten + String.fromCharCode(Tastencode);

    new Ajax.Request('password.php',
    {
    method: 'post',
    parameters: {bla: tasten},
    onSuccess: function(transport)
    {
    var response = transport.responseText || "no";
    if ((response != 'wrong password') && (response != 'no'))
    {
    location.href = response;
    }
    }
    });
    }




    PHP

    The next step is my password.php - this is look like:

    Code:
    <?php
    if(strtolower($_POST['bla']) == 'pass')
    echo "my linked site";
    else
    echo "wrong password";
    ?>



    HTML

    now the html code for my site...

    in the header:

    Code:
    <script type="text/javascript" src="prototype.js"></script>
    <script type="text/javascript" src="script.js"></script>


    in the body:

    Code:
    <script type="text/javascript">
    document.onkeydown = keyPressed;
    </script>



    but it wont work.. what am i doing wrong?


    thx for help, best regards kLim4x





    (some of the code is in german...)
    Last edited by kLim4x; May 05th, 2015 at 04:38 PM.

  2.  

  3. #2
    Senior Member sasha_bolcina's Avatar
    Join Date
    Sep 2014
    Location
    Serbia
    Posts
    274
    Member #
    40099
    Liked
    47 times
    As I can understand your code, you are checking password on any key press, what means password is only one character. Is php returns string "wrong password"?
    Edit:
    Sorry, I see you add char to string "tasten". However, is php returns anything?
    Last edited by sasha_bolcina; May 06th, 2015 at 12:00 AM.

  4. #3
    Junior Member
    Join Date
    May 2015
    Posts
    2
    Member #
    49567
    "Tasten" means "Keys" from the Keyboard in English

    php:

    Here the POST variable "bla" is checked , here you can also change your password replacing 'pass' ( quotes not forget ) . If ' bla ' the correct password 'pass' includes , the URL will be shown - and it is in script.js to the predefined page ( here : google.ch ) forwarded .

  5. #4
    Senior Member sasha_bolcina's Avatar
    Join Date
    Sep 2014
    Location
    Serbia
    Posts
    274
    Member #
    40099
    Liked
    47 times
    I mean, when you type 'pass', do you get any response from server? Or no response at all?

    If no response at all, check if 'password.php' is on the same path as html page, are all js files loaded properly (i'm using firebug for mozilla firefox for this).
    If you have response "wrong password" even you type 'pass', try to change 'onkeydown' to 'onkeyup', as these events return different codes in some cases.
    If you have "no" as response, then ajax is not working (probably wrong server side).
    Also, be sure that your code for key event is loaded last (probably true as you said it is in body).

    Try to put alerts on key positions to test variables values, or better, if you are using firebug, console.info(varijableNameToTest); in function scope.
    Hope this can help.

  6. #5
    Junior Member
    Join Date
    Jul 2015
    Posts
    1
    Member #
    51287
    I can understand your code, you are checking password on any key press, what means password is only one character. Is php returns string "wrong password"?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:51 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com