We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › New Library: Carnivore (packet sniffer) - beta
Page Index Toggle Pages: 1
New Library: Carnivore (packet sniffer) - beta (Read 6533 times)
New Library: Carnivore (packet sniffer) - beta
Sep 18th, 2005, 1:41am
 
greetings,

"Carnivore Library for Processing" is a packet sniffer library for the Processing programming language

http://rhizome.org/carnivore/processing.php

this is beta software. please let us know if you encounter any bugs and if you have suggestions for improvement. feedback from Linux/Windows users would be especially appreciated.

//RSG
Re: New Library: Carnivore (packet sniffer) - beta
Reply #1 - Sep 18th, 2005, 6:26pm
 
great news! and very timely - i came here to see if this existed yet, so just downloaded it, will post any feedback when i've had a chance to work with it
Re: New Library: Carnivore (packet sniffer) - beta
Reply #2 - Sep 19th, 2005, 6:40pm
 
so far so good, but there do appear to be a couple of bugs. I'm running p5 91, under Mac OSX.

(1) no time stamp is being generated - I'm more familiar with the CarnivorePE/Perl model which always reported this. is it an omission ?

(2) it's generating quite a few extraneous (?) packet events which have no IP / Port addresses. the lines generated always begin ' == E ' followed by further garbled characters.
Re: New Library: Carnivore (packet sniffer) - beta
Reply #3 - Sep 20th, 2005, 10:52pm
 
Re (1)--yes, we removed the timestamp from the carnivore output. this
was just to simplify it a little. just grab the system date
whenever a packet arrives. it will be within a few milliseconds of the
packet's timestamp. let us know if you need greater precision and we can
reinstate the old style.

Re (2)--can you post some sample output? it could be some sort of
non-TCP packet traffic being generated by your router and/or devices on
the LAN. did you try setting setShouldSkipUDP(true) in your setup()
method?

//RSG
Re: New Library: Carnivore (packet sniffer) - beta
Reply #4 - Sep 21st, 2005, 11:50am
 
re (1) -- that's fine - it's probably easier to timestamp using the system date than parse it from the output.

re (2) -- here's some output from the basic client you wrote, and yes, I had included setShouldSkipUDP(true) in the setup.

Code:

