话不多说,直接抓取登陆请求:
POST https://mi.zhaopin.com/android/My/LoginPostPassport?d=5677860f-ce3b-4bda-b2ae-9fd6454d6850&channel=360yingyong&v=7.91&key=135486907212185&t=1531747877&e=8abe76f88a49f281610ebf90059d4563 HTTP/1.1 user_id: user_location: user_latlon: null;null device_name: Nexus 5 device_platform: android device_id: 5677860f-ce3b-4bda-b2ae-9fd6454d6850 device_network: WIFI device_resolution: 1080:1776 device_time: 2018-07-16 21:31:17 version_name: 7.91 version_code: 791 build_number: 0 channel_id: 360yingyong Content-Length: 44 Content-Type: application/x-www-form-urlencoded Host: mi.zhaopin.com Connection: Keep-Alive User-Agent: kooxiv Accept-Encoding: gzip password=a67266746b6568&userName=13028919000 HTTP/1.1 210 Server: openresty Date: Mon, 16 Jul 2018 13:31:17 GMT Content-Type: application/json; charset=utf-8 Content-Length: 109 Connection: keep-alive Cache-Control: private X-AspNetMvc-Version: 3.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET {"User":null,"NeedVerifyCode":false,"StatusCode":210,"StatusDescription":"账号不存在,请重新输入"}
看来重点就在于sprintf(&s, "%2x", v6 + v4);语句 那么,我们来分析下这条语句 sprintf()函数用于将格式化的数据写入字符串,其原型为: int sprintf(char *str, char * format [, argument, ...]); 【参数】str为要写入的字符串;format为格式化字符串,与printf()函数相同;argument为变量。 参数str 是保存结果的char*, 参数"%2x" x代表以十六进制形式输出,2表示不足两位,前面补0输出 那么重点来了 v6 + v4是什么鬼? 注意看,伪代码中有while循环,内部有个break语句 说明它其实是个for循环,循环的次数就是密码的长度 当循环第一次时 V6,就是密码首位的byte值 V4,就是"EA4A702427934604867F6726FFA189370C0E9C3573AF4806B759773C4DD1ED6A"首位的byte值 最后转换成hex数据, 这就是为什么,输入密码a123456,加密后变成14位的原因