Skip to content

cracked-machine/write_tun

Repository files navigation

Use the build.sh and run.sh scripts.

Outline

  1. Network namespace created (ns1)
  2. TUN device created inside the namespace (tun0 with IP 10.0.0.1/24)
  3. veth pair created (veth0 in root, veth1 in ns1)
  4. C++ application runs inside the namespace and creates a TUN device
  5. ICMP packet written to the TUN device successfully
  6. tcpdump captures the packet on the TUN interface

Packet details:

  • Source: 10.0.0.1 (TUN device)
  • Destination: 10.0.0.3 (veth1 endpoint)
  • Type: ICMP echo request
  • ID: 4660 (matches your C++ code: 0x1234)
  • Sequence: 1
  • Length: 60 bytes total (20 IP + 8 ICMP + 32 payload)

About

C++ program to write packets into tun device

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages