<img src=“https://travis-ci.org/pcaprub/pcaprub.png” alt=“Build Status” /> <img src=“https://ci.appveyor.com/api/projects/status/7g3x62y9rgy3twds?svg=true” alt=“Windows Builds” /> <img src=“https://codeclimate.com/github/pcaprub/pcaprub.png” /> <img src=“https://badge.fury.io/rb/pcaprub.png” alt=“Gem Version” /> <img src=“https://gemnasium.com/pcaprub/pcaprub.svg” alt=“Dependency Status” />
This goal of this project is to provide a consistent interface to LBL’s libpcap packet capture library.
This does not provide packet processing functionality, it simply provides the interface for capturing packets, and passing yielding those packets.
For packet processing capability look at ruby gems PCAPFU, PCAPLET, etc..
MRI POSIX Ruby (Native compilation)
Ruby 1.8.7 (EOL June 2014) Ruby 1.9.3 or higher Ruby 2.x or higher libpcap - http://www.tcpdump.org
MRI Windows Ruby (Native compilation)
Ruby 1.8.7 (EOL June 2014) Ruby 1.9.3 or higher Ruby 2.x or higher WinPcap Developer's Pack - http://www.winpcap.org
gem install pcaprub
Advanced options in a Windows ENV
gem install pcaprub --no-ri --no-rdoc -- --with-pcap-dir="c:/dev/src/WpdPack"
require 'rubygems' require 'pcaprub' cap = PCAPRUB::Pcap.new
The Git Repo on Github @pcaprub is forked from the Metasploit SVN repo
git clone git://github.com/pcaprub/pcaprub.git
The gem is now a module. The module is autoincluded, but this helps with name collisions and additional growth.
Some of the Error handling and basic intensive code is moving out the C base-extension (ext) and into native Ruby.
The file handling in dumper is now attached to the Capture Class and not the Module as an additional singleton.
capture = PCAPRUB::Pcap.open_live('eth0', SNAPLENGTH, true, 0) capture.dump_open('./Example.pcap') { ... } capture.dump_close
Timestamps are now available when yeilding packets instead of strings
capture = PCAPRUB::Pcap.open_live('eth0', SNAPLENGTH, true, 0) capture.each_packet do |packet| puts Time.at(packet.time) puts "micro => #{packet.microsec}" end
On Ruby 1.8 with winpcap, rb_thread_polling pauses for 100 milliseconds between reads. This may mean some packets are missed.
GNU Lesser General Public License v2.1 (LGPL-2.1)
See LICENCE for details
Copyright © 2010 - 2014
All original code maintains its copyright from its original authors and licensing.
On March 2014 this project was migrated to github.com/pcaprub/pcaprub from github.com/shadowbq/pcaprub
The Git Repo on Github @pcaprub is a forked merge from the Metasploit SVN repo
git clone git://github.com/shadowbq/pcaprub.git (moved)
The Metasploit Project also provides a Subversion repository: (0.9-dev)
svn checkout http://metasploit.com/svn/framework3/trunk/external/pcaprub/
Packetfu Project also provides a listing (0.9-dev)
http://code.google.com/p/packetfu/source/browse/#svn/trunk/pcaprub_linux
The Marshall Beddoe’s Outdate RubyForge svn version can be obtained from Subversion: (0.7-dev)
svn checkout http://pcaprub.rubyforge.org/svn/trunk/ http download Public Rubyforge (0.6) https://github.com/unmarshal/pcaprub
SourceForge Masaki Fukushima 2000 (0.6) – Object Creation Heavy Implementation (PCAPLET integrated)
http://sourceforge.net/apps/trac/rubypcap/
Additonal Github Repos
https://github.com/dxoigmn/pcaprub (0.8-dev) https://github.com/spox /pcaprub-spox (0.8-dev+)