首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

TikTok 的应用程序日志都记录了什么内容?

近日,TikTok 的命运可谓一波三折。本文,我们来看下黑客对 TikTok 的研究结果吧。

本文最初发表在 Medium 博客,经原作者 Elliot Alderson 授权,InfoQ 中文站翻译并分享。

自从我发表第一篇文章《TikTok 用什么算法传输并加密内容?》(TikTok: Logs, Logs, Logs)以来,发生了很多事情。

我们还是用事实说话,以更好地了解 TikTok。

免责声明

  • TikTok 为用户提供了大量功能,这要归功于它高达数百万行的代码。因此,仅靠一篇文章是不可能涵盖像“TikTok 是否对国家安全构成威胁?”这样宽泛而模糊的问题答案。因此,我计划在一系列文章中讨论该问题,每篇文章都有特定的主题。
  • 我是一名法国安全研究员,多年来,一直在分析移动应用程序。你可以在 http://fs0c131y.com/press 网站找到我的公开作品,在 http://twitter.com/fs0c131y 找到我。
  • 我的目标完全透明,就是分享我知道的所有内容。
  • 如果想跳过技术细节,可以在本文末尾找到总结。

前言

在我上一篇文章《TikTok 用什么算法传输并加密内容?》(TikTok: Logs, Logs, Logs)中,我对 TikTok 发出的 app_log 网络请求的内容进行了解密。

完成解密后,有一个问题仍然存在:

事件记录。我需要仔细研究一下他们认为的“事件”是什么,但就我所知,这似乎是一个相当标准的分析解决方案。

在本文中,我将回答以下问题:TikTok 的应用程序日志的定义是什么?

什么是 TikTok 的应用程序日志?

我们的起点是 app_log 这一关键字。为了解 TikTok 是如何处理应用程序日志的,我对应用程序进行了反编译,并分析了源代码。我很快在 DBHelper 类中找到了 ss_app_log.db 的定义。

这很有趣,TikTok 使用本地数据库来存储应用程序日志。我特意查看了测试用的手机才确认这一点。

正如你所见,TikTok 创建了许多数据库。如果你打开 ss_app_log.db 这个文件,你可以在事件表中找到一些数据。

这些方法的签名给我们提供了 3 个新对象:LogEvent、LogPage、LogSession。

这回答了我们最初的问题!TikTok 的应用程序日志可以是 LogEvent、LogPage 或 LogSession。

这些应用程序日志(实际上)里面有什么?

很好,我找到了不同日志对象的定义,但 TikTok 真正发送的是什么呢?

是时候用 Frida 拦截 DBHelper 类的 6 种插入方法了。

通过这种方法,我得到了 TikTok 在使用应用程序时创建的所有应用程序日志的详细信息。下面是日志会话、日志事件和日志以及杂项日志的示例。

