MSDN: Limitations on Raw Sockets

On Windows 7, Windows Vista, Windows XP with Service Pack 2 (SP2), and Windows XP with Service Pack 3 (SP3), the ability to send traffic over raw sockets has been restricted in several ways:
    TCP data cannot be sent over raw sockets.
    UDP datagrams with an invalid source address cannot be sent over raw sockets. The IP source address for any outgoing UDP datagram must exist on a network interface or the datagram is dropped. This change was made to limit the ability of malicious code to create distributed denial-of-service attacks and limits the ability to send spoofed packets (TCP/IP packets with a forged source IP address).
    A call to the bind function with a raw socket for the IPPROTO_TCP protocol is not allowed.
    Note  The bind function with a raw socket is allowed for other protocols (IPPROTO_IP, IPPROTO_UDP, or IPPROTO_SCTP, for example).

These above restrictions do not apply to Windows Server 2008 R2, Windows Server 2008 , Windows Server 2003, or to versions of the operating system earlier than Windows XP with SP2.

对原始套接字的限制

在Windows 7中,Windows Vista中,Windows XP的Service Pack 2(SP2)和Windows XP的Service Pack 3(SP3),发送流量通过原始套接字的能力受到限制在几个方面:
    TCP数据无法发送原始套接字。
    UDP数据报无效的源地址不能发送原始套接字。任何传出UDP数据报的IP源地址必须存在于网络接口或数据包将被丢弃。这一变化是为了限制恶意代码来创建拒绝服务的分布式攻击的能力,并限制了(用伪造源IP地址,TCP / IP数据包)发送欺骗数据包的能力。
    调用同一个原始套接字为IPPROTO_TCP协议绑定功能是不允许的。

    注意到原始套接字绑定函数是允许其它协议(IPPROTO_IP,IPPROTO_UDP或IPPROTO_SCTP,例如)。

上述这些限制并不适用于Windows Server 2008 R2,Windows Server 2008中,在Windows Server 2003,或者操作系统早于Windows XP SP2的版本。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值