hlsdk

Better login info

Jun 24th, 2012
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.49 KB | None | 0 0
  1. import pkcs1
  2. import math, json, urllib, httplib, random
  3.  
  4. params = urllib.urlencode({'username': 'hlsdk5'})
  5. headers = {"Content-type": "application/x-www-form-urlencoded", \
  6.            "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0"}
  7.  
  8. conn = httplib.HTTPSConnection("steamcommunity.com");
  9. conn.request("POST", "/login/getrsakey/", params, headers);
  10.  
  11. response = conn.getresponse();
  12. publicKeyJSON = json.loads(response.read());
  13.  
  14. steamPublicRSAKey = pkcs1.keys.RsaPublicKey(int(publicKeyJSON["publickey_mod"], 16), int(publicKeyJSON["publickey_exp"], 16));
  15.  
  16. encryptedPassword = pkcs1.rsaes_pkcs1_v15.encrypt(steamPublicRSAKey, '<MY_PASSWORD WOULD NORMALLY GO HERE>')
  17.  
  18. params = urllib.urlencode({                                              \
  19.                             'password': encryptedPassword,               \
  20.                             'username': 'hlsdk5',                        \
  21.                             'emailauth': None,                           \
  22.                             'captcha_text': None,                        \
  23.                             'emailsteamid': None,                        \
  24.                             'rsatimestamp': publicKeyJSON["timestamp"]   \
  25.                            })
  26. headers = {"Content-type": "application/x-www-form-urlencoded"}
  27. conn = httplib.HTTPSConnection("steamcommunity.com");
  28. conn.request("POST", "/login/dologin/", params, headers);
  29. response = conn.getresponse();
  30. ans = response.getheaders();
Advertisement
Add Comment
Please, Sign In to add comment