跳到主要内容
uencoder

构建 and inspect network packets

Construct raw 网络 packets 为 testing, debugging, 和协议 development. Understand Ethernet, IP, 和 transport 层 encapsulation.

  1. 1

    网络 packet 是 built 通过 encapsulation: 应用数据 → transport 头 (TCP/UDP) → IP 头 → Ethernet 头. 每个层 adds 其头. Ethernet 头 (14 bytes) contains 目标 MAC, 源 MAC, 和 EtherType (0x0800 为 IPv4, 0x86DD 为 IPv6).

  2. 2
    十六进制编码器 →

    编码 the packet fields as hex. Build the Ethernet header (dst MAC + src MAC + EtherType), then IP header (version, IHL, TTL, protocol, IPs), then transport header (ports, seq, flags). Concatenate the layers to form the raw packet.

  3. 3
    二进制编码器 →

    编码 specific fields in binary for bit-level control. The IP flags (Reserved, DF, MF) are 3 bits. The TCP flags (FIN, SYN, RST, PSH, ACK, URG) are 6 bits. Binary encoding gives precise control over individual flags.

常见问题

什么是 encapsulation?
每个层 wraps 层以上它. 应用数据是 wrapped 在 TCP 段 (TCP 头 + 数据), 哪个是 wrapped 在 IP packet (IP 头 + TCP 段), 哪个是 wrapped 在 Ethernet 帧 (Ethernet 头 + IP packet + FCS). 每个层 是 independent.
为什么构建 raw packets?
为网络 testing (验证协议 implementations), 安全 research (craft 特定标志 combinations), debugging (reproduce issues 具有特定 packet patterns), 和学习 (理解 protocols 在字节级别). Tools like Scapy (Python) 和 hping3 是 used 为此.

解决此任务的工作流

相关工具