Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
夜猫逐梦
MyOpen
提交
c732d1c0
M
MyOpen
项目概览
夜猫逐梦
/
MyOpen
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
MyOpen
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
c732d1c0
编写于
5月 25, 2023
作者:
K
Knine
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
LJWT
上级
a8bad6dc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
97 addition
and
5 deletion
+97
-5
steam/2023-05-21--协议实现网页登录/package.json
steam/2023-05-21--协议实现网页登录/package.json
+5
-1
steam/2023-05-21--协议实现网页登录/src/crypto/jsbn.js
steam/2023-05-21--协议实现网页登录/src/crypto/jsbn.js
+7
-0
steam/2023-05-21--协议实现网页登录/src/crypto/rsa.js
steam/2023-05-21--协议实现网页登录/src/crypto/rsa.js
+6
-0
steam/2023-05-21--协议实现网页登录/src/main.js
steam/2023-05-21--协议实现网页登录/src/main.js
+79
-4
未找到文件。
steam/2023-05-21--协议实现网页登录/package.json
浏览文件 @
c732d1c0
...
...
@@ -3,10 +3,14 @@
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"type"
:
"module"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
,
"dev"
:
"node src/main.js"
},
"author"
:
""
,
"license"
:
"ISC"
"license"
:
"ISC"
,
"dependencies"
:
{
"node-fetch"
:
"^3.3.1"
}
}
steam/2023-05-21--协议实现网页登录/src/crypto/jsbn.js
浏览文件 @
c732d1c0
...
...
@@ -36,6 +36,7 @@
// Basic JavaScript BN library - subset useful for RSA encryption.
global
.
navigator
=
{
userAgent
:
'
node.js
'
,
};
// Bits per digit
var
dbits
;
...
...
@@ -1237,3 +1238,8 @@ BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
// long longValue()
// static BigInteger valueOf(long val)
export
{
BigInteger
}
\ No newline at end of file
steam/2023-05-21--协议实现网页登录/src/crypto/rsa.js
浏览文件 @
c732d1c0
import
{
BigInteger
}
from
"
./jsbn.js
"
var
RSAPublicKey
=
function
(
$modulus_hex
,
$encryptionExponent_hex
)
{
this
.
modulus
=
new
BigInteger
(
$modulus_hex
,
16
);
this
.
encryptionExponent
=
new
BigInteger
(
$encryptionExponent_hex
,
16
);
...
...
@@ -105,3 +108,6 @@ var RSA = {
}
};
export
{
RSA
}
steam/2023-05-21--协议实现网页登录/src/main.js
浏览文件 @
c732d1c0
// ReferenceError: navigator is not defined
global
.
navigator
=
{
userAgent
:
'
node.js
'
,
};
require
(
"
./crypto/jsbn.js
"
)
require
(
"
./crypto/rsa.js
"
)
(
"
./crypto/jsbn.js
"
)
import
{
RSA
}
from
"
./crypto/rsa.js
"
function
main
()
{
function
main
(
usr
,
pwd
,
results
)
{
pwd
=
pwd
.
replace
(
/
[^\x
00-
\x
7F
]
/g
,
''
);
// remove non-standard-ASCII characters
let
m_strUsernameCanonical
=
usr
.
replace
(
/
[^\x
00-
\x
7F
]
/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
"
)
/*
{
"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\n
Content-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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录