V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  jamesjammy061  ›  全部回复第 7 页 / 共 14 页
回复总数  261
1  2  3  4  5  6  7  8  9  10 ... 14  
2025 年 3 月 16 日
回复了 nobodybutme 创建的主题 职场话题 2025 如何破解企微打卡
要是 Android 也可以有 obs 的虚拟摄像头就好了。用 ndi 串流本地摄像头过去
2025 年 3 月 16 日
回复了 NianBroken 创建的主题 问与答 可以画涩图的非本地 AI 有哪些?
那本地部署的有哪些🤣
2025 年 3 月 15 日
回复了 linchem 创建的主题 Visual Studio Code Vscode 多人同时使用情况下配置解决方案
挺烦的,我直接.gitignore 加一行 .vscode
2025 年 3 月 14 日
回复了 zhengfan2016 创建的主题 React 反思,我写的前端的 react 味是不是太重了
我一般是写一起,大了再拆出来。或者预期一开始就能预料到是分开写的,我也会先写一起,写的一定程度再拆
2025 年 3 月 13 日
回复了 ryougifujino 创建的主题 程序员 突然有点喜欢 Tauri 2.0 了
@ETiV 刚刚看到的🤣 /t/1094563
2025 年 3 月 13 日
回复了 ryougifujino 创建的主题 程序员 突然有点喜欢 Tauri 2.0 了
rust 换成 go 就好了
2025 年 3 月 12 日
回复了 bsg1992 创建的主题 职场话题 身为面试官如何能 找出来匹配的候选人
感觉这种题目,适合应届校招🤣的八股
2025 年 3 月 12 日
回复了 NianBroken 创建的主题 编辑器 Windows 求推荐能秒开的纯文本编辑器
再下一个 vscode insider
+1
感觉怎么不太好用。有些 class 一下想不起来还要查文档,搞的 html 乱七八糟,感觉还不如写原本的 css ,就是取名字有点麻烦
2025 年 3 月 11 日
回复了 kongkongye 创建的主题 V2EX 有 V2EX 帖子内容总结类浏览器扩展吗?
我用的 kimi 阅读助手
2025 年 3 月 10 日
回复了 najunuoyan 创建的主题 Apple mac 连接小米手机大家试过吗
剩下的办法可能就是看下能不能 hook 他的启动函数了,直接入参过去调用
2025 年 3 月 10 日
回复了 najunuoyan 创建的主题 Apple mac 连接小米手机大家试过吗
强制诱骗感觉不太行,wireshark 捕获包之后重复都无法触发,估计还会有单播包的心跳或者校验包
2025 年 3 月 10 日
回复了 najunuoyan 创建的主题 Apple mac 连接小米手机大家试过吗
python 代码如下
```py
#!/usr/bin/env python3

from zeroconf import ServiceBrowser, Zeroconf
import time
import socket
from typing import List, Dict, Optional

class MDNSListener:
def __init__(self):
self.services: Dict[str, Dict] = {}

def remove_service(self, zeroconf: Zeroconf, type_: str, name: str) -> None:
print(f"服务被移除: {name}")
if name in self.services:
del self.services[name]

def add_service(self, zeroconf: Zeroconf, type_: str, name: str) -> None:
info = zeroconf.get_service_info(type_, name)
if info:
addresses = [socket.inet_ntoa(addr) for addr in info.addresses]
self.services[name] = {
'name': name,
'type': type_,
'addresses': addresses,
'port': info.port,
'server': info.server,
'properties': info.properties
}
print(f"发现新服务: {name}")
print(f" 地址: {', '.join(addresses)}")
print(f" 端口: {info.port}")
print(f" 服务器: {info.server}")

def update_service(self, zeroconf: Zeroconf, type_: str, name: str) -> None:
print(f"服务更新: {name}")
self.add_service(zeroconf, type_, name)

def discover_services(duration: int = 5) -> Dict[str, Dict]:
"""发现本地网络中的所有 mDNS 服务"""
zeroconf = Zeroconf()
listener = MDNSListener()

# 常见的服务类型
service_types = [
# "_http._tcp.local.",
# "_https._tcp.local.",
# "_workstation._tcp.local.",
# "_printer._tcp.local.",
# "_ipp._tcp.local.",
# "_airplay._tcp.local.",
# "_spotify-connect._tcp.local.",
# "_googlecast._tcp.local.",
# "_googlecast._tcp.local.",
"_mi-connect._udp.local.",
"_lyra-mdns._udp.local.",
]

browsers = [ServiceBrowser(zeroconf, service_type, listener)
for service_type in service_types]

try:
print(f"正在扫描 mDNS 服务,持续{duration}秒...")
time.sleep(duration)
finally:
zeroconf.close()

return listener.services

def query_service_details(service_name: str, service_type: str) -> Optional[Dict]:
"""查询特定服务的详细信息"""
zeroconf = Zeroconf()
try:
info = zeroconf.get_service_info(service_type, service_name)
if info:
addresses = [socket.inet_ntoa(addr) for addr in info.addresses]
return {
'name': service_name,
'type': service_type,
'addresses': addresses,
'port': info.port,
'server': info.server,
'properties': {k.decode(): v.decode() if isinstance(v, bytes) else v
for k, v in info.properties.items()}
}
finally:
zeroconf.close()
return None

def main():
# 1. 发现所有服务
print("开始扫描本地网络中的 mDNS 服务...")
services = discover_services(10) # 扫描 10 秒

# 2. 显示所有发现的服务
print("\n 发现的所有服务:")
for name, service in services.items():
print(f"\n 服务名称: {name}")
print(f"服务类型: {service['type']}")
print(f"IP 地址: {', '.join(service['addresses'])}")
print(f"端口: {service['port']}")
print(f"服务器: {service['server']}")

# 3. 如果发现了服务,查询第一个服务的详细信息
if services:
first_service = next(iter(services.items()))
name, service = first_service
print(f"\n 获取服务 '{name}' 的详细信息:")
details = query_service_details(name, service['type'])
if details:
print("详细信息:")
print(f"属性: {details['properties']}")
else:
print("无法获取详细信息")
else:
print("\n 未发现任何服务")

if __name__ == "__main__":
main()
```

