On 5/15/07, ninny [email protected] wrote:
I have a project to do in ruby witch consist in recover the ARP requests
(who-has) on my local network and take the IP address if nobody answer
to the ARP requests.
I know identify an ARP request with “pcap” but I don’t know how to take
the IP address.
Not really sure about how you’d do this in ruby, but I have a
suggestion, if you are trying to monitor ARP requests on the network
and also ARP replies I am afraid, you’d not see most (infact all
except your own) of the ARP replies (standards compliant ARP replies
are not sent to broadcast MAC address) and you might end up thinking
nobody replied. Not sure whether this really is a very good idea.
Coming back to ARP ( Here is how the frame is like)
EtherType : 0x0806
ARP Data: First 8 byte headers
Next : 6 byte (Sender MAC address - Assuming Ethernet)
Next : 4 byte (Sender IP Address)
Next : 6 byte (Destination MAC)
Next : 4 byte Destination IP…
So in short you’ve to match 4 bytes at offset 24, to find the Address
that doesn’t get replied. Don’t know how this is done with pcap in
If someone want help me, I would be very happy
Posted via http://www.ruby-forum.com/.
[ written in http://www.paahijen.com/scratchpad ]
[ http://www.paahijen.com ]