发送IP时的ARP在每个数据包中都是错误的

时间:2015-02-08 18:09:50

标签: ip packet arp

我在今天的操作系统考试中遇到过一个问题。 鉴于一个过程"伪造"每个发送的数据包中的IP地址(给出错误的IP地址),ARP是否正常工作?

我认为它没有,因为数据包不知道在哪里返回" ack"。

很想听听你的意见。

2 个答案:

答案 0 :(得分:2)

  

我认为它没有,因为数据包不知道在哪里返回" ack"。

返回发件人的MAC地址,而不是IP地址。

来自RFC 826

  

当收到地址解析数据包时,接收以太网   模块将数据包提供给地址解析模块   通过类似于以下的算法。负面条件   表示处理结束和丢弃数据包。

?Do I have the hardware type in ar$hrd?
Yes: (almost definitely)
  [optionally check the hardware length ar$hln]
  ?Do I speak the protocol in ar$pro?
  Yes:
    [optionally check the protocol length ar$pln]
    Merge_flag := false
    If the pair <protocol type, sender protocol address> is
        already in my translation table, update the sender
    hardware address field of the entry with the new
    information in the packet and set Merge_flag to true. 
    ?Am I the target protocol address?
    Yes:
      If Merge_flag is false, add the triplet <protocol type,
          sender protocol address, sender hardware address> to
      the translation table.
      ?Is the opcode ares_op$REQUEST?  (NOW look at the opcode!!)
      Yes:
    Swap hardware and protocol fields, putting the local
        hardware and protocol addresses in the sender fields.
    Set the ar$op field to ares_op$REPLY
    Send the packet to the (new) target hardware address on
        the same hardware on which the request was received.

这意味着什么?

使用MAC返回

ARP,尽管IP地址也可以包含在数据包的发送方协议地址(SPA)字段中。这意味着虽然发件人IP地址(SPA)是欺骗性的,但在您的问题中没有提到发件人硬件地址(SHA)被欺骗。

这意味着发件人接收ARP回复并且ARP将起作用(从发送机器的角度来看)。但是,由于ARP数据包包含欺骗性SPA,目标计算机(以及可能是网络上的其他设备)会将发送方关联为具有该IP地址,从而实现ARP poisoning攻击成功:

  

e.g。 Linux忽略了未经请求的回复,但另一方面则使用来自其他计算机的请求来更新其缓存。

答案 1 :(得分:0)

我认为它会知道将ack返回到哪里,因为发件人发送了他的MAC地址,这才是最重要的。但我认为它不会起作用,因为接收方将根据他从发送方获得的MAC和IP来改变他的ARP表。 (这是一个微不足道的优化)。

相关问题