What is IP spoofing?
IP spoofing is sending network packets with a forged source address, so they appear to come from somewhere they did not. It works because the internet delivers packets by their destination and, in many networks, never checks the source. Spoofing hides where an attack comes from and lets attackers aim replies at a victim, which is why it sits underneath many denial-of-service attacks.
Quick facts
- What is forged
- The source address in the IP header
- Why it works
- Routers forward by destination; many networks do not check sources
- Used for
- Reflection and amplification floods, SYN floods, hiding the origin of traffic
- What it cannot do easily
- Complete a TCP handshake, so it cannot carry an ordinary web request
This page is about network addresses. Email spoofing and caller ID spoofing are different problems, outside a web filtering layer.
How IP spoofing works
Every IP packet carries a source and a destination address. The sender writes both. Routers look at the destination to forward the packet and, unless the network was configured to, never ask whether the source address belongs to the sender.
A program with access to raw sockets can therefore write any source address it likes. The packet reaches its destination; any reply goes to the forged address, not back to the sender.
Internet protocol spoofing and ARP spoofing
The meaning of spoofing in computer security is forging an identifier so that traffic appears to come from somewhere it does not. Internet protocol spoofing forges the source address in the IP header.
ARP (RFC 826) translates an address in a protocol such as IP into a 48-bit Ethernet address. A host that receives an ARP packet from a sender already in its table updates the stored hardware address with what the packet says. An ARP spoofing attack uses this: a device on the same segment sends replies tying another host's IP address to its own hardware address. ARP requests are broadcast to every station on the cable, so the attacker must already be on that network.
Identity spoofing is the wider family
Identity spoofing means presenting as a user, device, host or sender you are not. IP spoofing forges a network address, ARP spoofing the link between an address and a hardware address, DNS spoofing the answer to a name lookup. Spoofing attacks differ in which identifier they forge.
IP spoofing, ARP spoofing and packet sniffing compared
Spoofing writes false information into traffic. Packet sniffing only reads it: RFC 4949 lists sniffing as slang for passive wiretapping and relates it to capturing and examining data packets.
| Aspect | IP spoofing | ARP spoofing | Packet sniffing |
|---|---|---|---|
| What it does | Forges the source address in the IP header | Ties another host's IP address to the attacker's hardware address | Captures and examines packets that pass by |
| Active or passive | Active: sends forged packets | Active: sends forged replies | Passive: reads traffic |
| Where the attacker must be | Any host that can send raw packets | On the same network segment | Where the traffic passes |
IP spoofing in DDoS attacks
- Reflection and amplification. The attacker sends small requests to open servers with the victim's address as the source (see amplification attacks); the servers send larger replies to the victim. NTP amplification and memcached work this way.
- SYN floods. Connection requests from forged sources fill the victim's table of half-open connections, and the replies go nowhere; see SYN flood.
- Hiding the source. Random source addresses make blocking by address useless and tracing slow.
RFC 4732 describes spoofing as one of the conditions that make denial of service on the internet hard to stop.
Why web requests are not spoofed
An HTTP request travels over a TCP connection, and opening one needs a three-way handshake: the server replies to the source address and waits for an answer. With a forged source, the reply goes elsewhere and the connection never opens.
So the address on a web request is real, even when it belongs to a hijacked device or a proxy. That is why rate limits and filtering at layer 7 can count by address, and also why address alone says little about intent; see IP reputation.
Can spoofed packets be detected?
Not reliably by the victim. A forged packet is well formed and its source field looks like any other. Some signs help: source addresses from ranges that are never routed on the public internet, a hop count that does not fit where the address supposedly is, and packets that never take part in a completed handshake.
Networks are in a better position. A provider knows which address ranges each customer link may use, so a packet arriving on the wrong link with someone else's source can be dropped on the spot. Researchers also watch for backscatter: replies sent by victims to the random addresses an attacker forged, which reveal floods happening elsewhere.
How networks prevent IP spoofing
The fix belongs to networks, not to victims: a network should drop packets leaving it with a source address that is not its own. This is ingress filtering, described in BCP 38 and extended for networks with several upstream links in BCP 84.
What “deny IP spoof” means in a log
A line such as “deny IP spoof” in a firewall or router log comes from the network device, not from a web filtering layer. The device dropped a packet because its source address failed a check of the kind BCP 84 lists: ingress access lists, or strict, feasible path and loose reverse path forwarding. Exact wording differs by vendor, so the device documentation says what a given line means. Bridge WAF works on completed requests at layer 7, so such lines are not in its activity log.
Every network that applies it removes itself as a launch point for spoofed floods. The victim cannot fix spoofing; it can only absorb the result upstream, as described on DDoS protection.
The attacks that rely on forged sources are described under DDoS attack; a honeypot is one place where unexpected sources, forged or not, show up in logs.
Questions
What is IP spoofing?
IP spoofing is sending network packets with a forged source address so they appear to come from another computer, used to hide the origin of traffic and to aim replies at a victim.
How is IP spoofing used in DDoS attacks?
Attackers send requests with the victim's address as the source to servers that reply with larger answers, or flood the victim with connection requests from random forged sources.
Can IP spoofing be used for web requests?
Not in practice. A web request needs a completed TCP handshake, and with a forged source the server's reply never reaches the attacker.
How is IP spoofing prevented?
By networks filtering outgoing packets whose source address is not theirs, as described in BCP 38 and BCP 84.
What is the difference between IP spoofing and packet sniffing?
IP spoofing forges the source address of the packets it sends. Packet sniffing captures and examines packets that pass by and forges nothing.
What does “deny IP spoof” mean in a firewall log?
A network device dropped a packet whose source address failed a spoofing check of the kind BCP 84 describes. Vendors word these lines differently, so check the device documentation.