packetfu 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/examples/arphood.rb CHANGED
@@ -2,21 +2,24 @@
2
2
 
3
3
  # A simple local network fingerprinter. Uses the OUI list.
4
4
 
5
+ require 'examples'
6
+ require 'packetfu'
7
+ require 'open-uri'
8
+
5
9
  $oui_prefixes = {}
6
10
  $arp_results = []
7
11
  def build_oui_list
8
12
  if ARGV[0].nil?
9
- require 'open-uri'
10
13
  puts "Fetching the oui.txt from IEEE, it'll be a second. Avoid this with #{$0} <filename>."
11
14
  oui_file = open("http://standards.ieee.org/regauth/oui/oui.txt")
12
15
  else
13
- oui_file = File.open(ARGV[0])
16
+ oui_file = File.open(ARGV[0], "rb")
14
17
  end
15
18
  oui_file.each do |oui_line|
16
19
  maybe_oui = oui_line.scan(/^[0-9a-f]{2}\-[0-9a-f]{2}\-[0-9a-f]{2}/i)[0]
17
20
  unless maybe_oui.nil?
18
21
  oui_value = maybe_oui
19
- oui_vendor = oui_line.split(/\(hex\)\s*/)[1] || "PRIVATE"
22
+ oui_vendor = oui_line.split(/\(hex\)\s*/n)[1] || "PRIVATE"
20
23
  $oui_prefixes[oui_value] = oui_vendor.chomp
21
24
  end
22
25
  end
@@ -27,24 +30,24 @@ build_oui_list
27
30
  $root_ok = true if Process.euid.zero?
28
31
 
29
32
  def arp_everyone
30
- require 'packetfu'
31
33
  my_net = PacketFu::Config.new(PacketFu::Utils.whoami?(:iface => 'wlan0'))
32
34
  threads = []
33
- network = "192.168.1"
34
- puts "Arping around..."
35
+ network = "192.168.2"
36
+ print "Arping around..."
35
37
  253.times do |i|
36
38
  threads[i] = Thread.new do
37
39
  this_host = network + ".#{i+1}"
40
+ print "."
38
41
  colon_mac = PacketFu::Utils.arp(this_host,my_net.config)
39
42
  unless colon_mac.nil?
40
43
  hyphen_mac = colon_mac.tr(':','-').upcase[0,8]
41
44
  else
42
45
  hyphen_mac = colon_mac = "NOTHERE"
43
46
  end
44
- $arp_results << "%s : %s / %s" % [this_host,colon_mac,$oui_prefixes[hyphen_mac]]
47
+ $arp_results << "%s : %s / %s" % [this_host,colon_mac,$oui_prefixes[hyphen_mac]]
45
48
  end
46
- threads.join
47
49
  end
50
+ threads.join
48
51
  end
49
52
 
50
53
  if $root_ok
@@ -345,7 +345,7 @@ module PacketFu
345
345
  end
346
346
  end
347
347
  table
348
- if @headers.last.members.include? :body
348
+ if @headers.last.members.map {|x| x.to_sym }.include? :body
349
349
  body_part = [:body, self.payload, @headers.last.body.class.name]
350
350
  end
351
351
  table << body_part
@@ -1,7 +1,7 @@
1
1
  module PacketFu
2
2
 
3
3
  # Check the repo's for version release histories
4
- VERSION = "1.1.0"
4
+ VERSION = "1.1.1" # Fixes for 1.8
5
5
 
6
6
  # Returns PacketFu::VERSION
7
7
  def self.version
data/test/icmp_test.pcap CHANGED
Binary file
data/test/ip_test.pcap CHANGED
Binary file
data/test/tcp_test.pcap CHANGED
Binary file
data/test/udp_test.pcap CHANGED
Binary file
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: packetfu
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.0
5
+ version: 1.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tod Beardsley
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-06-11 00:00:00 -05:00
13
+ date: 2011-06-16 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency