Introduction to IP Spoofing

IP Spoofing: An Introduction
by Matthew Tanase
last updated March 11, 2003

Criminals
have long employed the tactic of masking their true identity, from
disguises to aliases to caller-id blocking. It should come as no
surprise then, that criminals who conduct their nefarious activities on
networks and computers should employ such techniques. IP spoofing is one
of the most common forms of on-line camouflage. In IP spoofing, an
attacker gains unauthorized access to a computer or a network by making
it appear that a malicious message has come from a trusted machine by
“spoofing” the IP address of that machine. In this article, we will
examine the concepts of IP spoofing: why it is possible, how it works,
what it is used for and how to defend against it.

History

The
concept of IP spoofing, was initially discussed in academic circles in
the 1980's. While known about for sometime, it was primarily theoretical
until Robert Morris, whose son wrote the first Internet Worm, discovered a security weakness in the TCP protocol known as sequence prediction. Stephen Bellovin discussed the problem in-depth in Security Problems in the TCP/IP Protocol Suite, a paper that addressed design problems with the TCP/IP protocol suite. Another infamous attack, Kevin Mitnick's Christmas Day
crack of Tsutomu Shimomura's machine, employed the IP spoofing and TCP
sequence prediction techniques. While the popularity of such cracks has
decreased due to the demise of the services they exploited, spoofing can
still be used and needs to be addressed by all security administrators.

Technical Discussion

To
completely understand how these attacks can take place, one must
examine the structure of the TCP/IP protocol suite. A basic
understanding of these headers and network exchanges is crucial to the
process.

Internet Protocol – IP

Internet protocol (IP)
is a network protocol operating at layer 3 (network) of the OSI model.
It is a connectionless model, meaning there is no information regarding
transaction state, which is used to route packets on a network.
Additionally, there is no method in place to ensure that a packet is
properly delivered to the destination.

Examining
the IP header, we can see that the first 12 bytes (or the top 3 rows of
the header) contain various information about the packet. The next 8
bytes (the next 2 rows), however, contains the source and destination IP
addresses. Using one of several tools, an attacker can easily modify
these addresses – specifically the “source address” field. It's
important to note that each datagram is sent independent of all others
due to the stateless nature of IP. Keep this fact in mind as we examine
TCP in the next section.

Transmission Control Protocol – TCP

IP can be thought of as a routing wrapper for layer 4 (transport), which contains the Transmission Control Protocol (TCP).
Unlike IP, TCP uses a connection-oriented design. This means that the
participants in a TCP session must first build a connection - via the
3-way handshake (SYN-SYN/ACK-ACK) - then update one another on progress -
via sequences and acknowledgements. This “conversation”, ensures data
reliability, since the sender receives an OK from the recipient after
each packet exchange.

As
you can see above, a TCP header is very different from an IP header. We
are concerned with the first 12 bytes of the TCP packet, which contain
port and sequencing information. Much like an IP datagram, TCP packets
can be manipulated using software. The source and destination ports
normally depend on the network application in use (for example, HTTP via
port 80). What's important for our understanding of spoofing are the
sequence and acknowledgement numbers. The data contained in these fields
ensures packet delivery by determining whether or not a packet needs to
be resent. The sequence number is the number of the first byte in the
current packet, which is relevant to the data stream. The
acknowledgement number, in turn, contains the value of the next expected
sequence number in the stream. This relationship confirms, on both
ends, that the proper packets were received. It’s quite different than
IP, since transaction state is closely monitored.

Consequences of the TCP/IP Design

Now
that we have an overview of the TCP/IP formats, let's examine the
consequences. Obviously, it's very easy to mask a source address by
manipulating an IP header. This technique is used for obvious reasons
and is employed in several of the attacks discussed below. Another
consequence, specific to TCP, is sequence number prediction, which can
lead to session hijacking
or host impersonating. This method builds on IP spoofing, since a
session, albeit a false one, is built. We will examine the ramifications
of this in the attacks discussed below.

Spoofing Attacks

There
are a few variations on the types of attacks that successfully employ
IP spoofing. Although some are relatively dated, others are very
pertinent to current security concerns.

Non-Blind Spoofing

This type of attack takes place when the attacker is on the same subnet
as the victim. The sequence and acknowledgement numbers can be sniffed,
eliminating the potential difficulty of calculating them accurately.
The biggest threat of spoofing in this instance would be session
hijacking. This is accomplished by corrupting the datastream of an
established connection, then re-establishing it based on correct
sequence and acknowledgement numbers with the attack machine. Using this
technique, an attacker could effectively bypass any authentication
measures taken place to build the connection.

Blind Spoofing

