2

I'm trying to check if a current @hotmail.com address is taken.

However, I'm not getting the response I would have gotten using chrome developer tools.

#!/usr/bin/python

import urllib
import urllib2
import requests

cookies = {
    'MC0': '1449950274804',
    'mkt': 'en-US',
    'MSFPC': 'ID=a9b016cd39838248bbf321ea5ad1ecae&CS=1&LV=201512&V=1',
    'wlv': 'A|ekIL-d:s*cAHzDg.2+1+0+3',
    'HIC': '7c5d20284ecdbbaa||0|||',
    'wlxS': 'wpc=1&WebIM=1',
    'RVC': 'm=1&v=17.5.9510.1001&t=12/12/2015 20:37:45',
    'amcanary': '0',
    'CkTst': 'MX1449957709484',
    'LDH': '9',
    'wla42': 'KjEsN0M1RDIwMjg0RUNEQkJBQSwsLDAsLTEsLTE=',
    'LN': 'u9GMx1450021043143',
}

headers = {
        'Origin': 'https://signup.live.com',
        'Accept-Encoding': 'gzip, deflate',
        'Accept-Language': 'en-US,en;q=0.8,ja;q=0.6',

    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36',
    'canary': 'aeIntzIq6OCS9qOE2KKP2G6Q7yCCPLAQVPIw0oy2Vksln3bbwVR9I8DcpfzC9RiCnNiJBw4YxtWsqJfnx0PeR9ovjRG+bF1jKkyPVWUTyuDTO5UkwRNNJFTIdeaClMgHtATSy+gI99ojsAKwuRFBMNbOgCwZIMCRCmky/voftX/63gjTqC9V5Ry/bECc2P66ouDZNC7TA/KN6tfsmszelEoSrmvU7LAKDoZnkhRQjpn6WYGxUzr5S+UYXExa32AY:1:3c',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'Accept': 'application/json',
    'Referer': 'https://signup.live.com/signup?wa=wsignin1.0&rpsnv=12&ct=1450038320&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https',
    'X-Requested-With': 'XMLHttpRequest',
    'Connection': 'keep-alive',
}

data = {"signInName":"testfoobar1234@outlook.com","uaid":"f1d115020fc94af6ba17e722277cdcb8","performDisambigCheck":"true","includeSuggestions":"true","uiflvr":"1001","scid":"100118","hpgid":"200407"}

asdf = requests.post('https://signup.live.com/API/CheckAvailableSigninNames?wa=wsignin1.0&rpsnv=12&ct=1450038320&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https', headers=headers, cookies=cookies, data=data)
print(asdf.json())

This is what chrome gives me when checking testfoobar1234@hotmail.com:

Chrome Response

This is what my script is giving me testfoobar1234@hotmail.com:

enter image description here

mrDinkelman
  • 488
  • 1
  • 9
  • 18

1 Answers1

0

If you want to connect via python script on your local machine to login.live.com with right credentials but cookies from your Chrome -- it's will not work.

What you want to do: read emails, send email, or just get contacts from address book. Algorithms in script will be different. Example, Mails available via outlook.com system, contacts located in people.live.com (and API as I right remember).

If you want emulate login like Chrome do, you need:

  1. Get and collect all cookies from outlook.com main page, don't forget about all redirects:) - via your python script
  2. Send request with collected cookies and credentials, to login.live.com (outlook will redirect to it).

But, from my experience -- last Outlook version (regular and Outlook Preview systems) in 90% detects wrong attempt of login and send to you page with confirm login question (code or email). That way you will have unstable solution. Do you really want to do it?

If you just want to parse JSON right you need:

import json

data = json.loads(asdf.text)

print(data)

If you want to see, how much actions produced by browser, just install Firebug and disable cleaning "Network" panel, then see how many requests processed before you logged in into your account.

But, for see all traffic suggest to use Firefox + Firebug + Tamper Data.

And also, I think more quicker will be use exists libs like Selenium for browser emulation.

mrDinkelman
  • 488
  • 1
  • 9
  • 18