Active Directory Domains
A comprehensive guide to Active Directory Domains, exploring their architecture, purpose, and common cybersecurity attack surfaces for both defenders and penetration testers.
Feb 17, 2026Windows
The Address Resolution Protocol (ARP), formalized in RFC 826 in 1982, is a foundational networking protocol that bridges the gap between logical IP addresses and physical MAC addresses on local networks. In an era of Ethernet dominance, ARP enables devices to discover each other's hardware addresses for direct communication, without which IP packets couldn't traverse local links. This article unpacks ARP's mechanics, provides code samples for hands-on understanding, and examines its vulnerabilities through a cybersecurity prism—highlighting how red teams weaponize it for man-in-the-middle (MitM) attacks and offering pro tips for blue teams to shore up defenses.
ARP operates at the data link layer, dynamically resolving protocol addresses (like 32-bit IPv4) to hardware addresses (like 48-bit Ethernet MACs). It assumes a broadcast-capable medium like Ethernet, where devices can query the entire network.
ARP's core job is translation: when a host S knows a target T's IP but not its MAC, it broadcasts an ARP request. If unresolved, the original packet is held until a reply arrives or times out. This avoids static tables for every possible peer, enabling scalable local networks.
The request/reply flow:
This bidirectional info exchange ensures efficient caching without periodic floods.
ARP packets are encapsulated in Ethernet frames (EtherType 0x0806). The 28-byte (minimum) ARP payload is:
| Field | Size (bits) | Description | Example (Ethernet/IPv4) |
|---|---|---|---|
| Hardware Type (hrd) | 16 | Address space (e.g., Ethernet=1) | 0x0001 |
| Protocol Type (pro) | 16 | Protocol being resolved (e.g., IPv4=0x0800) | 0x0800 |
| Hardware Length (hln) | 8 | Bytes in hardware address | 6 (for MAC) |
| Protocol Length (pln) | 8 | Bytes in protocol address | 4 (for IPv4) |
| Opcode (op) | 16 | 1=Request, 2=Reply | 1 or 2 |
| Sender Hardware Addr (sha) | hln bytes | Sender's MAC | e.g., 00:11:22:33:44:55 |
| Sender Protocol Addr (spa) | pln bytes | Sender's IP | e.g., 192.168.1.1 |
| Target Hardware Addr (tha) | hln bytes | Target's MAC (often 00s in request) | 00:00:00:00:00:00 |
| Target Protocol Addr (tpa) | pln bytes | Target's IP | e.g., 192.168.1.2 |
Generalized for other hardware/protocols via hrd/hln/pln.
Hosts maintain an ARP cache (table of <protocol addr, hardware addr> pairs). On reply, entries are added/updated; requests trigger broadcasts if missing. Aging is implementation-defined—e.g., timeouts or probes. Errors? Discarded packets prompt higher-layer retransmits; invalid hardware/protocol types are ignored. Reboots flush the cache for freshness.
Python example using Scapy (requires installation; root privileges for raw sockets) to send an ARP request:
from scapy.all import ARP, Ether, srp
# Broadcast ARP request for IP 192.168.1.1 on interface
packet = Ether(dst="ff:ff:ff:ff:ff:ff") / ARP(pdst="192.168.1.1")
answered, _ = srp(packet, timeout=2, iface="eth0", verbose=0)
for sent, received in answered:
print(f"IP {received.psrc} maps to MAC {received.hwsrc}")This queries the network and prints resolved MACs.
ARP's broadcast nature and lack of authentication make it ripe for spoofing—attackers poison caches by sending fake replies, positioning themselves as MitM. No signatures or verification in RFC 826 leaves it vulnerable in flat LANs. Modern red teams use this for eavesdropping, session hijacking, or DoS.
Step-by-step attack:
Common techniques: Automate with ML for multi-target hits; chain with DDoS by flooding replies; target IoT for espionage.
Python POC with Scapy for poisoning (lab only; ethical use required):
from scapy.all import ARP, send
# Spoof: Tell victim (192.168.1.100) that attacker (our MAC) is gateway (192.168.1.1)
spoofed = ARP(op=2, psrc="192.168.1.1", pdst="192.168.1.100", hwdst="ff:ff:ff:ff:ff:ff")
send(spoofed, loop=1, inter=1, verbose=0) # Continuous gratuitous repliesTools like Ettercap or Bettercap automate this.
ARP's flaws demand layered defenses: encrypt traffic, segment networks, and monitor anomalies. Focus on prevention and detection.
arp -s 192.168.1.1 00:11:22:33:44:55); immune to poisoning but unscalable.Pro Tip: Script periodic ARP table diffs (arp -a output) and alert on changes; integrate with SIEM for correlation. Train on spotting unencrypted LAN risks.
| Threat | ARP Weakness | Blue Team Counter | Tool/Example |
|---|---|---|---|
| Spoofing/Poisoning | No auth; gratuitous replies | Static Entries/DAI | arp -s; Cisco ip arp inspection |
| Cache Flood (DoS) | Unlimited updates | Rate Limiting | Switch ACLs on ARP traffic |
| Recon (Gratuitous ARP) | Broadcast queries | Monitoring | ARPwatch alerts |
| MitM Interception | Cache trust | Encryption | Enforce TLS 1.3 |
ARP's simplicity powered early internetworks, but its unsecured design lingers as a vector for local attacks in unsegmented environments. Red teams exploit it for stealthy pivots; blue teams counter with vigilance and hardening. For labs, simulate with tools like Wireshark. Reference RFC 9297 (2023 ARP update) for nuances, but the 1982 core endures. Network wisely—resolve addresses, but verify trust.
Stay linked, stay secure.
Love it? Share this article: