Files
metasploit-gs/external/ruby-lorcon2/test.rb
T
HD Moore 7b22b2cc04 Mostly working codebase, still hanging on some instances, depends on latest svn of lorcon2. See #427
git-svn-id: file:///home/svn/framework3/trunk@7292 4d416f70-5f16-0410-b530-b9f4589650da
2009-10-27 20:13:20 +00:00

51 lines
876 B
Ruby
Executable File

#!/usr/bin/env ruby
$:.unshift(File.dirname(__FILE__))
require "Lorcon2"
require "pp"
=begin
$stdout.puts "Checking LORCON version"
pp Lorcon.version
$stdout.puts "\nFetching LORCON driver list"
pp Lorcon.drivers
$stdout.puts "\nResolving driver by name 'mac80211'"
pp Lorcon.find_driver("mac80211")
$stdout.puts "\nAuto-detecting driver for interface wlan0"
pp Lorcon.auto_driver("mon0")
=end
#tx = Lorcon::Device.new('kismet0', 'tuntap')
tx = Lorcon::Device.new('wlan2')
$stdout.puts "\nCreated LORCON context"
if tx.openinjmon()
$stdout.puts "\nOpened as INJMON: " + tx.capiface
else
$stdout.puts "\nFAILED to open " + tx.capiface + " as INJMON: " + tx.error
end
@pkts = 0
Thread.new do
while(true)
select(nil, nil, nil, 5)
puts "count: #{@pkts}"
end
end
# tx.filter = "port 80"
tx.each_packet { |pkt|
if(pkt.dot3)
p pkt.dot3
end
@pkts += 1
}