nyu-mlab / iot-inspector-client

IoT Inspector: capturing and analyzing your smart home network traffic
https://inspector.engineering.nyu.edu/
MIT License
417 stars 64 forks source link

ARP Spoofing opcode 1 vs. opcode 2 #121

Closed william1357chen closed 1 year ago

william1357chen commented 2 years ago

There is a discovered issue with using spoofed ARP requests in IoT Inspector. Here is the detailed issue.

When using spoofed ARP requests (op=1), tests by @crazyideas21 have shown that there are clear packet losses compared to using spoofed ARP replies (op=2). We suspect that the spoofed ARP caches for the spoofed devices are modified back to the original unspoofed state, and why this happens is still to be investigated.

Here is why theoretically speaking, there should not be a difference between using ARP requests (op=1) vs. ARP replies (op=2). RFC 826 details the process of packet reception. image

Two main points to pull from the figure above:

Therefore, according to the protocol, there is no difference between spoofed ARP requests (op=1) and ARP replies (op=2).

Here is the reason why we chose to use spoofed ARP requests:

Speculations on why in practice there is a difference between ARP requests vs. ARP replies:

crazyideas21 commented 2 years ago

Will address in the next release of Inspector. In particular, will use opcode = 2 by default, but if user complains disrupted Internet, will switch to opcode = 1.

Relevant: https://github.com/nyu-mlab/iot-inspector-client/pull/118 @viz-prakash