I just try some script from fukusima
http://www.goto.info.waseda.ac.jp/~fukusima/ruby/pcap/examples/
When I try to run the script it give a warning
/usr/lib/ruby/site_ruby/1.8/i686-linux/pcap.so: warning: do not use
Fixnums as Symbols
/usr/lib/ruby/site_ruby/1.8/i686-linux/pcap.so: warning: do not use
Fixnums as Symbols
/usr/lib/ruby/site_ruby/1.8/i686-linux/pcap.so: warning: do not use
Fixnums as Symbols
Is there any mistake or library that I didn’t include ?
I also try this code :
#!/usr/bin/env ruby
this line imports the libpcap ruby bindings
require ‘pcaplet’
create a sniffer that grabs the first 1500 bytes of each packet
$network = Pcaplet.new(‘-s 1500’)
create a filter that uses our query string and the sniffer we just
made
$filter = Pcap::Filter.new(‘tcp and dst port 80’, $network.capture)
add the new filter to the sniffer
$network.add_filter($filter)
iterate over every packet that goes through the sniffer
for p in $network
print packet data for each packet that matches the filter
puts p.tcp_data if $filter =~ p
end
and suppose it appear some output after run it, nothing appear
anyone have some solutions ?
thanks in advance