magic-wormhole (神奇虫洞)是一个文件传输协议,它能让你通过交换一小段数字和英文单词组成的密码,在互联网或本地网络上安全地传输文本、文件或文件夹。
优点 #
- 免费,无文件容量限制,无限速/传输速度≈网速——暴打百度网盘
- 生成的密码人类可读(“数字-单词1-单词2”)——暴打需要手打或复制粘贴又臭又长的网页链接的在线文件传输服务
- 跨平台——暴打 AirDrop
- 接收方主动输入密码才能下载文件,不用担心被骚扰——暴打 AirDrop
- 支持发送文本信息——暴打 AirDrop
- 不限于局限网,表现稳定——暴打 Snapdrop、LocalSend
GUI #
magic-wormhole 原本是一个命令行工具,现在也有了图形用户界面(GUI)客户端。
magic-wormhole 是用 python 写的,Rymdport 和 wormhole-william-mobile 客户端在用 Go/Golang 实现的 wormhole-william 的基础上开发的,但在使用上没有差别,不管是 python 还是 Go 写的 wormhole 客户端之间都能通信。
wormhole 的客户端列表 cf. Rymdport— Wiki — Supported clients
名称 | 支持平台 |
---|---|
Rymdport | Windows/macOS/Linux |
Warp | Windows/Linux |
Destiny | Android/iOS/Windows/macOS/Linux |
Wormhole (Android) | Android |
Mobile Wormhole (Android) | Android |
wormhole-william-mobile | Android (iOS 开发中) |
Winden | Web |
Rymdport(原名 wormhole-gui)支持三大主流桌面操作系统 Windows/macOS/Linux 外加 FreeBSD。 Rymdport 可以在 GitHub releases 中获取。(Rymdport 的开发者没有缴99刀/年的苹果税,二进制文件没有用官方证书签名导致在 ARM Mac 上会报错,使用 M 系列芯片的 Mac 用户注意看 README 里的操作方法)
Destiny 是真正意义上的全平台客户端,也是目前唯一支持 iOS 的客户端。不过 Destiny 和 Winden 默认使用的服务器与其他客户端不同,用户需要手动修改才能和其他客户端建立通信。见 Switch to wormhole servers from Least Authority more easily #125 (rymdport/issues/125)。
wormhole-william-mobile 暂时只支持 Android,iOS 版也在开发中但上线时间未定。wormhole-william-mobile 已上架 Google Play Store,可以从官方或其第三方商店中获取;也可以在 GitHub releases 中找到 apk 文件手动下载安装。
Wormhole (Android) 已上架 Google Play Store (Play Store 版的名字是 Wormhole File Transfer)和 IzzyOndroid。 UI 比 wormhole-william-mobile 略新,支持二维码,但不支持发送文本信息。
CLI #
虽说是命令行工具,但用法真的很简单。
详细教程请阅读 官方文档。
magic-wormhole 可以用对应桌面系统的包管理软件下载,比如 Ubuntu/Debian 的 apt、Mac 的 Homebrew ……,也可以用 python 的 pip。
安装 #
比如:
sudo apt install magic-wormhole
brew install magic-wormhole
传输文件/文件夹 #
日常使用只需要掌握 wormhole send xxx
和 wormhole receive xxx
两条就够了(xxx是文件或文件夹路径,输完 wormhole send 加空格后只需要把文件夹拖拽进终端窗口就可以了)。
官方示例:
Sender:
% wormhole send README.md
Sending 7924 byte file named 'README.md'
On the other computer, please run: wormhole receive
Wormhole code is: 7-crossover-clockwork
Sending (<-10.0.1.43:58988)..
100%|=========================| 7.92K/7.92K [00:00<00:00, 6.02MB/s]
File sent.. waiting for confirmation
Confirmation received. Transfer complete.
Receiver:
% wormhole receive
Enter receive wormhole code: 7-crossover-clockwork
Receiving file (7924 bytes) into: README.md
ok? (y/n): y
Receiving (->tcp:10.0.1.43:58986)..
100%|===========================| 7.92K/7.92K [00:00<00:00, 120KB/s]
Received file written to README.md
传输文本信息 #
wormhole send --text xxx
如果直接输入文本会在 .bash_history 的日志里留下明文记录,可以使用 --text -
或 --text=-
,之后你可以在 stdin 中输入需要发送的文本信息然后按 Control+D 发送。
reference: Issue #140: Information Leakage Vulnerability: wormhole –text leaks text into shell history logs