[PDE] packetEvent:  == E  4  @ @ s V      * d P )  (  &     B      G  > : o
[PDE] packetEvent:  == E  <  @ @ s V      * e P  go        F               G  >    
[PDE] packetEvent:  == E  4  @ 1 ,    *V    P d(  & )               :  G  >
[PDE] packetEvent:  == E  <  @ 1 ,    *V    P eT[    gp    p                :  G  >
[PDE] packetEvent:  == E  4  @ @ s V      * e P  gpT[              G  > :  [PDE] packetEvent:  == E     @ @ rtV      * e P  gpT[       Q      G  > :  GET /assets/img/Banner_magnet.gif?1127290483925 HTTP/1.1  Host: adserver.openmute.org  Connection: keep-alive  Referer: http://adserver.openmute.org/banner/  User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/312.5 (KHTML, like Gecko) Safari/312.3  Accept: */*  Accept-Encoding: gzip, deflate  Accept-Language: en-us


It's clear that some of this is valid packet data from the last line, but as you can see, it comes through with no IP/port info. I've been running several applications to see if this is occuring with any specific protocols, but I've not found any obvious connections.

Running the client under minivore shows very little activity even when I'm forcing network activity under various protocols both from the machine it's running on and others on the network, and again, it's seldom showing IP/port data.

running as hexivore shows more output, but again, very rarely shows IP data, and all lines commence '== 4500 ' (e followed by a null character - is this significant ? i seem to recall sockets using the null char as a terminator/delimiter)

Code:

[PDE] packetEvent:  == 4500 0030 aba2 4000 7006 15d1 5681 b8b3 5681 e39e 0570 01bd 1807 a0e7 0000 0000 7002 ffff 79b7 0000 0204 05ac 0101 0402
[PDE] packetEvent:  == 4500 0028 2a86 4000 4006 c6f5 5681 e39e 5681 b8b3 01bd 0570 0000 0000 1807 a0e8 5014 0000 a65f 0000
[PDE] packetEvent:  == 4500 0030 abc8 4000 7006 15ab 5681 b8b3 5681 e39e 0570 01bd 1807 a0e7 0000 0000 7002 ffff 79b7 0000 0204 05ac 0101 0402


I've tried going back a few versions of p5 but all produce the same results...



Re: New Library: Carnivore (packet sniffer) - beta
Reply #5 - Sep 26th, 2005, 6:08pm
 
ok should be fixed now in version 1.2.

(for those interested, this user has a ppp0 interface [point-to-point protocol] on his machine and there was a bug in carnivore which mistakenly allowed it to sniff some point-to-point data that was not TCP or UDP.)

+ + +

note that a new method to activate debugging information has been added to the carnivore library. you can turn it on in your setup() method like this (do it *before* you instantiate the Carnivore object for best effect):

void setup(){
 Log.setDebug(true);
 Carnivore carnivore = new Carnivore(this);
}
Re: New Library: Carnivore (packet sniffer) - beta
Reply #6 - Oct 8th, 2005, 6:06am
 
there is a new version 1.3 of the carnivore library at
http://rhizome.org/carnivore/

it now returns a "CarniPacket" object instead of a string. this is
better because it is no longer necessary in processing to parse the
packet string into from address, to address, from port, etc. you simply
access the CarniPacket class members directly (example:
packet.from_port).

please refer to the new API and see sample code here
http://rhizome.org/carnivore/processing.php

note that because of this change, the concept of "channels" is no longer
necessary and has been removed entirely from the carnivore processing
library. former "carnivore" channel users can simply access
packet.ascii, and "hexivore" users can access packet.data (it's in bytes
now, not text-formated hex).

let me know if it doesn't work for you. i have only tested it on mac osx
Tongue
Re: New Library: Carnivore (packet sniffer) - beta
Reply #7 - Oct 25th, 2005, 8:33am
 
hi, i tried it in xp. i downloaded winpcap and tried running the sample code and got this~

Code:

PacketCapture: loading native library jpcap.. ok

[Carnivore] opened device "\Device\NPF_{DA17D4A9-CBFC-411B-AC42-FF8BA4056CD6}" with filter "ip"

[CaptureThread] run

[Carnivore] can't open device "\Device\NPF_GenericDialupAdapter"
net.sourceforge.jpcap.capture.CaptureDeviceOpenException: Error opening adapter: The system cannot find the device specified. (20)

"\Device\NPF_GenericDialupAdapter" is either offline, or Carnivore can't access it. Sorry.


i probably did something wrong somewhere, but can't figure out what. thanks for the help.
Re: New Library: Carnivore (packet sniffer) - beta
Reply #8 - Oct 27th, 2005, 9:10pm
 
yes, this is a feature not a bug =)

you'll notice that carnivore is giving you *two* messages here. the first is that it successfully opened your ethernet device for sniffing (the device with name starting "\Device\NPF_{DA17D4A9..."). the second is that it did not open your second device for sniffing. since your second device is  a "GenericDialupAdapter" (i.e. your modem), you should just ignore this.

basically any PC with a modem will give this warning message. sorry if this is confusing. i could suppress the "GenericDialupAdapter" message if you want?

so i'm guessing that you can capture packets, correct? if not, then there's a different bug/problem you're facing.

//RSG
Re: New Library: Carnivore (packet sniffer) - beta
Reply #9 - Oct 29th, 2005, 4:09am
 
ah, i see how that message works. i think my real problem then is that nothing happens after it. for example, none of the stuff below gets printed -
Code:

void packetEvent(CarniPacket packet){
println("(" + packet.type + " packet)");
println(packet.from_address + ":" + packet.from_port + " > " + packet.to_address + ":" + packet.to_port);
println("Payload: " + packet.ascii + "\n");
}


it should be printing packet data, right? could this have anything to do with my wireless router?

thanks for your help (+ for the library)
Re: New Library: Carnivore (packet sniffer) - beta
Reply #10 - Nov 16th, 2005, 6:42am
 
fixed.

see new sample code at http://rhizome.org/carnivore/processing.php
Re: New Library: Carnivore (packet sniffer) - beta
Reply #11 - Dec 9th, 2005, 4:54am
 
Working with the 2.1 version of Carnivore and I really need a way to tell the NIC _NOT_ to go into promiscious mode. Reason being, some wireless NICs dont play nice with winpcap and they get thier monitor mode wrong. Hence when you put them into promisc mode they dont actually capture anything.

Yes I know when I'm not in promisc mode that I wont capture any traffic that is not broadcast/source/dest to my NIC, but in this application that is just fine.

I know I can go into jpcap and do it, but I thought a nice class call within Carnivore would be a much more elegant solution.

Thoughts?

Re: New Library: Carnivore (packet sniffer) - beta
Reply #12 - Dec 13th, 2005, 11:05pm
 
hi. i'm not sure if what you need is doable given the current design specs for carnivore. (perhaps i'm just not understanding your situation well enough.) sorry! //RSG
Re: New Library: Carnivore (packet sniffer) - beta
Reply #13 - Oct 7th, 2007, 12:23am
 
Anyone trying this out on Vista you might be getting an error message saying no interfaces were found. This is probably because Processing needs Administrator rights for accessing the interfaces.

Right clicking on processing.exe and selecting "Run as Administrator" fixed the problem for me Smiley

Just in case anyone happen to run across this ...
Page Index Toggle Pages: 1