Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic login script for a website on windows machine?

Tags:

I saw some guy had a file (I guess a batch file). On clicking of the batch file he was able to log in to multiple sites. (Perhaps it was done using VB.)

I looked for such a script on Google but didn't find anything useful.

I know a bit of C++ and UNIX (also some HTML and JavaScript). I don't know if it can be done on a windows machine using these languages, but even if it could be done I think it would be difficult compared to VB or C## or some other high level languages.

I learned how to open multiple sites using basic windows batch commands enclosed in a batch file like:

start http://www.gmail.com start http://stackoverflow.com 

But still I can't figure out how actually clicking on the batch file would help me to log in to the sites without even typing the username and password.

Do I need to start learning Visual Basic, .NET, or windows batch programming to do this?

One more thing: can I also use it to log in to remote desktops?

like image 430
munish Avatar asked Jun 06 '11 06:06

munish


People also ask

What is an automatic login?

You can securely save host domain user credentials (Windows logon credentials) by using the auto-login feature. Once enabled, you can automatically log in to your host computer from the same client computer without entering the domain username and password. The feature is enabled by default for Personal and Pro users.


2 Answers

From the term "automatic login" I suppose security (password protection) is not of key importance here.

The guidelines for solution could be to use a JavaScript bookmark (idea borrowed form a nice game published on M&M's DK site).

The idea is to create a javascript file and store it locally. It should do the login data entering depending on current site address. Just an example using jQuery:

// dont forget to include jQuery code // preferably with .noConflict() in order not to break the site scripts if (window.location.indexOf("mail.google.com") > -1) {     // Lets login to Gmail     jQuery("#Email").val("[email protected]");     jQuery("#Passwd").val("superSecretPassowrd");     jQuery("#gaia_loginform").submit(); } 

Now save this as say login.js

Then create a bookmark (in any browser) with this (as an) url:

javascript:document.write("<script type='text/javascript' src='file:///path/to/login.js'></script>"); 

Now when you go to Gmail and click this bookmark you will get automatically logged in by your script.

Multiply the code blocks in your script, to add more sites in the similar manner. You could even combine it with window.open(...) functionality to open more sites, but that may get the script inclusion more complicated.

Note: This only illustrates an idea and needs lots of further work, it's not a complete solution.

like image 128
mkilmanas Avatar answered Sep 20 '22 06:09

mkilmanas


The code below does just that. The below is a working example to log into a game. I made a similar file to log in into Yahoo and a kurzweilai.net forum.

Just copy the login form from any webpage's source code. Add value= "your user name" and value = "your password". Normally the -input- elements in the source code do not have the value attribute, and sometime, you will see something like that: value=""

Save the file as a html on a local machine double click it, or make a bat/cmd file to launch and close them as required.

    <!doctype html>     <!-- saved from url=(0014)about:internet -->      <html>     <title>Ikariam Autologin</title>     </head>     <body>     <form id="loginForm" name="loginForm" method="post"    action="http://s666.en.ikariam.com/index.php?action=loginAvatar&function=login">     <select name="uni_url" id="logServer" class="validate[required]">     <option  class=""  value="s666.en.ikariam.com" fbUrl=""  cookieName=""  >             Test_en     </option>     </select>     <input id="loginName" name="name" type="text" value="PlayersName" class="" />     <input id="loginPassword" name="password" type="password" value="examplepassword" class="" />     <input type="hidden" id="loginKid" name="kid" value=""/>                         </form>   <script>document.loginForm.submit();</script>          </body></html> 

Note that -script- is just -script-. I found there is no need to specify that is is JavaScript. It works anyway. I also found out that a bare-bones version that contains just two input filds: userName and password also work. But I left a hidded input field etc. just in case. Yahoo mail has a lot of hidden fields. Some are to do with password encryption, and it counts login attempts.

Security warnings and other staff, like Mark of the Web to make it work smoothly in IE are explained here:

http://happy-snail.webs.com/autologinintogames.htm

like image 31
qwerty jones Avatar answered Sep 20 '22 06:09

qwerty jones