Skip to main content
Both the paqet client and server require detailed network configuration to craft and inject raw TCP packets. This guide explains how to gather the necessary information for your platform.

Required Network Information

You need to collect three pieces of information:
  1. Network Interface Name - The name of your network adapter
  2. Local IP Address - Your machine’s IP address on the local network
  3. Gateway MAC Address - The MAC address of your router/gateway

Finding Network Interface Name

Use the ip a command to list all network interfaces:
ip a
Example output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
    inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0
3: wlan0: <BROADCAST,MULTICAST> mtu 1500
Common interface names:
  • eth0, eth1 - Ethernet interfaces
  • ens3, ens5 - Predictable network interface names
  • wlan0, wlan1 - Wireless interfaces
In the example above, the active interface is eth0.

Finding Local IP Address

Your local IP address is shown alongside your network interface:
ip a show eth0
Look for the line starting with inet:
inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0
Your IP address is 192.168.1.100.

Finding Gateway IP Address

The gateway is your router’s IP address on the local network:
ip r | grep default
Example output:
default via 192.168.1.1 dev eth0 proto dhcp metric 100
Your gateway IP is 192.168.1.1.

Finding Gateway MAC Address

The gateway MAC address is required for crafting raw Ethernet frames:
Use the arp command with your gateway IP:
arp -n 192.168.1.1
Example output:
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.1              ether   a0:b1:c2:d3:e4:f5   C                     eth0
Your gateway MAC address is a0:b1:c2:d3:e4:f5.
If the MAC address shows as (incomplete), ping the gateway first:
ping -c 1 192.168.1.1
arp -n 192.168.1.1

TCP Flag Cycling

paqet allows you to customize the TCP flags used in crafted packets to vary traffic patterns and potentially evade detection.

What are TCP Flags?

TCP flags are control bits in TCP headers that indicate the purpose or state of a packet:
  • S (SYN) - Synchronize, initiates a connection
  • A (ACK) - Acknowledgment of received data
  • P (PSH) - Push, tells receiver to process data immediately
  • F (FIN) - Finish, closes a connection
  • R (RST) - Reset, aborts a connection
  • U (URG) - Urgent data pointer is valid

Flag Configuration

You can configure TCP flags in your config file:
network:
  tcp:
    local_flag: ["PA"]   # Flags for outgoing packets
    remote_flag: ["PA"]  # Flags for incoming packets (client only)

Common Flag Patterns

  • ["PA"] - Push + Acknowledgment (standard data transfer, default)
  • ["S"] - SYN flag (mimics connection setup)
  • ["A"] - ACK flag (acknowledgment only)
  • ["SA"] - SYN + ACK (mimics connection response)

Flag Cycling

When you provide multiple flag patterns in an array, paqet cycles through them:
network:
  tcp:
    local_flag: ["PA", "A", "S"]
This configuration cycles through:
  1. First packet: Push + Acknowledgment
  2. Second packet: Acknowledgment
  3. Third packet: SYN
  4. Fourth packet: Push + Acknowledgment (cycle repeats)
This variability can help evade simple pattern-based detection systems.
Unusual flag combinations may be detected or blocked by sophisticated firewalls. The default ["PA"] pattern mimics normal TCP data transfer and is recommended for most use cases.

Configuration Example

Here’s a complete network configuration example:
network:
  interface: "eth0"                     # Your interface name
  ipv4:
    addr: "192.168.1.100:0"             # Your local IP (client uses :0)
    router_mac: "a0:b1:c2:d3:e4:f5"     # Your gateway MAC
  tcp:
    local_flag: ["PA"]                  # TCP flags for outgoing packets
    remote_flag: ["PA"]                 # TCP flags for incoming packets
For clients, always use port 0 in network.ipv4.addr for automatic port assignment. For servers, use the same port as in listen.addr.

Next Steps

Build docs developers (and LLMs) love