响应结果

```
❯ python mdns_discovery.py
开始扫描本地网络中的 mDNS 服务...
正在扫描 mDNS 服务,持续 10 秒...
发现新服务: 3F2E52BE._lyra-mdns._udp.local.
地址: 192.168.136.46
端口: 5353
服务器: 3F2E52BE.local.
服务更新: 3F2E52BE._lyra-mdns._udp.local.
发现新服务: 3F2E52BE._lyra-mdns._udp.local.
地址: 192.168.136.46
端口: 5353
服务器: 3F2E52BE.local.

发现的所有服务:

服务名称: 3F2E52BE._lyra-mdns._udp.local.
服务类型: _lyra-mdns._udp.local.
IP 地址: 192.168.136.46
端口: 5353
服务器: 3F2E52BE.local.

获取服务 '3F2E52BE._lyra-mdns._udp.local.' 的详细信息:
详细信息:
属性: {'AppData': 'AkEBPy5Svug7AAIBDwoDAYNPAQEgAhlNYXR0aGV3IFBlcmV655qEUmVkbWkgSzUwIwAjAr+Q', 'MediumType': '64', 'DebugInfo': '{msg:reply, ifname:ap0, v4:192.$)+.$&).46, v6:fe80::&#<+:($@@:@?$*:4903}'}

```
2025 年 3 月 10 日
回复了 najunuoyan 创建的主题 Apple mac 连接小米手机大家试过吗
找到了一些端倪,

wireshark 抓包显示,过滤所有组播 ip `ip.dst >= 224.0.0.0 and ip.dst <= 239.255.255.255`

```log
Standard query response 0x0000 PTR, cache flush Android.local PTR, cache flush Android.local A, cache flush 192.168.136.46 AAAA, cache flush fe80::30b8:51ff:fe17:4903 NSEC, cache flush 46.136.168.192.in-addr.arpa NSEC, cache flush 3.0.9.4.7.1.E.F.F.F.1.5.8.B.0.3.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa NSEC, cache flush Android.local
Standard query 0x0000 PTR _mi-connect._udp.local, "QU" question
Standard query 0x0000 PTR _lyra-mdns._udp.local, "QU" question
```

里面好像可以看到三个 mDNS 的类型,`_mi-connect._udp.local`、`_lyra-mdns._udp.local`、`Android.local`

