lazyalex616/m01-b01-inner
소개
【高危】电信光猫预装插件 m01-b01-inner:家庭终端数据实名上报,服务器指令直接执行。上海、浙江两地原件与完整源码。 [HIGH RISK] China Telecom ONT plugin: identity-linked data reporting, server commands executed directly. Originals and full source.
보안 및 개인정보 보호측정된 스타 증가
- in 24h
- +18
- in 7 days
- +24
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original简体中文 | English

【高危】电信光猫预装插件 m01-b01-inner:实名关联的终端数据采集与远程命令执行
[!CAUTION] 风险等级:高 已在上海、浙江两地在网光猫中确认。
- 默认启用:每日上报家庭全部终端清单;上海版每 30 分钟上报从网址和 Cookie 中提取的手机号、IMEI、IMSI 与经纬度。
- 实名关联:每条上报均携带宽带账号与 LOID,可直接对应到实名宽带用户。
- 远程执行:服务器回复由插件直接执行,可下发系统命令、加载新代码、替换插件本体。
这是电信光猫里预装的一个插件,能收集家里设备的清单和部分上网记录并上报,还能执行远程下发的命令。本仓库收录两地的 init.bin 原件、完整 Lua 源码和模块索引。
上海电信和浙江电信的两台光猫搭载了不同版本的 m01-b01-inner。两版均以 init.bin 分发 Lua 源码,采用 zlib 压缩、AES-128-ECB 加密。
| 样本 | init.bin 大小 |
Lua 源码大小 | 模块数(含基础库) |
|---|---|---|---|
| 上海 | 244,440 字节 | 1,151,589 字节 | 119 |
| 浙江 | 141,160 字节 | 661,590 字节 | 90 |
样本来源与收录范围
两份样本均于 2026 年 11 月取自在用的电信光猫,各自的 init.bin 原件解密解压后,与插件运行时内存中的 Lua 文本逐字节一致。
| 内容 | 是否收录 |
|---|---|
设备原件 init.bin、完整 Lua 文本 init.lua |
收录,保持原始字节。SHA-256 见 FORMAT.md |
单页节选 init.public.lua |
保留。完整源码见同目录 init.lua |
| 源码节选、模块索引 | 收录。行号均对应设备原件中的 Lua 文本 |
文件结构
init.bin 由 24 字节包头和密文正文组成:
偏移 0 4 字节 固定值 20 18 04 12
偏移 4 4 字节 整个文件的字节数
偏移 8 4 字节 压缩流的字节数
偏移 12 4 字节 Lua 文本的字节数(大端)
偏移 16 4 字节 全零
偏移 20 4 字节 Lua 文本的字节数(小端,与偏移 12 相同)
偏移 24 至文件尾 AES-128-ECB 密文
正文解密后,按偏移 8 声明的长度截取 zlib 压缩流,解压即得 Lua 文本。两份样本的压缩流与 zlib 级别 9 的输出逐字节一致。各字段的取值和原件指纹见 FORMAT.md。
共有功能
| 模块 | 行为及默认配置 |
|---|---|
topo |
设备清单关联宽带账号、光猫入网标识(LOID)、序列号、Wi-Fi 名称及内外网 IP。终端字段包括 MAC、主机名、品牌型号、系统、在线时长和收发流量。默认每日上报完整清单,每小时上报在线设备。 |
http_imei、sigcollect |
默认从明文 HTTP 网址和 Cookie 中匹配名为 imei 的 15 位值,纳入终端特征上报。 |
domain_dip |
设备访问指定智能家居服务后,记录该设备随后 10 秒内访问的其他域名及对应 IP。默认开启,每 4 小时上报。 |
http、https、rawpkt、pcap_dump |
解析明文 HTTP 请求中的网址、来源页、客户端标识和 Cookie,识别 HTTPS 连接中可见的域名。支持按规则采集、记录和回放报文。浙江版 http 的说明文字写作 get dns,代码解析的字段与上海版相同。 |
hredirect |
按域名和路径重定向明文 HTTP 请求。默认关闭,规则表为空。 |
pktpolicy、appctrl、appmlp |
按设备、应用和时段丢包、中止连接或调整流量优先级。 |
pscan |
下载改名为 n01 的 nmap 扫描局域网,参数含 -sV(服务版本识别)。上报设备地址、开放端口、服务名称及版本;扫描脚本输出的结果以 dev_vuln 类型上报。默认周期为零。 |
shell、hotpatch、upgrade |
在插件权限内执行远端下发的系统命令并返回结果;运行时加载 Lua 模块;更新脚本、识别规则和插件。 |
以下为各模块的关键源码。摘要行给出模块在完整源码中的位置;代码块里的行号对应上海样本 init.lua,另有标注的除外。
topo · 上海 L28283-L29513 · 浙江 L17635-L18826
-- L28303
send_period = 86400,
send_active_period = 3600,
-- <...>
-- L28434
add_value(gw_info, "2g_ssid", wifi_info["2g_ssid"], "")
-- <...>
-- L28447
add_value(gw_info, "pppoe", pppoe.pppoe, "")
add_value(gw_info, "loid", poninfo.loid, "")
-- <...>
-- L28450
add_value(gw_info, "wan_ip", netinfo.wan_ip, "")
-- <...>
-- L28858
info.hostname = laninfo.hostname
-- <...>
-- L28861
info.ip = laninfo.ip
http_imei · 上海 L7670-L7866 · 浙江 L4562-L4758
-- L7701
keywords = {"imei"},
-- <...>
-- L7703
attr = {"url", "cookie"},
sigcollect · 上海 L22455-L22916 · 浙江 L12847-L13258
-- L22470
enable = true,
-- <...>
-- L22473
newdev_period = 600,
-- <...>
-- L22480
coll_type = {"term_http","hostname","elink","mdns","upnp","vendor","dhcp_hostname","imei","mac","devname","term_pkt","term_domain"},
domain_dip · 上海 L6606-L6818 · 浙江 L3717-L3929
-- L6623
upperiod = 14400,
-- <...>
-- L6716
add_sig(mac, domainip, time, false) -- add other sig within 10 seconds
http · 上海 L7506-L7668 · 浙江 L4417-L4560
上海样本:
-- L7517
help = "get http from kernel and send to server",
period = 0,
-- <...>
-- L7538
http_table.url, next_pos = string.unpack(string.format("c%d", url_len), sbytes, next_pos)
-- <...>
-- L7541
http_table.ref, next_pos = string.unpack(string.format("c%d", ref_len), sbytes, next_pos)
-- <...>
-- L7544
http_table.ua, next_pos = string.unpack(string.format("c%d", ua_len), sbytes, next_pos)
-- <...>
-- L7547
http_table.cookie, next_pos = string.unpack(string.format("c%d", cookie_len), sbytes, next_pos)
浙江样本:
-- L4428
help = "get dns from kernel and send to server",
-- <...>
-- L4448
http_table.url, next_pos = string.unpack(string.format("c%d", url_len), sbytes, next_pos)
-- <...>
-- L4451
http_table.ref, next_pos = string.unpack(string.format("c%d", ref_len), sbytes, next_pos)
-- <...>
-- L4454
http_table.ua, next_pos = string.unpack(string.format("c%d", ua_len), sbytes, next_pos)
-- <...>
-- L4457
http_table.cookie, next_pos = string.unpack(string.format("c%d", cookie_len), sbytes, next_pos)
https · 上海 L9335-L9426 · 浙江 L5730-L5816
-- L9349
help = "get https from kernel and send to server"
-- <...>
-- L9361
type = "https_domain",
-- <...>
-- L9369
domain = svrname,
rawpkt · 上海 L21501-L21947 · 浙江 L11970-L12407
-- L21519
help = "get rawpkt from kernel and send to server",
-- <...>
-- L21522
conn_limit_pkts = 16, -- max pkts in one conn(tuple), 0 means no limit
pcap_dump · 上海 L16553-L16676 · 浙江 L10318-L10339
-- L16563
help = "read/write/stat/replay pcap",
hredirect · 上海 L7365-L7504 · 浙江 L4286-L4415
-- L7376
help = "redirect http from server",
-- <...>
-- L7380
enable = false,
rules = {},
pktpolicy · 上海 L16770-L17284 · 浙江 L10341-L10822
-- L16787
help = "set pktpolicy and send info to server",
-- <...>
-- L16800
enable = true,
appctrl · 上海 L761-L1046 · 浙江 L3-L272
-- L777
help = "set appctrl and send info to server",
appmlp · 上海 L1048-L1350 · 浙江 L730-L1032
-- L1063
help = "set appmlp and real time send info to server",
pscan · 上海 L18040-L18443 · 浙江 L11568-L11968
-- L18055
period = 0,
-- <...>
-- L18058
argv = ' --max-rate 10 -sV -oX ',
prog = 'n01',
-- <...>
-- L18070
help = "parse n01 result and send to oper_data"
-- <...>
-- L18129
local one = {type = "dev_vuln", mac = mac, ip = ip, script_name = script.id or "", vuln_info = cjson.encode(info)}
-- <...>
-- L18145
service = get_attr(v.kids, "service", {name = true, version = true, product = true})
-- <...>
-- L18149
local one = {type = "pscan_v1", mac = mac, ip = ip, port = portid, proto = port.protocol or "", status = state.state or "", svr = service.name or "", version = service.version or "", product = service.product or ""}
-- <...>
-- L18334
-- download nmap tarball to tmp path
shell · 上海 L22300-L22337 · 浙江 L12692-L12729
-- L22306
help = "run shell cmd and return result",
hotpatch · 上海 L7212-L7363 · 浙江 L4142-L4284
-- L7222
help = "hot fixbug, and hot add more function",
upgrade · 上海 L29710-L29818 · 浙江 L19003-L19111
-- L29719
help = "upgrade for plugin/lua/sig",
仅见于上海样本的模块
| 模块 | 行为及默认配置 |
|---|---|
xid |
从明文 HTTP 网址、来源页和 Cookie 中匹配手机号、IMEI、IMSI(移动用户识别码)、广告标识及经纬度字段,与设备和域名关联。默认每 30 分钟上报。 |
coll_domain |
按设备统计域名访问次数、时长和来源页。内置东方财富、同花顺、问财、雪球的网址匹配规则,用于提取股票代码。默认上报周期为零。 |
crawler |
每批接收最多 30 个网址,经用户宽带出口访问,将网页内容返回平台。默认关闭。 |
onvif |
发现局域网摄像头,查询型号、序列号和固件版本,使用平台配置的账号列表尝试认证。默认采集周期为零。 |
termact |
匹配发往 445 端口的特定 SMB2 文件共享报文,将应用层内容与设备地址一并交给上报模块。规则还涉及 DHCPv6、mDNS、部分 IPTV 和小米设备流量,以及组播报文。默认关闭。 |
xapp、quic、httpdns |
xapp 可记录网址、Cookie、来源页和部分报文内容,相关流量上报默认关闭。quic 识别部分 HTTP/3 连接中的域名;httpdns 记录特定域名解析服务返回的结果。 |
qrcstats |
扫描附近的 Wi-Fi 网络。默认采集周期为零。 |
xid · 上海 L30826-L31050
-- L30842
upload_mode = "svrdata", -- "none", "svrdata", "operdata", "all"
-- <...>
-- L30845
period = 1800,
-- <...>
-- L30855
attr = {"url", "ref", "cookie"},
coll_domain · 上海 L3989-L4255
-- L4003
help = "collect domain/stock data and send to svrdata",
-- <...>
-- L4010
upload_period = 0, -- default disable
session_period = 1800,
-- <...>
-- L4015
["gbapi.eastmoney.com"] = {url = {"[?&]code=%u*(%d+)&?"}},
["ai.10jqka.com.cn"] = {url = {"[?&]code=%u*(%d+)&?"}},
["www.iwencai.com"] = {url = {"[?&]q=%u*(%d+)&?"}},
-- <...>
-- L4019
["stockpage.10jqka.com.cn"] = {url = {"[^/]/%u*(%d+)/?"}},
["xueqiu.com"] = {url = {"[^/]/%u*(%d+)/?"}},
-- <...>
-- L4022
["quote.eastmoney.com"] = {ref = {"[^/]/%a*(%d+).html"}},
["myfavor.eastmoney.com"] = {ref = {"[^/]/%a*(%d+).html"}},
-- <...>
-- L4076
tt.stock_code = dtype_value or ""
crawler · 上海 L4363-L4696
-- L4388
enable = false, -- default is disable
-- <...>
-- L4390
max_crawl_cnt = 30, -- maximum number of climbs
onvif · 上海 L14832-L15356
-- L14848
help = "support to collect sig of onvif",
period = 0, -- default close
termact · 上海 L27881-L28148
-- L27896
help = "collect termact to server",
-- <...>
-- L27899
enable = false,
-- <...>
-- L27901
-- Samba, tcp dst port 445, "4,FE534D42", "16,01002100"
xapp · 上海 L30239-L30824
-- L30255
help = "send appinfo to server",
-- <...>
-- L30259
flow_enable = false, -- 是否采集流特征数据,默认关闭
tag_enable = false, -- 是否采集标签特征数据,默认关闭
quic · 上海 L20814-L21499
-- L20825
help = "get quic from PCAP and send to server",
-- <...>
-- L20828
upload_mode = "none", -- "none", "svrdata", "operdata", "all"
httpdns · 上海 L8844-L9333
-- L8858
help="http dns parse",
-- <...>
-- L8860
enable = true,
-- <...>
-- L8863
upload_enable = false,
qrcstats · 上海 L19840-L20476
-- L19853
help = "get root cause stats",
-- <...>
-- L19855
collect_period = 0,
上报去向
| 服务器 | 上报内容 | 模块 | 默认周期 | 地址所在位置 |
|---|---|---|---|---|
b01-data-reported.189cube.com:7890 |
主数据:家庭设备拓扑与设备清单;上海版另有 xid 匹配出的手机号、IMEI、IMSI、广告标识、经纬度 |
topo、xid,经 svrdata 发送 |
30 分钟 | 平台下发配置;发送入口见上海 L29360、L30915 |
b01.189cube.com:7870 |
运维通道:心跳、命令执行结果、原始报文;上海版 coll_domain 的股票代码与域名统计 |
svroper、operdata、rawpkt、coll_domain |
心跳 2 小时,原始报文 10 分钟;coll_domain 默认关闭 |
插件自带配置;coll_domain 见上海 L4009 |
term.189cube.com:7870 |
每台设备的特征:IMEI、MAC、主机名、型号等 | sigcollect |
4 小时,新设备 10 分钟 | 上海 L22485,浙江 L12877 |
message.189cube.com:9890 |
App 使用统计、应用控制 | appctrl、appuse、appmlp |
按配置 | 上海 L782,浙江 L24 |
xapp.189cube.com:7870/7871/7872 |
应用特征、安全数据;上海版 crawler 代抓回传的网页内容 |
sec_data、xapp、crawler;浙江 appinfo |
按配置 | 上海 L22095、L4387,浙江 L12487、L325 |
mk-collect.189smarthome.com:7890 |
摄像头与局域网安全数据 | sec_camera |
默认关闭 | 上海 L22028,浙江 L12420 |
101.89.180.237:7890 |
不接收上报,是 pscan 下载扫描器 n01 的来源 |
pscan |
按需 | 上海 L18057,浙江 L11585 |
前两行的地址和周期写在插件自带的配置文件和平台下发的配置里,不在 init.lua 中,这两份配置未收录于本仓库。
每条上报都附带光猫身份(上海 L25810,浙江 L15885):
{"data":%s,"sn":"%s","oui":"%s","int_ver":"%s","ad":"%s","loid":"%s","ipv4":"%s"}
sn 是光猫序列号,ad 是宽带拨号账号,loid 是宽带注册码,一个 LOID 对应一个实名宽带账户。
股票代码(上海版 coll_domain)
- 从明文 HTTP 的网址和来源页中,按内置规则匹配东方财富、同花顺、问财、雪球 7 个域名,提取股票代码(L4013-L4024、L4137-L4161)。
- 每条记录含设备 MAC、域名、股票代码、访问次数、停留分钟数、会话数、首次和最后访问时间(L4062-L4076),同时按设备统计访问过的域名和来源页。
- 发往
b01.189cube.com:7870(L4009、L4087),并附带上面的光猫身份。 - 默认上报周期为零,即关闭(L4010)。服务器可下发配置开启,并替换匹配规则。浙江版没有这个模块。
这些域名是否还接受明文 HTTP
规则只对明文 HTTP 生效;走 HTTPS 时插件只能看到域名,看不到网址里的股票代码。
| 域名 | 规则匹配位置 | 明文 HTTP 请求结果 | 结论 |
|---|---|---|---|
gbapi.eastmoney.com |
网址参数 code= |
403,不跳转 | 仍接受明文 HTTP |
ai.10jqka.com.cn |
网址参数 code= |
404,不跳转 | 仍接受明文 HTTP |
myfavor.eastmoney.com |
来源页 | 404,不跳转 | 仍接受明文 HTTP |
stockpage.10jqka.com.cn |
网址路径 | 首页 200,页面脚本再把地址换成 https;个股页 403,不跳转 |
首页靠脚本跳转,个股页仍接受明文 |
xueqiu.com |
网址路径 | 首页 301 跳转 HTTPS;个股页 200,返回防火墙验证页 | 首页跳转,个股页无法判定 |
www.iwencai.com |
网址参数 q= |
301 跳转 HTTPS | 跳转 HTTPS |
quote.eastmoney.com |
来源页 | 302 跳转 HTTPS | 跳转 HTTPS |
- 测试于 2026-11-19,从家庭宽带直连,用
curl对每个域名发送不带浏览器特征的明文 GET 请求,个股页以 600519 为例。 - 结果只说明这些域名还接不接受明文请求,不代表网页或 App 实际使用 HTTP。
- 跳转到 HTTPS 也挡不住第一次请求:跳转发生之前,带股票代码的明文网址已经经过光猫。
外部线索核对
| 线索 | 核对结果 |
|---|---|
临时下发 capvip,不在设备上保存,采集哔哩哔哩大会员等流媒体会员状态 |
两份随包源码均未见该模块,无下发样本可供核对。 |
| HTTP 302 跳转 | 两份样本均有 HTTP 重定向规则;实际响应码未核实。 |
| DNS 应答改写 | 上海样本的 HijackConfRW 定义含“域名 → IP”和“网址 → 跳转地址”字段。Lua 中未见 DNS 应答改写实现。浙江样本未见同名定义。 |
跳转功能与 dcm、nsxp30 木马投放有关 |
现有材料中未见关联代码、投放记录或终端感染证据。 |
| SMB 握手数据的用途 | 上海样本将匹配报文交给设备特征模块。服务端用途未知。 |
| 按地区下发不同策略 | 缺少同版本的跨地区下发记录。新疆、西藏暂无可供核对的样本。 |
文件
| 样本 | 完整 Lua 源码 | init.bin 原件 |
模块与原行号 | 源码节选 |
|---|---|---|---|---|
| 上海 | init.lua | init.bin | 119 个模块 | 27 个功能模块 |
| 浙江 | init.lua | init.bin | 90 个模块 | 18 个功能模块 |
许可
本仓库以 MIT 许可证 发布。
관련 프로젝트 살펴보기
불러오는 중…