Skip to content Skip to sidebar Skip to footer

How Can Send My Login Credentials To Hotmail Via A Script?

I want to make a script to send my username and password to hotmail so I can be logged in without going through the login page. I don't want to use the 'sign me in automatically' o

Solution 1:

Using firefox I just create a bookmark called hm in the "location" box paste in the code below, when I load the hotmail page I just click on the bookmark.

javascript:%20document.getElementsByName('login').item(0).value='yourname@hotmail.co.uk';%20document.getElementsByName('passwd').item(0).value='yourpass';%20document.getElementsByName('SI').item(0).click();%20void(0);

Solution 2:

Solution to automate this through a browser

Suggested by User574632. This is not the only solution, but it is an easier one.

I've come up with two solutions; one for use with Internet Explorer and the other for use with Firefox. Both solutions work with the browser to automate this task.

Solution 1--Internet Explorer and AutoIt

As it just so happens, AutoIt is very good at automating IE's functions. After reading a similar question on the AutoIt help forum here, I found most of what I needed. I just added support for command line parameters and voila. Here is the code written in AutoIt:

#include <IE.au3>
Opt("WinTitleMatchMode", 2)

$oIE = _IECreate ("http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1227208038&rver=5.5.4177.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fdefault.aspx%3Fn%3D1521319951&id=64855")
_IELoadWait ($oIE)

$o_form = _IEFormGetObjByName ($oIE, "f1")
$o_login = _IEFormElementGetObjByName ($o_form, "login")
$o_password = _IEFormElementGetObjByName ($o_form, "passwd")
$o_signin = _IEFormElementGetObjByName ($o_form, "SI")

$username = $CmdLine[1] ; "YOUR_HOTMAIL_ADDRESS@hotmail.com"
$password = $CmdLine[2] ;"YOUR_PASSWORD"

_IEFormElementCheckBoxSelect ( $o_form, "remMe", "", 0)

_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)

_IEAction ($o_signin, "click")

WinSetState ( "Internet", "", @SW_MAXIMIZE )

Note that this was not written by me, I only modified it to accept command line parameters.

After compiling, usage is: Executable.exe "EmailAddress@hotmail.com" "Password"

Solution 2--Firefox and iMacros

  1. Install iMacros here: https://addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/

  2. Open iMacros and create a marco

  3. Insert the following script, replacing the email address and password with your own:

VERSION BUILD=8601111 RECORDER=FX
TAB T=1
URL GOTO=https://login.live.com/ppsecure/post.srf?wa=wsignin1.0&rpsnv=12&ct=1391468097&rver=6.4.6456.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fdefault.aspx&lc=1033&id=64855&mkt=en-us&cbcxt=mai&snsc=1&bk=1391468099&uaid=9d4d29da2c304ed581e61d3fc51be1eb
TAG POS=1 TYPE=DIV ATTR=ID:idDiv_PWD_UsernameExample
TAG POS=1 TYPE=INPUT:EMAIL FORM=NAME:f1 ATTR=ID:i0116 CONTENT=EMAILADDRESS@hotmail.com
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:f1 ATTR=ID:i0118 CONTENT=PASSWORD
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:f1 ATTR=ID:idSIButton9

Then name the macro as "HotmailLogin.iim"

All you need to do to use it is create a shortcut with command line parameters like this:

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m=HotmailLogon.iim

Solution 3:

This is not possible without actually having your browser visit the hotmail.com login page, for various reasons:

  1. You can not use PHP to do this, since PHP is fully serverside and logging in a server has absolutely no effect on you (the client). It would log itself in, not you.
  2. You can also not use javascript to set any type of cookie / session for hotmail.com from a different domain (that is not hotmail.com) due to security preventions which make sure you can't set a cookie for domain A from a page on domain B.
  3. Making a POST request from a different domain is also not allowed by the HTTP protocol, so no here as well. Your browser will block any POST request from a page at A.com trying to post to server B.com
  4. Hotmail forces you to first go to their login page to get a special cookie with a session-ID. Only if this special session-ID is sent back with the POST request will hotmail allow the request to go through. So you still have to get the sessionID first.

So in short: no.

Post a Comment for "How Can Send My Login Credentials To Hotmail Via A Script?"