然后直接用 macOS 自带的命令查了一下 `dns-sd -B _lyra-mdns._udp local` 只有 `_lyra-mdns` 这个有数据

```log
❯ dns-sd -B _lyra-mdns._udp local
Browsing for _lyra-mdns._udp.local
DATE: ---Mon 10 Mar 2025---
21:40:02.665 ...STARTING...
Timestamp A/R Flags if Domain Service Type Instance Name
21:40:06.193 Add 2 17 local. _lyra-mdns._udp. 3F2E52BE
21:41:11.105 Rmv 0 17 local. _lyra-mdns._udp. 3F2E52BE
```

然后继续看下它广播了什么东西 `dns-sd -L "3F2E52BE" _lyra-mdns._udp local.`

```log
❯ dns-sd -L "3F2E52BE" _lyra-mdns._udp local.
Lookup 3F2E52BE._lyra-mdns._udp.local.
DATE: ---Mon 10 Mar 2025---
21:42:45.657 ...STARTING...
21:42:47.422 3F2E52BE._lyra-mdns._udp.local. can be reached at 3F2E52BE.local.:5353 (interface 17)
AppData=AkEBPy5Svug7AAIBDwoDAYNPAQEgAhlNYXR0aGV3IFBlcmV655qEUmVkbWkgSzUwIwAjAr+Q MediumType=64 DebugInfo=\{msg:hello,\ ifname:ap0,\ v4:192.\$\)+.\$\&\).46,\ v6:fe80::\&#\<+:\(\$@@:@\?\$\*:4903\}
```

这里 ip 是打了掩码的,不过最后 46 确实是我的手机 `192.\$\)+.\$\&\).46`

解开 `AppData` 的 base64 ,`echo xxx | base64 -d | xxd`,显示

```
00000000: 0241 013f 2e52 bee8 3b00 0201 0f0a 0301 .A.?.R..;.......
00000010: 834f 0101 2002 194d 6174 7468 6577 2050 .O.. ..Matthew P
00000020: 6572 657a e79a 8452 6564 6d69 204b 3530 erez...Redmi K50
00000030: 2300 2302 bf90 #.#...
```

可以看到确实是我的手机,估计前后缀除了定界符,还有一些小米自己的私有信息

用 `dns-sd -G v4v6 3F2E52BE.local.` 就可以查到具体 ip 了

```log
❯ dns-sd -G v4v6 3F2E52BE.local.
DATE: ---Mon 10 Mar 2025---
21:44:03.917 ...STARTING...
Timestamp A/R Flags IF Hostname Address TTL
21:44:06.260 Add 3 17 3F2E52BE.local. 192.168.136.46 120
```

然后 Google 了一下,在 eu 小米论坛找到了这个 [日志]( https://xiaomi.eu/community/attachments/log_fuxi_v816-0-23-12-4-dev-txt.50276/)

里面也有一行提到了

```log
12-12 03:16:46.265 10471 25415 W lyra-mdns-core: query _lyra-mdns._udp.local[0C] timeout!
```

---

我在想,能不能伪造这个东西,搞个 mDNS 诱骗器之类的,向 loopback 发这个 mDNS 广播,让小米互联、Xcode debug remote 之类的 app 发现这个设备,然后解析出具体 ip ,剩下的流程走单播,这样就能通了
2025 年 3 月 10 日
回复了 najunuoyan 创建的主题 Apple mac 连接小米手机大家试过吗
能不能强制单播直连,公司网络禁止了组播
2025 年 3 月 9 日
回复了 NianBroken 创建的主题 程序员 如何用最少的钱搭建 alist?
就是不要。优先考虑端对端,实在不行在中间搭一个端
2025 年 3 月 9 日
回复了 NakanoAzure 创建的主题 Visual Studio Code Vscode Mac 怎么定义点进某个函数回退啊
搞个按键宏? ctl+ NumPad- 和 ctl + shift + NumPad-
2025 年 3 月 8 日
回复了 edgebitllc 创建的主题 软件 求推荐可以记录一天中各个任务耗时的工具
2025-03-08 01:11:20 ,洗澡碎觉
1  2  3  4  5  6  7  8  9  10 ... 14  
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5324 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 41ms · UTC 07:59 · PVG 15:59 · LAX 00:59 · JFK 03:59
♥ Do have faith in what you're doing.