简体   繁体   English

ARP回复数据包不会更新Ubuntu上的ARP缓存

[英]ARP reply packet does not update ARP cache on Ubuntu

So after I have played with the Network Spoofer developed by Digitalsquid (http://digitalsquid.co.uk/netspoof/), I have been trying to get a better understanding of its internal working by writing ac program that does something similar. 因此,在我使用Digitalsquid(http://digitalsquid.co.uk/netspoof/)开发的Network Spoofer之后,我一直试图通过编写类似的类似的ac程序来更好地理解其内部工作。

My program currently takes in 4 parameters - source ip, source mac, victim ip, and victim mac - and send an ARP reply packet with them. 我的程序目前有4个参数 - source ip,source mac,victim ip和victim mac - 并发送一个ARP回复包。 When testing the program on my home network, I would do something like setting the source ip to be the router's ip, source mac to be something bogus, victim ip to be my laptop's ip, and victim mac to be my laptop's wireless card mac. 在我的家庭网络上测试程序的时候,我会做一些事情,比如设置源IP是路由器的ip,源mac是虚假的东西,受害者ip是我的笔记本电脑的ip,受害者mac是我的笔记本电脑的无线卡mac。

The problem is, although I can see the packet being sent/received from monitoring the wireless card using tcpdump (ie. I would see something like "01:43:23.656745 ARP, Ethernet (len 6), IPv4 (len 4), Reply rouer-ip is-at bogus-mac-address , length 28", which is just what I expected), the ARP cache entry for the router stays the same (ie. still has the correct mac address). 问题是,虽然我可以看到使用tcpdump监控无线网卡发送/接收的数据包(即我会看到类似“01:43:23.656745 ARP,以太网(len 6),IPv4(len 4)”,回复rouer-ip is-at bogus-mac-address ,长度为28“,这正是我的预期),路由器的ARP缓存条目保持不变(即仍然具有正确的mac地址)。

I am not quite sure what the problem here is, and why I couldn't poison my ARP cache. 我不太清楚这里的问题是什么,为什么我不能毒害我的ARP缓存。 I read somewhere that it could be my OS, Ubuntu 12.04, dropping the unsolicited ARP packets, so I tried to set /proc/sys/net/ipv4/conf/wlan0/arp_accept to 1 - no luck. 我在某处读到它可能是我的操作系统,Ubuntu 12.04,丢弃未经请求的ARP数据包,所以我试图将/ proc / sys / net / ipv4 / conf / wlan0 / arp_accept设置为1 - 没有运气。 I also tried to turn IP forwarding on (setting /proc/sys/net/ipv4/ip_forward to 1) as suggested by another article, and still had no luck. 我还试图打开IP转发(将/ proc / sys / net / ipv4 / ip_forward设置为1),如另一篇文章所示,但仍然没有运气。

I would really appreciate if somebody can give me some pointers/hints as to what the problem might be. 如果有人可以给我一些关于问题可能是什么的指示/提示,我将非常感激。 Also, please correct me if I had a mistake in my understanding - I am quite new in the realm of c programming and ARP spoofing. 另外,如果我理解错误,请纠正我 - 我在c编程和ARP欺骗领域都是新手。

Thanks! 谢谢!

JY JY

Its good to take these arguments(source ip,source mac,target ip and target mac),but you are not giving correct values to it. 采用这些参数(源ip,源mac,目标ip和目标mac)很好,但你没有给它正确的值。

suppose A=the victim 假设A =受害者

and B=Gateway/Router/Switch in your network 和B =网络中的网关/路由器/交换机

ARP spoofing is actually convincing both A and B ARP欺骗实际上说服了A和B.

You need to be more active in sending ARP request/reply to both A and B by giving your MAC address to be desired node. 通过将MAC地址作为所需节点,您需要更加积极地向A和B发送ARP请求/回复。

So that whatever A/B sends will come to you first. 因此无论A / B发送什么,都会先找到你。 IP and MAC address fields are basically updated in CAT(content Addressable Memory) table of switch which keeps on updating time to time. IP和MAC地址字段基本上在交换机的CAT(内容可寻址存储器)表中更新,该表不断更新。

So when you are sending ARP Reuest to A(ie Router/Gateway/Switch):- 所以当您向A(即路由器/网关/交换机)发送ARP Reuest时: -

 Source IP=Victim's IP i.e A
 Source MAc=your MAC(hackers MAC) so that data may come to your system
 Destination IP=Rouer's IP
 Detination MAC will be blank in case of ARP request

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM