curl 'http://server/pcaps/1/list?by=date&limit=20'
will return the meta data for up to 20 pcaps.
Assuming you have a pcap with an id of 'cafebabe', you can pass in
this URL as the starting point for xtractr browsing, like so:
x = Mu::Xtractr.create 'http://localhost:9292/pcaps/1/pcap/cafebabe'
This will cause pcapr.Local to load the appropriate pcap into xtractr
and all xtractr queries will now get routed through properly. This is
also how you can run various xtractr queries across your entire
collection of pcaps, if you want to do some intra-pcap data mining.
Thanks,
The Pcapr Team
---
http://www.pcapr.net
http://twitter.com/pcapr
http://labs.mudynamics.com
> --
> To post to this group, send email to pcapr...@googlegroups.com
> To unsubscribe from this group, send email to
> pcapr-forum...@googlegroups.com
>
> http://www.pcapr.net/
:)
> Anyway, I've tried what you suggested and it works perfectly!
> During recent days I've been trying to figure out how to do it, by
> reading the source code of xtractr/pcapr gems , but you gave me the
> right way in just few lines, great.
>
> However, I'm little confused about the difference (if there is)
> between xtractr and pcapr-local.
> I mean,the gem pcapr-local include a new version of xtractr, or are
> two different things?
We originally wrote the xtractr ruby gem to go against a single
instance of xtractr (against a single pcap). pcapr.Local, while still
uses xtractr under the hood, is for managing large collections of
pcaps and adds the automatic indexing and three-way reconciliation.
What's missing in the xtractr gem is the pcapr.Local RESTful calls and
the newly introduced objects, which we haven't added yet.
Ideally the API would look like this:
pcapr = Pcapr::Local.new http://localhost:9292
pcapr.each_pcap(:by => :date, :limit => 20, :descending => true) do |pcap|
xtractr = pcap.xtractr # this will return an instance of Mu::Xtractr
...
end
This also means you can do inter-pcap analysis very easily, like this
example, where you can pull out all the PNG images from all pcaps that
contain HTTP flows.
pcapr = Pcapr::Local.new http://localhost:9292
pcapr.each_pcap(:by => :service, :key => 'http', :limit => 20) do |pcap|
xtractr = pcapr.xtractr
xtractr.flows('flow.service:http favicon.ico').each do |flow|
flow.contents.first.save(...)
end
end
> And the last question is: by scripting with these gems , everything
> is accomplished in my local network right? Considering the
> confidential nature of the pcaps that I daily analyze, I can't share
> *any* kind of data about those - that's why I was so happy to read
> about pcapr-local.
Absolutely! Nothing ever leaks out.
K.
I guess I wasn't being clear in the last email. We haven't yet
implemented the Pcapr object. The idea behind having pcapr.Local be
RESTful is so that such a thing would be possible. That said, we are
looking into it and will post a note when it's ready.
Thanks,
The Pcapr Team