代码语言:javascript
复制
[Log Session]
active = false
app_version =  17.2.4
duration = 0
eventIndex = 0
id = 0
launch_sent = false
non_page = true
pausetime = 1596980554524
timestamp = 1596980554524
value = 6630a167-4cf8-46a3-ac6c-c4b45aab0a00
version_code = 2021702040
[Log Event]
category = event_v3
ext_json =  {"is_cache":1,"is_timeout":1,"cache_num":1,"_event_v3":1,"ab_sdk_version":"1799896,185215011,1868782,1788470,1791623","nt":4}
ext_value = 0
id = 0
instant_only = false
label = null
mHasTimelySend = false
session_id = 39
tag = pull_out_cache_video
teaEventIndex = 1
timestamp = 1596980554524
user_id = 0
value = 0
[Log]
value = {"event":[{"ad_extra_data":"{\"non_hb_ad\":0,\"hb_ad\":0}","is_ad_event":1,"is_i18n_sdk":1,"refer":"sdk","ab_sdk_version":"1799896,185215011,1868782,1788470,1791623","nt":4,"category":"event_v1","tag":"sdk_ad","label":"ad_sdk_bid_upload","session_id":"6630a167-4cf8-46a3-ac6c-c4b45aab0a00","datetime":"2020-08-09 15:42:34","event_id":655},{"nt":4,"category":"event_v1","tag":"launch_time","label":"perf_monitor","ext_value":858,"session_id":"6630a167-4cf8-46a3-ac6c-c4b45aab0a00","datetime":"2020-08-09 15:42:34","event_id":658}],"event_v3":[{"nt":4,"ab_sdk_version":"1799896,185215011,1868782,1788470,1791623","event":"pull_out_cache_video","params":{"is_cache":1,"is_timeout":1,"cache_num":1},"event_id":653,"tea_event_index":1,"local_time_ms":1596980554524,"session_id":"6630a167-4cf8-46a3-ac6c-c4b45aab0a00","datetime":"2020-08-09 15:42:34"},{"nt":4,"ab_sdk_version":"1799896,185215011,1868782,1788470,1791623","event":"caijing_iap_google_set_host","params":{"params_for_special":"caijing_pay_casher","set_host":"tp-pay-mva.byteoversea.com"},"event_id":654,"tea_event_index":2,"local_time_ms":1596980554600,"session_id":"6630a167-4cf8-46a3-ac6c-c4b45aab0a00","datetime":"2020-08-09 15:42:34"},{"nt":4,"ab_sdk_version":"1799896,185215011,1868782,1788470,1791623","event":"caijing_iap_google_upload_host","params":{"params_for_special":"caijing_pay_casher","upload_host":"tp-pay-mva.byteoversea.com","from":"confirm_task"},"event_id":656,"tea_event_index":3,"local_time_ms":1596980554729,"session_id":"6630a167-4cf8-46a3-ac6c-c4b45aab0a00","datetime":"2020-08-09 15:42:34"},{"nt":4,"ab_sdk_version":"1799896,185215011,1868782,1788470,1791623","event":"main_boot_type","params":{"type":1},"event_id":657,"tea_event_index":5,"local_time_ms":1596980554808,"session_id":"6630a167-4cf8-46a3-ac6c-c4b45aab0a00","datetime":"2020-08-09 15:42:34"},{"nt":4,"ab_sdk_version":"1799896,185215011,1868782,1788470,1791623","event":"power_launch_log","params":{"last_start_power":"100","last_session":"18980","last_end_power":"100","current_power":"100","launch_num":"14","is_cold_launch":"1","is_charging":"1"},"event_id":659,"tea_event_index":6,"local_time_ms":1596980554851,"session_id":"6630a167-4cf8-46a3-ac6c-c4b45aab0a00","datetime":"2020-08-09 15:42:34"}],"launch":[{"datetime":"2020-08-09 15:42:34","session_id":"6630a167-4cf8-46a3-ac6c-c4b45aab0a00","local_time_ms":1596980554524,"tea_event_index":0,"is_background":true,"ab_sdk_version":"1799896,185215011,1868782,1788470,1791623"},{"datetime":"2020-08-09 15:42:34","session_id":"05430002-b046-4ab3-9e7b-e4cc52f1a0b3","local_time_ms":1596980554861,"tea_event_index":0,"ab_sdk_version":"1799896,185215011,1868782,1788470,1791623"}],"magic_tag":"ss_app_log","time_sync":{"server_time":1596980557,"local_time":1596980557},"header":{"openudid":"e4340d3235274e4b","sdk_version":"2.5.6.3","package":"com.zhiliaoapp.musically","channel":"googleplay","display_name":"TikTok","app_version":"17.2.4","version_code":2021702040,"timezone":1,"access":"wifi","os":"Android","os_version":"8.1.0","os_api":27,"device_model":"Nexus 6P","device_brand":"google","device_manufacturer":"Huawei","language":"en","resolution":"2392x1440","display_density":"mdpi","density_dpi":560,"clientudid":"8e9b0431-e442-49c7-ac03-4bfea91b540f","install_id":"6857220033589053189","device_id":"6727990782160700929","sig_hash":"194326e82c84a639a52e5c023116f12a","aid":1233,"push_sdk":[1,2,7,8,9],"rom":"EMUI-4805388","release_build":"074debc_20200803","update_version_code":2021702040,"manifest_version_code":2021702040,"app_version_minor":"","cpu_abi":"arm64-v8a","not_request_sender":0,"rom_version":"OPM6.171019.030.E1","region":"US","tz_name":"Europe\/Paris","tz_offset":7200,"custom":{"filter_warn":0,"web_ua":"Mozilla\/5.0 (Linux; Android 8.1.0; Nexus 6P Build\/OPM6.171019.030.E1; wv) AppleWebKit\/537.36 (KHTML, like Gecko) Version\/4.0 Chrome\/84.0.4147.111 Mobile Safari\/537.36","user_period":-1,"user_mode":-1},"google_aid":"315f154c-a3a0-48de-b932-319e0595114b"},"_gen_time":1596980557330}
log_type =  0
[Misc Log]
session_id = 40
log_type =  media_loader
value = {"cache_content_length":0,"cache_hit_off":0,"download_task_num":0,"encrypt_version":1,"end_req_t":1596980559207,"err_code":0,"file_key":"v09044ac0000brd02sf4gdtjhfg5lrtg_bytevc1_540p_981609","han_sh_st":4,"io_read_size":0,"io_read_time":1,"is_auth_err":-1,"is_crc_err":-1,"is_hiJack_err":0,"l_err_code":0,"l_sta_code":206,"loader_download_size":1897451,"loader_info":"{\n   \"ac_check_level\" : 0,\n   \"check_sum_level\" : 0,\n   \"cost_time\" : 2042,\n   \"crc_err_url_index\" : 0,\n   \"down_load_size\" : 1897451,\n   \"download_size\" : 1897451,\n   \"end_req_t\" : 1596980559204,\n   \"err_code\" : 0,\n   \"err_stage\" : 0,\n   \"io_write_size\" : 1897451,\n   \"io_write_time\" : 171,\n   \"is_all_forbid\" : 0,\n   \"is_call_f_api\" : 0,\n   \"is_crc_err\" : -1,\n   \"is_enble_pre_con\" : 1,\n   \"is_hiJack_err\" : 0,\n   \"marked_io_speed\" : 0,\n   \"net_log\" : [\n      {\n         \"dns_start_t\" : 1596980557162,\n         \"dns_t\" : 1596980557266,\n         \"end_req_t\" : 1596980559204,\n         \"http_err_code\" : 0,\n         \"http_err_stage\" : -1,\n         \"http_first_body_t\" : 1596980557589,\n         \"http_open_end_t\" : 1596980557589,\n         \"ip_info\" : \"2.21.35.19\",\n         \"ip_list\" : \"2.21.35.19,2.21.35.42,2.21.35.8,2.21.35.24,2.21.35.43,2.21.35.41,2.21.35.16,2.21.35.25,2.21.35.27,\",\n         \"is_crc_err\" : -1,\n         \"is_force_https\" : 0,\n         \"is_socket_reuse\" : 0,\n         \"is_tls_ses_reuse\" : 0,\n         \"read_off\" : 1897451,\n         \"read_size\" : 1897451,\n         \"req_check_t\" : -1,\n         \"req_t\" : 1596980557162,\n         \"tcp_con_start_t\" : 1596980557266,\n         \"tcp_con_t\" : 1596980557322,\n         \"tcp_err_code\" : 0,\n         \"tcp_first_pack_t\" : 1596980557393,\n         \"tcp_window_size\" : -100000,\n         \"tls_version\" : \"TLSv1.2\",\n         \"url_index\" : 0\n      }\n   ],\n   \"network_version\" : \"avnetwork_andorid_1.1.4.5_boringssl\",\n   \"ori_url_num\" : -1,\n   \"read_off\" : 1897451,\n   \"req_t\" : 0,\n   \"speed_coe_value\" : 0.0,\n   \"tcp_err_code\" : 0,\n   \"url_fail_count\" : 0,\n   \"url_index\" : 0,\n   \"url_suc_count\" : 1,\n   \"urls\" : [\n      \"https:\/\/v16m.tiktokcdn.com\/2120bf3fa76a176531a3c7a37d1008eb\/5f32a04c\/video\/tos\/useast2a\/tos-useast2a-pve-0068\/73089af821d24176945a10483a866aec\/?a=1233&br=1916&bt=958&cr=3&cs=2&dr=0&ds=6&er=&l=20200809134235010189066019293A1EAC&lr=all&mime_type=video_mp4&qs=11&rc=anU4aW1nN3YzdTMzZjczM0ApODlmOjg4ODs5NzRlNzYzZWdxaWRlcWRjL2FfLS1eMTZzczZfYjUxY2JhL2FfMDJjYGI6Yw%253D%253D&vl=&vr=\",\n      \"https:\/\/v19.tiktokcdn.com\/3740f4af6869fd6e64346601b8163868\/5f32a04c\/video\/tos\/useast2a\/tos-useast2a-pve-0068\/73089af821d24176945a10483a866aec\/?a=1233&br=1916&bt=958&cr=3&cs=2&dr=0&ds=6&er=&l=20200809134235010189066019293A1EAC&lr=all&mime_type=video_mp4&qs=11&rc=anU4aW1nN3YzdTMzZjczM0ApODlmOjg4ODs5NzRlNzYzZWdxaWRlcWRjL2FfLS1eMTZzczZfYjUxY2JhL2FfMDJjYGI6Yw%253D%253D&vl=&vr=\",\n      \"https:\/\/api16-normal-c-useast1a.tiktokv.com\/aweme\/v1\/play\/?video_id=v09044ac0000brd02sf4gdtjhfg5lrtg&line=0&ratio=540p&media_type=4&vr_type=0&improve_bitrate=0&is_play_url=1&bytevc1=1&quality_type=11&adapt540=1&source=PackSourceEnum_FEED&pass-region=1&pass-route=1&iid=6857220033589053189&device_id=6727990782160700929&ac=wifi&channel=googleplay&aid=1233&app_name=musical_ly&version_code=170204&version_name=17.2.4&device_platform=android&ab_version=17.2.4&ssmix=a&device_type=Nexus%2b6P&device_brand=google&language=en&os_api=27&os_version=8.1.0&openudid=e4340d3235274e4b&manifest_version_code=2021702040&resolution=1440%2a2392&dpi=560&update_version_code=2021702040&_rticket=1596980556917&storage_type=1&current_region=FR&app_type=normal&pass-route=1&cpu_support64=true&host_abi=arm64-v8a&sys_region=US&appTheme=light&pass-region=1&timezone_name=Europe%252FParis&residence=FR&app_language=en&ac2=wifi&uoo=0&op_region=FR&timezone_offset=3600&build_number=17.2.4&locale=en&region=US&ts=1596980556&cdid=3506991f-9724-4c2c-b62e-37e84dc465fe\"\n   ]\n}\n","loader_type":0,"log_type":"media_loader","net_content_length":1897451,"raw_key":"v09044ac0000brd02sf4gdtjhfg5lrtg_bytevc1_540p_981609","read_cache_size":0,"read_loader_size":1897451,"receive_req_t":1596980557154,"reply_code":206,"reply_player_size":1897451,"req_end_off":0,"req_off":0,"ret":0,"sdk_ua":"AVMDL-1.0.33.1-boringssl-boringssl-ANDROID","sdk_version":"AVMDL-1.0.33.1-boringssl-boringssl","task_type":1,"trace_id":"6727990782160700929T1596980557123T18185","use_file_mgr":1,"wait_task_num":0}

我还发布了 TikTok 在应用程序启动期间创建的应用程序日志的完整列表:

https://gist.github.com/fs0c131y/b4ef278e8863c636964793e1b27f889d

这些日志是否包含个人数据?答案是没有。你最多能找到的是关于设备的数据,如操作系统、操作系统版本、设备型号、设备品牌、像素密度等,基本上就这些了,仅此而已。

总结

在本文中,我找到了TikTok不同类型日志的定义,并观察了他们是如何动态创建的。经过分析,应用程序日志似乎并不含个人数据。

通过这两篇文章,我们对 TikTok 应用程序日志有了一个很好的概述。下一篇文章将专门讨论TikTok 如何在 Android 系统上使用一个众所周知的技巧来获取用户设备的 Mac 地址。

前文回顾:

TikTok 用什么算法传输并加密内容?

作者介绍:

Elliot Alderson,法国黑客。在 Predicta Lab 打击虚假信息,与 USANetwork 无关。

原文链接:

https://medium.com/@fs0c131y/tiktok-what-is-an-app-log-da70193f875

  • 发表于:
  • 本文为 InfoQ 中文站特供稿件
  • 首发地址https://www.infoq.cn/article/jVs6PYeKeIe13jBE74jJ
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券
http://www.vxiaotou.com