Womsxd / YuanShen_User_Info

原神个人信息查询
MIT License
213 stars 46 forks source link

居然在这里看到了DS的计算方法 #1

Closed huiyadanli closed 3 years ago

huiyadanli commented 3 years ago

我以前写了一个这个角色信息查询的前端页面,后端也利用了这个接口,当时还没有做鉴权

然后作死发NGA后被秒封。

项目地址:https://github.com/babalae/genshin-info

最近有时间又抓包看了下,发现有个DS的请求头。没找到它的生成方法,居然在这里找到的。

我可以使用这段代码吗?会注明来源,希望mhy不要再和谐了:joy:

def DSGet():
    mhyVersion = "2.1.0"
    n = md5(mhyVersion)
    i = str(int(time.time()))
    r = ''.join(random.sample(string.ascii_lowercase + string.digits, 6))
    c = md5("salt=" + n + "&t="+ i + "&r=" + r)
    return i + "," + r + "," + c
Steesha commented 3 years ago

啊这

Loyisa commented 3 years ago

我靠恁娘 你就是让接口被封的罪魁祸首?

Meitniprk commented 3 years ago

呃呃气死我了

SinoAHpx commented 3 years ago

qswl!

Womsxd commented 3 years ago

可以( 不过不建议大范围公开宣传(这玩意还是私下用用好丶

huiyadanli commented 3 years ago

我靠恁娘 你就是让接口被封的罪魁祸首?

没错就是我,可是我也不知道也有别人在用。。。

Admirepowered commented 3 years ago

我靠恁娘 你就是让接口被封的罪魁祸首?

没错就是我,可是我也不知道也有别人在用。。。

好家伙大范围传播大家都没得用

huiyadanli commented 3 years ago

好了好了,我错了 😭

原先被封的主要原因应该是:

  1. 接口无鉴权
  2. 接口能够查到米游社未同步的账号(重点)

现在低调使用应该没事,反正我是不会去主动宣传了。

我这边页面用的后端,大概就是用了腾讯云的云函数简单做了个反代,有需要可以随意使用(F12自取,参数只需要UID)

@Womsxd @Steesha 大佬🐂🍺

ColorfulGhost commented 3 years ago

关于DS算法Java版本~

import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.digest.MD5;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;

    String DSGet() {
        String mhyVersion = "2.1.0";
        String randomStr = "abcdefghijklmnopqrstuvwxyz0123456789";
        String n = MD5.create().digestHex(mhyVersion);
        String i = NumberUtil.roundStr(System.currentTimeMillis() / 1000.0,0);

        String r = "";
        for (int i1 = 0; i1 < 6; i1++) {
            r += Character.toString(RandomUtil.randomChar(randomStr));
        }
        String c = MD5.create().digestHex("salt=" + n + "&t=" + i + "&r=" + r);
        return i + "," + r + "," + c;
    }
SinoAHpx commented 2 years ago

能发下php写法嘛。。。我不会

要我开宝宝巴士教你写吗?