2024年5月

https://tthtlc.wordpress.com/2022/03/19/how-to-unpack-firmware-asus-router-for-example/
写的已经挺明白的了。

首先确保有binwalk,ubireader等,并且确保是最新版本。
First, ensure binwalk, ubireader are all the latest version, and using virtualenv to setup the python environment:

下载地址如下:

https://github.com/ReFirmLabs/binwalk
https://github.com/jrspruitt/ubi_reader
https://github.com/sviehb/jefferson
https://github.com/devttys0/sasquatch

1,直接用binwalk,尝试是否能直接提取。
比如binwalk -Me FW_EA7500v2_2.0.8.194281_prod.img
2,有的是用ubi格式的,则需要配合ubireader。
比如这个版本:FW_EA7500_1.1.5.190349_prod.img
binwalk是直接解不出来的。需要binwalk -e FW_EA7500_1.1.5.190349_prod.img,
有提示“UBI erase count header,”字样,则需要换个方式:

ubireader_extract_images FW_EA7500_1.1.5.190349_prod.img
cd ubifs-root/  #cd到解压缩出来的ubifs文件目录
cd FW_EA7500_1.1.5.190349_prod.img/
unsquashfs img-1568388057_vol-squashfs.ubifs  #这里就可以解出来了。

有些加密了的,这里就先不研究了。 。

https://www.3cx.com/pbx/what-is-a-stun-server/

A STUN (Session Traversal of User Datagram Protocol [UDP] Through Network Address Translators [NATs]) server allows NAT clients (i.e. IP Phones behind a firewall) to set up phone calls to a VoIP provider hosted outside of the local network.

STUN Server Diagram
The STUN server allows clients to find out their public address, the type of NAT they are behind and the Internet side port associated by the NAT with a particular local port. This information is used to set up UDP communication between the client and the VoIP provider to establish a call. The STUN protocol is defined in RFC 3489.

The STUN server is contacted on UDP port 3478, however, the server will hint clients to perform tests on alternate IP and port number too (STUN servers have two IP addresses). The RFC states that this port and IP are arbitrary.

Stun functionality is seamlessly handled by 3CX - an easy to install PBX.

中文解释:
https://mp.weixin.qq.com/s/cQgli4y-sLNg918MKW8D0g

说人话就是:
白嫖公开的STUN服务器,用它的UDP端口,走流量,打洞。

内网机器往 stun4.l.google.com(142.251.2.127) 发送了一个 STUN Binding 的包,这是通过 UDP 传输的,所以这个请求会在运营商里面打开一个临时的 UDP 通道。

内网机器就是通过这个 临时的 UDP 通道 跟 STUN 服务器通信。所以这个 UDP 通道的信息,STUN 服务器是知道的。因此 STUN 服务器可以把这个 UDP 通道信息 放在 STUN Response 里面返回给 内网的机器。

https://blog.xioxix.com/archives/277