小米APP生成DeviceId算法分析

这次是我们发现数据包里都会传一个cookie,里面带有一个属性是deviceId,按通常理解,cookie都是由服务器所产生作为临时保存的缓存机制。 但是经过一番搜索并未发现deviceId是从服务器返回的。但也可能是它返回的是一串其它字符串,然后在app内经过加密处理在发的呢? 这就需要我们去分析了。

0x02 定位技巧

这里没有选择通过直接搜索deviceId字符串进行搜索(其实我尝试过了~),因为搜索出来的结果过多,非常难精准定位到该地方,所以我们直接按照之前发布的文章,先重新回到登录触发的接口。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

public static AccountInfo loginByPassword(PasswordLoginParams passwordLoginParams) throws InvalidResponseException, InvalidCredentialException, InvalidUserNameException, NeedVerificationException, NeedCaptchaException, IOException, AccessDeniedException, AuthenticationFailureException, NeedNotificationException {

     if (passwordLoginParams == null || passwordLoginParams.password == null) {

         throw new IllegalArgumentException("password params should not be null");

     }

     String str = passwordLoginParams.userId;

     String str2 = passwordLoginParams.password;

     String str3 = passwordLoginParams.deviceId;

     String str4 = TextUtils.isEmpty(passwordLoginParams.serviceId) ? PASSPORT_SID : passwordLoginParams.serviceId;

     String str5 = passwordLoginParams.captIck;

     String str6 = passwordLoginParams.captCode;

     String[] strArr = passwordLoginParams.hashedEnvFactors;

     boolean z = passwordLoginParams.returnStsUrl;

     boolean z2 = passwordLoginParams.needProcessNotification;

     MetaLoginData metaLoginData = passwordLoginParams.metaLoginData;

     ActivatorPhoneInfo activatorPhoneInfo = passwordLoginParams.activatorPhoneInfo;

     EasyMap easyPut = new EasyMap().easyPutOpt(ProfileRecordUtils.Area.f6514a, str).easyPut(a.e, CloudCoder.getMd5DigestUpperCase(str2)).easyPutOpt("sid", str4).easyPutOpt("captCode", str6).easyPutOpt(d.p, passwordLoginParams.countryCode).easyPut("_json", Constants.SdkSettings.VALUE_TRUE);

     addEnvToParams(easyPut, strArr);

     EasyMap easyPutOpt = new EasyMap().easyPutOpt("ick", str5).easyPutOpt("ticketToken", passwordLoginParams.ticketToken);

     addDeviceIdInCookies(easyPutOpt, str3);

     addAntiSpamIpAddressInCookies(easyPutOpt);

     if (activatorPhoneInfo != null) {

         easyPut.easyPutOpt("userHash", activatorPhoneInfo.phoneHash);

         easyPutOpt.easyPutOpt("activatorToken", activatorPhoneInfo.activatorToken);

     }

     String str7 = URLs.URL_LOGIN_AUTH2_HTTPS;

     PassportRequestArguments passportRequestArguments = new PassportRequestArguments();

     passportRequestArguments.putAllParams(easyPut);

     pass

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值