Switch capture mixin from scruby to packetfu

git-svn-id: file:///home/svn/framework3/trunk@5729 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-10-10 02:27:25 +00:00
parent 929ba19cc7
commit 6df3d7f54a
1 changed files with 6 additions and 39 deletions

View File

@ -27,6 +27,8 @@ module Exploit::Capture
)
require 'packetfu'
begin
require 'pcaprub'
@pcaprub_loaded = true
@ -94,21 +96,6 @@ module Exploit::Capture
self.capture = nil
end
# Extend this to support a wider range of link layer types
def capture_find_linklayer(pkt)
return if not pkt
raw = pkt.raw_data
off = 0
case pkt.datalink
when 119
off = 144
else
end
raw[off, raw.length - off]
end
def capture_extract_ies(raw)
set = {}
ret = 0
@ -128,30 +115,10 @@ module Exploit::Capture
def each_packet
return if not self.capture
# print_status("Link type is #{capture.datalink}")
capture.each do |packet|
dec = Scruby.linklayer_dissector(capture.datalink, packet)
if(dec)
break if not yield(true, dec)
else
break if not yield(false, packet)
self.capture.each do |pkt|
yield(PacketFu::Packet.parse(pkt))
end
end
end
def find_layers(pkt, cls)
res = []
pkt.layers_list.each do |layer|
if layer.class == cls
res << layer
end
end
res
end
attr_accessor :capture