Skip to content

Instantly share code, notes, and snippets.

@b1naryth1ef
Last active February 18, 2022 10:18
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save b1naryth1ef/8202642 to your computer and use it in GitHub Desktop.
Save b1naryth1ef/8202642 to your computer and use it in GitHub Desktop.
Steam Reverse Engineering Login
>>> r = requests.post("https://steamcommunity.com/login/getrsakey/", params={"username": "b1naryth1ef"})
>>> r.content
{
u'publickey_exp': u'010001',
u'publickey_mod': u'C1097F74ADE7AAB4E0B5AF7F2CBD39E0E52730763EC777CF50D6CE7BF0C15E41CF2E9F408AA82B19ABD232A4C220FBEA67B6BECB9F008171653E9E2C8939593284E039337B55623B25D1A019483B9E050D056EFD706A03C1934D8E7885CC0DACCB844F78E5862E7C760B0ED35EF042EE325229100ED18BD6ADB71E0169751234BF6A4057FD7C506447606FB4ADE662D006FF4B45F3993344D73BDCD8A824524C3B290024426AE4EBB0541D1C73905CB3B9FAF56F1BF0F93F5F4BFA5FF4E527EE0AD2A536EFBC696F0DEC4EE30E00AA6244B87DB8724D77D62E05C14B712D7C262A09BE71717B0838B00C39C4ACC7A5704DC07166799856C6AEA9E7D5EE4311F7',
u'success': True,
u'timestamp': u'446618050000
}
function OnRSAKeyResponse( transport )
{
var results = transport.responseJSON;
if ( results.publickey_mod && results.publickey_exp && results.timestamp )
{
var form = document.forms['logon'];
var pubKey = RSA.getPublicKey( results.publickey_mod, results.publickey_exp );
var username = form.elements['username'].value;
username = username.replace( /[^\x00-\x7F]/g, '' ); // remove non-standard-ASCII characters
var password = form.elements['password'].value;
password = password.replace( /[^\x00-\x7F]/g, '' ); // remove non-standard-ASCII characters
var encryptedPassword = RSA.encrypt( password, pubKey );
new Ajax.Request( 'https://steamcommunity.com/login/dologin/',
{
method: 'post',
parameters: {
password: encryptedPassword,
username: username,
emailauth: form.elements['emailauth'].value,
loginfriendlyname: form.elements['loginfriendlyname'].value,
captchagid: form.elements['captchagid'].value,
captcha_text: form.elements['captcha_text'].value,
emailsteamid: form.elements['emailsteamid'].value,
rsatimestamp: results.timestamp,
remember_login: ( form.elements['remember_login'] && form.elements['remember_login'].checked ) ? 'true' : 'false',
donotcache: ( new Date().getTime() )
},
onSuccess: OnLoginResponse,
onException: function( req, e ) { throw e; }
}
);
}
else
{
if ( results.message )
{
HighlightFailure( results.message );
}
$('login_btn_signin').show();
$('login_btn_wait').hide();
g_bLoginInFlight = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment