2022年2月24日

flutter逆向实战2-分析数据协议一切从抓包开始吧

作者 huruwo

分析数据协议一切从抓包开始吧

相关文件下载链接

apk文件 https://apkpure.com/quintoandar-im%C3%B3veis/br.com.quintoandar.inquilinos
抓包工具 https://www.charlesproxy.com/latest-release/download.do
端口转发工具 https://github.com/smilingott/socksdroid

配置转发和抓包软件

配置看截图即可

抓包成功短信数据接口

request

POST /phone-confirmation/start HTTP/1.1
Host: login.quintoandar.com.br
Connection: keep-alive
Content-Length: 42
Accept: application/json
Origin: https://www.quintoandar.com.br
User-Agent: Mozilla/5.0 (Linux; Android 8.1.0; M1852 Build/OPM1.171019.026; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36
Content-Type: application/json
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,en-US;q=0.9
Cookie: ab.storage.deviceId.cf9e8c77-7b32-4126-940b-b58658d0918e=%7B%22g%22%3A%22fa0ca0c5-cdfa-7ff1-78f6-53d8989dd4d3%22%2C%22c%22%3A1645690761095%2C%22l%22%3A1645690761095%7D; native_tabbar_enabled=true; _hjSessionUser_1203740=eyJpZCI6ImI0MDdiMzM4LTJkZjktNWEwYi05NDBmLTk0OThhYzIyZDJhYyIsImNyZWF0ZWQiOjE2NDU2OTA3NjI0ODAsImV4aXN0aW5nIjpmYWxzZX0=; _hjFirstSeen=1; _hjSession_1203740=eyJpZCI6Ijc0NTI2ZmYyLTU2NzgtNDQxOS05YTJiLWMxMmI3ODFmOGFiNSIsImNyZWF0ZWQiOjE2NDU2OTA3NjI1ODMsImluU2FtcGxlIjpmYWxzZX0=; _hjAbsoluteSessionInProgress=0; _gcl_au=1.1.1197469709.1645690763; _pin_unauth=dWlkPU1UQTJZek5qT0dRdFl6RTRaaTAwT1Raa0xUa3lPR1l0TWpWbU5ESXdaVGhrWkROag; _ga=GA1.3.260618886.1645690764; _gid=GA1.3.1555034707.1645690766; _ga_QKMEKSZFGJ=GS1.1.1645690762.1.0.1645690765.57; _ga_2NHZ8V3TH0=GS1.1.1645690762.1.0.1645690765.57; _uetsid=7ae46680954a11ecb79ba15a14da35ec; _uetvid=7ae5f3a0954a11ec9172d1f781d03ad0; _fbp=fb.2.1645690767315.977786182; _clck=d4p0ya|1|ez9|0; sp=20187cea-c4a2-4b45-ae18-67b80b5443fd; 5A_COOKIE_ACCEPT=true; amplitude_id_3fbf25d58c3cce92f0e6609904a37cc9quintoandar.com.br=eyJkZXZpY2VJZCI6IjQ5MGJhNDIyLTNmZTUtNDE5Yi05OTBlLWM1OTBiMTgxZmM0Y1IiLCJ1c2VySWQiOm51bGwsIm9wdE91dCI6ZmFsc2UsInNlc3Npb25JZCI6MTY0NTY5MDc2MTA0NSwibGFzdEV2ZW50VGltZSI6MTY0NTY5MDg1MTAxNCwiZXZlbnRJZCI6NCwiaWRlbnRpZnlJZCI6Niwic2VxdWVuY2VOdW1iZXIiOjEwfQ==; ab.storage.sessionId.cf9e8c77-7b32-4126-940b-b58658d0918e=%7B%22g%22%3A%2212f3e97f-0f12-3af1-266f-838b5102c957%22%2C%22e%22%3A1645692651026%2C%22c%22%3A1645690761079%2C%22l%22%3A1645690851026%7D
X-Requested-With: br.com.quintoandar.inquilinos

{"phone":"+8613768005847","channel":"SMS"}

response

{
    "success": true,
    "sessionId": "Y-BtDTgswFN1mRU6ALDaI50csN1tO8CaetWEprPX8uo-RhAU"
}

cookie参数分析

接下来我们就这个接口进行分析,尤其是cookie的一些参数

ab.storage.deviceId.cf9e8c77-7b32-4126-940b-b58658d0918e=%7B%22g%22%3A%22fa0ca0c5-cdfa-7ff1-78f6-53d8989dd4d3%22%2C%22c%22%3A1645690761095%2C%22l%22%3A1645690761095%7D;
native_tabbar_enabled=true;
_hjSessionUser_1203740=eyJpZCI6ImI0MDdiMzM4LTJkZjktNWEwYi05NDBmLTk0OThhYzIyZDJhYyIsImNyZWF0ZWQiOjE2NDU2OTA3NjI0ODAsImV4aXN0aW5nIjpmYWxzZX0=;
_hjFirstSeen=1;
_hjSession_1203740=eyJpZCI6Ijc0NTI2ZmYyLTU2NzgtNDQxOS05YTJiLWMxMmI3ODFmOGFiNSIsImNyZWF0ZWQiOjE2NDU2OTA3NjI1ODMsImluU2FtcGxlIjpmYWxzZX0=;
_hjAbsoluteSessionInProgress=0; _gcl_au=1.1.1197469709.1645690763; _pin_unauth=dWlkPU1UQTJZek5qT0dRdFl6RTRaaTAwT1Raa0xUa3lPR1l0TWpWbU5ESXdaVGhrWkROag; _ga=GA1.3.260618886.1645690764; _gid=GA1.3.1555034707.1645690766;
_ga_QKMEKSZFGJ=GS1.1.1645690762.1.0.1645690765.57; _ga_2NHZ8V3TH0=GS1.1.1645690762.1.0.1645690765.57; _uetsid=7ae46680954a11ecb79ba15a14da35ec;
_uetvid=7ae5f3a0954a11ec9172d1f781d03ad0; _fbp=fb.2.1645690767315.977786182; _clck=d4p0ya|1|ez9|0; sp=20187cea-c4a2-4b45-ae18-67b80b5443fd; 5A_COOKIE_ACCEPT=true;
amplitude_id_3fbf25d58c3cce92f0e6609904a37cc9quintoandar.com.br=eyJkZXZpY2VJZCI6IjQ5MGJhNDIyLTNmZTUtNDE5Yi05OTBlLWM1OTBiMTgxZmM0Y1IiLCJ1c2VySWQiOm51bGwsIm9wdE91dCI6ZmFsc2UsInNlc3Npb25JZCI6MTY0NTY5MDc2MTA0NSwibGFzdEV2ZW50VGltZSI6MTY0NTY5MDg1MTAxNCwiZXZlbnRJZCI6NCwiaWRlbnRpZnlJZCI6Niwic2VxdWVuY2VOdW1iZXIiOjEwfQ==;
ab.storage.sessionId.cf9e8c77-7b32-4126-940b-b58658d0918e=%7B%22g%22%3A%2212f3e97f-0f12-3af1-266f-838b5102c957%22%2C%22e%22%3A1645692651026%2C%22c%22%3A1645690761079%2C%22l%22%3A1645690851026%7D

尝试分析其中一个或者几个参数的生成规律