[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ARP requests

ninny

5/15/2007 10:22:00 AM

Hello,

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.

If someone want help me, I would be very happy

--
Posted via http://www.ruby-....

4 Answers

Robert Klemme

5/15/2007 10:59:00 AM

0

On 15.05.2007 12:21, ninny 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.

I am not sure where your problems are but if you want to detect an IP
address you can take this regexp for a start:

/\d{1,3}(?:\.\d{1,3}){3}/

Note that it does not match IPv6 addresses which might or might not be
an issue. Note also, that it might match strings that are not IP addresses.

Kind regards

robert

Rick DeNatale

5/15/2007 2:48:00 PM

0

On 5/15/07, Abhijit Gadgil <gabhijit@gmail.com> wrote:

> 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 how to do this from Ruby, but you can put the network adapter
into promiscuous mode. This causes the adapter to pass all traffic
into the OS, not just traffic addressed to the machine. This is how
tools like ethereal do this.

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...

Rick DeNatale

5/15/2007 2:59:00 PM

0

BTW,

a google search on ruby packet sniffer came up with this:
http://arstechnica.com/articles/columns/linux/linux-20...

which in turn led to this:
http://www.goto.info.waseda.ac.jp/~fukusima/ruby/pcap/doc/...

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...

Eivind Eklund

5/15/2007 3:05:00 PM

0

On 5/15/07, Rick DeNatale <rick.denatale@gmail.com> wrote:
> into promiscuous mode. This causes the adapter to pass all traffic
> into the OS, not just traffic addressed to the machine. This is how
> tools like ethereal do this.

pcap will put the interface into promiscuous mode.

The problem is that switches will not forward the traffic.

Unfortunately, I don't know any real solution to the problem.

Eivind.