提交 c732d1c0 编写于 作者: K Knine

LJWT

上级 a8bad6dc
...@@ -3,10 +3,14 @@ ...@@ -3,10 +3,14 @@
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"type": "module",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"dev": "node src/main.js" "dev": "node src/main.js"
}, },
"author": "", "author": "",
"license": "ISC" "license": "ISC",
"dependencies": {
"node-fetch": "^3.3.1"
}
} }
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
// Basic JavaScript BN library - subset useful for RSA encryption. // Basic JavaScript BN library - subset useful for RSA encryption.
global.navigator={ userAgent: 'node.js', };
// Bits per digit // Bits per digit
var dbits; var dbits;
...@@ -1237,3 +1238,8 @@ BigInteger.prototype.isProbablePrime = bnIsProbablePrime; ...@@ -1237,3 +1238,8 @@ BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
// long longValue() // long longValue()
// static BigInteger valueOf(long val) // static BigInteger valueOf(long val)
export {
BigInteger
}
\ No newline at end of file
import {BigInteger} from "./jsbn.js"
var RSAPublicKey = function($modulus_hex, $encryptionExponent_hex) { var RSAPublicKey = function($modulus_hex, $encryptionExponent_hex) {
this.modulus = new BigInteger( $modulus_hex, 16); this.modulus = new BigInteger( $modulus_hex, 16);
this.encryptionExponent = new BigInteger( $encryptionExponent_hex, 16); this.encryptionExponent = new BigInteger( $encryptionExponent_hex, 16);
...@@ -105,3 +108,6 @@ var RSA = { ...@@ -105,3 +108,6 @@ var RSA = {
} }
}; };
export {
RSA
}
// ReferenceError: navigator is not defined // ReferenceError: navigator is not defined
global.navigator={ userAgent: 'node.js', }; global.navigator={ userAgent: 'node.js', };
require("./crypto/jsbn.js") ("./crypto/jsbn.js")
require("./crypto/rsa.js") import {RSA} from "./crypto/rsa.js"
function main() { function main(usr, pwd, results) {
pwd = pwd.replace( /[^\x00-\x7F]/g, '' ); // remove non-standard-ASCII characters
let m_strUsernameCanonical = usr.replace( /[^\x00-\x7F]/g, '' ); // remove non-standard-ASCII characters
var pubKey = RSA.getPublicKey(results.publickey_mod, results.publickey_exp);
var username = m_strUsernameCanonical;
var encryptedPassword = RSA.encrypt(pwd, pubKey);
var rgParameters = {
password: encryptedPassword,
username: username,
// twofactorcode: authCode,
// emailauth: form.elements['emailauth'] ? form.elements['emailauth'].value : '',
// loginfriendlyname: form.elements['loginfriendlyname'] ? form.elements['loginfriendlyname'].value : '',
// captchagid: this.m_gidCaptcha,
captcha_text: '',
// emailsteamid: this.m_steamidEmailAuth,
rsatimestamp: results.timestamp,
remember_login: 'true'
};
console.log(pubKey, rgParameters)
} }
main() // ReferenceError: fetch is not defined
// failed, reason: unable to verify the first certificate
import fetch from 'node-fetch'
fetch("https://api.steampowered.com/IAuthenticationService/GetPasswordRSAPublicKey/v1?origin=https:%2F%2Fstore.steampowered.com&input_json=%7B%22account_name%22:%22111%22%7D", {
"headers": {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
"sec-ch-ua": "\"Microsoft Edge\";v=\"113\", \"Chromium\";v=\"113\", \"Not-A.Brand\";v=\"24\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site"
},
"referrer": "https://store.steampowered.com/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
// "credentials": "omit"
}).then(resp => resp.json)
.then(j => console.log(j))
let results = {
publickey_mod: '123aee',
publickey_exp: '010001',
timestamp: '58350'
}
// main('111', '222', results)
console.log("leave") console.log("leave")
/*
{
"interval": 5,
"extended_error_message": ""
}
*/
function t() {
fetch("https://api.steampowered.com/IAuthenticationService/BeginAuthSessionViaCredentials/v1", {
"headers": {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
"content-type": "multipart/form-data; boundary=----WebKitFormBoundaryqdEn9VkmYdIUEwRi",
"sec-ch-ua": "\"Microsoft Edge\";v=\"113\", \"Chromium\";v=\"113\", \"Not-A.Brand\";v=\"24\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site"
},
"referrer": "https://store.steampowered.com/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": "------WebKitFormBoundaryqdEn9VkmYdIUEwRi\r\nContent-Disposition: form-data; name=\"input_json\"\r\n\r\n{\"account_name\":\"111\",\"encrypted_password\":\"dviiPhtg5dYHb9Pv4LSdg/5JTvoEdII+Wcwi8KS6DR3NZHBs4oqxej3NY64icVPDZz3nLqJJ1IWCDUsQgqG0KDa3lT6L9Q9BdgX+Rml63rzYa8lBtwS1dzDngfkDqPjVNY+CM8y7NE6SVJFloY5obiCBeIVqC1ldLTl31h01a6yMY5ylWc18mE6zlO3nrqA75f/YiiDgehp/06kEa6N/PTtF/QhvB01iLrGPGJya1JwnPpfvaX/nWTiy0z6XszuNojsw+oIHKml8VPvc1QPNXf1zeWGbfWURIFDTb63YLQ+w9GKJvEoQ2N3CHxTTaBWS+UrUGtJcA2gsBEuJURwHDw==\",\"encryption_timestamp\":\"64904150000\",\"remember_login\":true,\"persistence\":1,\"website_id\":\"Store\",\"device_details\":{\"device_friendly_name\":\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.50\",\"platform_type\":2},\"language\":6,\"qos_level\":2}\r\n------WebKitFormBoundaryqdEn9VkmYdIUEwRi--\r\n",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册