dtjzpg5313 2015-07-13 22:27
浏览 614

Steam卷曲登录 - 获取cookie + sessionid(多个请求?)

I'm currently trying to get my sessionid and cookie from steam login.

When I login manually and check the network responses, I can see the info I need. It's located mainly in the dologin/

http://imgur.com/a/ZFwAQ - First image is getrsakey/ and the second image is dologin/

On the second image I marked what I need with a red box. I think I just need the browserid and steamMachineAuth.

$url = "https://steamcommunity.com/login/getrsakey/";
$params = ['username' => "MyUsername", 'password' => "MyPassword"];

$cookie_jar = tempnam('/tmp', 'cookie');

$session = curl_init($url);

curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_HEADER, 1);
curl_setopt($session, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($session, CURLOPT_TIMEOUT, 30);
curl_setopt($session, CURLOPT_MAXREDIRS, 10);
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($session, CURLOPT_COOKIEJAR, $cookie_jar);

$response = curl_exec($session);
die(var_dump($cookie_jar));
curl_close($session);

With the curl above, it seems like I only get getrsakey/ stats for obvious reasons. I tried making a second curl request with the cookiejar I made, and then request dologin/ but all I'm getting back is

"{"success":false}bool(true)}"

TLDR: I need the browserid and steamMachineAuth from the dologin/ - See link above (Second image) basically the whole cookie if possible.

  • 写回答

1条回答 默认 最新

  • dongpaipu8394 2016-02-16 09:51
    关注

    I know it is some time after question was added, but i think someone might still need an answer.

    As You said, You need to make second request dologin/ but not with the cookiejar You made.

    First of all when You send request to getrsakey/ You need only username parameter (password is not needed).

    Than in response You get rsa key which You need to encrypt Your password using RSA method (key is divided into key modulus and key exponent).

    RSA encrypted password needs to be encoded with base64 and that is the password parameter You send to dologin/

    But unfortunately STEAM might want to get Captcha code and/or SteamGuard code if account is protected, so You need to implement that as well.

    I don't have working PHP code, but You may look into SteamBot writen in C# and write Your code based on it. Search for Dologin method in SteamWeb.cs file: https://github.com/Jessecar96/SteamBot/blob/master/SteamTrade/SteamWeb.cs#L88

    评论

报告相同问题?

悬赏问题

  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能