packetfu 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/arphood.rb +11 -8
- data/lib/packetfu/packet.rb +1 -1
- data/lib/packetfu/version.rb +1 -1
- data/test/icmp_test.pcap +0 -0
- data/test/ip_test.pcap +0 -0
- data/test/tcp_test.pcap +0 -0
- data/test/udp_test.pcap +0 -0
- metadata +2 -2
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.
|
34
|
-
|
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
|
-
|
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
|
data/lib/packetfu/packet.rb
CHANGED
data/lib/packetfu/version.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2011-06-16 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|