This
is a more sophisticated attack, because the sequence and
acknowledgement numbers are unreachable. In order to circumvent this,
several packets are sent to the target machine in order to sample
sequence numbers. While not the case today, machines in the past used
basic techniques for generating sequence numbers. It was relatively easy
to discover the exact formula by studying packets and TCP sessions.
Today, most OSs implement random sequence number generation, making it
difficult to predict them accurately. If, however, the sequence number
was compromised, data could be sent to the target. Several years ago,
many machines used host-based authentication services (i.e. Rlogin). A
properly crafted attack could add the requisite data to a system (i.e. a
new user account), blindly, enabling full access for the attacker who
was impersonating a trusted host.

Man In the Middle Attack

Both types of spoofing are forms of a common security violation known as a man in the middle (MITM) attack.
In these attacks, a malicious party intercepts a legitimate
communication between two friendly parties. The malicious host then
controls the flow of communication and can eliminate or alter the
information sent by one of the original participants without the
knowledge of either the original sender or the recipient. In this way,
an attacker can fool a victim into disclosing confidential information
by “spoofing” the identity of the original sender, who is presumably
trusted by the recipient.

Denial of Service Attack

IP
spoofing is almost always used in what is currently one of the most
difficult attacks to defend against – denial of service attacks, or DoS.
Since crackers are concerned only with consuming bandwidth and
resources, they need not worry about properly completing handshakes and
transactions. Rather, they wish to flood the victim with as many packets
as possible in a short amount of time. In order to prolong the
effectiveness of the attack, they spoof source IP addresses to make
tracing and stopping the DoS as difficult as possible. When multiple
compromised hosts are participating in the attack, all sending spoofed
traffic, it is very challenging to quickly block traffic.

Misconceptions of IP Spoofing

While
some of the attacks described above are a bit outdated, such as session
hijacking for host-based authentication services, IP spoofing is still
prevalent in network scanning and probes, as well as denial of service
floods. However, the technique does not allow for anonymous Internet
access, which is a common misconception for those unfamiliar with the
practice. Any sort of spoofing beyond simple floods is relatively
advanced and used in very specific instances such as evasion and
connection hijacking.

Defending Against Spoofing

There are a few precautions that can be taken to limit IP spoofing risks on your network, such as:

Filtering at the Router - Implementing ingress and egress filtering
on your border routers is a great place to start your spoofing defense.
You will need to implement an ACL (access control list) that blocks
private IP addresses on your downstream interface. Additionally, this
interface should not accept addresses with your internal range as the
source, as this is a common spoofing technique used to circumvent
firewalls. On the upstream interface, you should restrict source
addresses outside of your valid range, which will prevent someone on
your network from sending spoofed traffic to the Internet.

Encryption and Authentication - Implementing encryption and authentication will also reduce spoofing threats. Both of these features are included in Ipv6,
which will eliminate current spoofing threats. Additionally, you should
eliminate all host-based authentication measures, which are sometimes
common for machines on the same subnet. Ensure that the proper
authentication measures are in place and carried out over a secure
(encrypted) channel.

Conclusion

IP
Spoofing is a problem without an easy solution, since it’s inherent to
the design of the TCP/IP suite. Understanding how and why spoofing
attacks are used, combined with a few simple prevention methods, can
help protect your network from these malicious cloaking and cracking
techniques.

Matt Tanase is President of Qaddisin. He and his company provide nationwide security consulting services. Additionally, he produces The Security Blog, a daily weblog dedicated to network security.

Relevant Links
Session Hijacking Demonstration and Notes
Dave Dittrich
Closing the Floodgates: DDoS Mitigation Techniques
Matt Tanase, SecurityFocus

作者:蒋金楠
微信公众账号:大内老A
微博:www.weibo.com/artech
如果你想及时得到个人撰写文章以及著作的消息推送,或者想看看个人推荐的技术资料,可以扫描左边二维码(或者长按识别二维码)关注个人公众号(原来公众帐号蒋金楠的自媒体将会停用)。
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

原文链接

时间: 2024-09-12 13:28:30

Introduction to IP Spoofing的相关文章

LoadRunner 技巧之 IP欺骗 (推荐)

IP欺骗也是也loadrunner自带的一个非常有用的功能. 需要使用ip欺骗的原因: 1.当某个IP的访问过于频繁,或者访问量过大是,服务器会拒绝访问请求,这时候通过IP欺骗可以增加访问频率和访问量,以达到压力测试的效果. 2.某些服务器配置了负载均衡,使用同一个IP不能测出系统的实际性能.LR中的IP欺骗通过调用不同的IP,可很大程度上的模拟实际使用中多IP访问和并测试服务器均衡处理的能力. 3.有一些网站会限制同一个用户同一个IP 的登陆.为了更加真实的模拟实际情况,LoadRunner允

SSH协议详解(转)

