更新 20230221


现在抓包已经抓不到这个链接了,不过在打开回放时会有一个请求 /group-live-share/index.htm?liveUuid=xxx

把这个请求拼接上去到下面的链接依旧可以打开网页版

不过获取到的 m3u8 链接依旧是无法直接下载的

写了个脚本来自动化该流程,可在 https://github.com/akkuman/ding_playback_downloader 获取


原始记录 20220907


想下载钉钉直播回放,管理员设置了禁止下载

找到了这篇文章

[[原创]钉钉如何下载管理员禁止的直播回放(抓包分析)-软件逆向-看雪论坛-安全社区|安全招聘|bbs.pediy.com](https://bbs.pediy.com/thread-274002.htm)

打开burp,配置好burp证书,然后使用proxifier将钉钉主程序 DingTalk.exe 的流量全部转发到 burp 代理端口。打开直播回放,点开直播

按照文章中的寻找,只找到了下面这个链接

解码出来获取到了

Untitled

其中有个 publicLandingUrl https://h5.dingtalk.com/group-live-share/index.htm?type=2&liveFromType=6&liveUuid=xxxx&bizType=dingtalk&dd_nav_bgcolor=FF2C2D2F#/union

浏览器打开这个链接,可以看到直播回放

播放视频,打开f12进行抓包,可以看到一个链接

https://dtliving-sh.dingtalk.com/live_hp/xxxx_merge.m3u8?auth_key=xxxxxx

这个链接中,xxxx是上面liveUuid,然后会看到一个m3u8,然后使用其他的工具下载并合并m3u8即可

其实上面的json中的 liveUrlHls ****中的auth_key可以用在拼接m3u8链接上,但是发现下载 liveUrlHls 需要单点登录(不知道这是不是我们公司的配置),而下载上面m3u8链接需要网页登录后cookie中PC_SESSION值

所以还是直接打开网页后使用idm之类的软件进行下载吧。

给出一份mitmproxy的脚本

 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
from mitmproxy import http
from mitmproxy import ctx
import re
import json

pattern = re.compile(r'\[live\-playback\-room\].+?\[response\](\{.+\})')

def request(flow: http.HTTPFlow) -> None:
    # if flow.request.pretty_host != 'retcode.taobao.com':
    #     return
    if not flow.request.path.startswith('/r.png'):
        return
    msg = flow.request.query.get('msg')
    if not msg:
        return
    if not pattern.match(msg):
        return
    data = pattern.search(msg)[1]
    try:
        data = json.loads(data)
    except Exception:
        return
    live_info = data.get('liveInfo')
    if not live_info:
        return
    live_uuid = live_info.get('liveUuid')
    ctx.log.info(f'获取到 liveUuid {live_uuid}')
    live_url_hls = live_info.get('liveUrlHls')
    ctx.log.info(f'获取到 liveUrlHls {live_url_hls}')
    ctx.log.inof(f"请打开网页使用IDM进行下载: {live_info.get('publicLandingUrl')}")

自动化的方案,之后再花时间研究