转发的http://blog.csdn.net/macrossdzh/article/details/5691924 很透彻啊,学习了 一.什么是SSH   SSH是英文Secure Shell的简写形式.通过使用SSH,你可以把所有传输的数据进行加密,这样"中间人"这种攻击方式就不可能实现了,而且也能够防止DNS欺骗和IP欺骗.使用SSH,还有一个额外的好处就是传输的数据是经过压缩的,所以可以加快传输的速度.SSH有很多功能,它既可以代替Telnet,又可以为FTP.Pop.甚至为P

上云,你需要了解的正确姿势

看了乌云君的漏洞报告,"假如你娶了云存储,这些姿势以后就别用了",有些震惊.企业要安全上云,还需提高自身的安全修养呀,否则可能都不知道是怎么死的.报告里提到的几个上云的"受害者",我猜都是"豪".在Code里硬编码AccessKey,也就算了:还把Code放在公开的Github上,也算是醉了.这无异于,把取款密码写在银行卡上,然后再把银行卡扔在大街上. 认识AccessKey(简称AK)   企业上云时,云平台会为企业提供一个仓库,企业在云上的资

全面解析:黑客常规攻击方式之DDoS攻击

本文讲的是 :  全面解析:黑客常规攻击方式之DDoS攻击  , 谈及DDoS攻击已非陌生话题,最早的DDoS攻击可以追溯到1996年,而中国的DDoS攻击自2002年开始频繁出现,到2003年已 经初具规模.尽管是个老生常谈的网络攻击方式,近几年却以新的攻击方式,给企业/用户带来巨大的网络安全威胁,并且已从TCP/IP层上升到了应用层. 何为DDoS攻击? DDoS(分 布式拒绝服务),英文全称Distributed Denial of Service,一种基于DoS的特殊形式的拒绝服务攻击,

《Linux防火墙(第4版)》——2.4 过滤传入的数据包

2.4 过滤传入的数据包 外部网卡I/O对中的输入端.输入规则集,对于保护您的站点而言,是更值得注意的.就像前面提到的那样,您能够基于源地址.目的地址.源端口.目的端口.TCP状态标志以及其他标准进行过滤. 您将在后面的章节中了解到所有这些信息. 2.4.1 远程源地址过滤 在数据包层面,唯一确定IP数据包发送者的方式便是数据包报头的源地址.这个事实为源地址欺骗(source address spoofing)提供了可能,发送者将一个并非他/她真实地址的错误地址放在报文的相应源地址域里.该地址可

五招让你的Ubuntu 16.04更安全

本文讲的是五招让你的Ubuntu 16.04更安全, 如果想让Ubuntu服务器的安全性能上升一个层次的话,请仔细阅读下面的5招.  Ubuntu 16.04的安装相对简单,安装之后,你将享受Linux带来的安全性.实际上为了提高数据的安全性,你还可以做的更多,下面的5招将给你带来不错的安全收益. 1.确保共享内存的安全 黑客攻击总会想查看共享内存,所以保证共享内存的安全的重要性不言而喻.可以修改 /etc/fstab文件来确保共享内存的安全. 首先,使用终端命令打开文件 sudo nano /

《CCNP安全Secure 642-637认证考试指南》——8.2节路由式数据面攻击类型

8.2 路由式数据面攻击类型CCNP安全Secure 642-637认证考试指南基础知识点 8.2 路由式数据面攻击类型在网络安全中,知己知彼非常重要.只有深入了解攻击的原理,才能降低攻击造成的危害.路由式基础设施是网络的重要组成部分,因此也极易遭到攻击.接下来,我们将讨论3种最常见的路由式数据面攻击,它们是: IP欺骗(IP spoofing):慢通道拒绝服务(slow-path denial of service):流量泛洪(traffic flooding). 8.2.1 IP欺骗前面的章

LoadRunner 12 发布—主推云测试平台

Loadrunner12推出Community版本,支持50个免费用户 LoadRunner仿照6年前就已经出现的SOASTA.Neotys.Blazemeter等竞争对手,推出云性能测试平台,有兴趣的朋友可以看看<Thoughts about LoadRunner 12 Release>这篇文章. 新特性 1.Cloud-based load generators 2.Licensing - 50 vUsers free 3.VUGEN improvements The ability to

Red Hat Linux 安全设置方法_Linux

Windows Server 2003 系统配置方案 网络安全是指网络系统的硬件.软件及其系统中的数据受到保护,不受偶然的或者恶意的原因而遭到破坏.更改.泄露,系统连续可靠正常地运行,网络服务不中断. 网络安全从其本质上来讲就是网络上的信息安全.从广义来说,凡是涉及到网络上信息的保密性.完整性.可用性.真实性和可控性的相关技术和理论都是网络安全的研究领域. 1,最小化安全系统,删除不必要的软件,关闭不必要的服务. # ntsysv以下仅列出需要启动的服务,未列出的服务一律推荐关闭,必要运行的服务