diff --git a/lib/packetfu/packetfu/utils.rb b/lib/packetfu/packetfu/utils.rb index b1e3d93fea..c1b83b7210 100644 --- a/lib/packetfu/packetfu/utils.rb +++ b/lib/packetfu/packetfu/utils.rb @@ -132,7 +132,7 @@ module PacketFu # method that returns an array rather than just the first candidate. end - # Handles ifconfig for various (okay, two) platforms. + # Handles ifconfig for various (okay, one) platforms. Mac guys, fix this and submit a patch! # Will have Windows done shortly. # # Takes an argument (either string or symbol) of the interface to look up, and @@ -182,32 +182,8 @@ module PacketFu ret[:ip6_saddr] = $1 ret[:ip6_obj] = IPAddr.new($1) end - end # linux - when /darwin/i - ifconfig_data = %x[ifconfig #{iface}] - if ifconfig_data =~ /#{iface}/i - ifconfig_data = ifconfig_data.split(/[\s]*\n[\s]*/) - else - raise ArgumentError, "Cannot ifconfig #{iface}" end - real_iface = ifconfig_data.first - ret[:iface] = real_iface.split(':')[0] - ifconfig_data.each do |s| - case s - when /ether[\s]([0-9a-fA-F:]{17})/i - ret[:eth_saddr] = $1 - ret[:eth_src] = EthHeader.mac2str(ret[:eth_saddr]) - when /inet[\s]*([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)(.*Mask:([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+))?/i - ret[:ip_saddr] = $1 - ret[:ip_src] = [IPAddr.new($1).to_i].pack("N") - ret[:ip4_obj] = IPAddr.new($1) - ret[:ip4_obj] = ret[:ip4_obj].mask($3) if $3 - when /inet6[\s]*([0-9a-fA-F:\x2f]+)/ - ret[:ip6_saddr] = $1 - ret[:ip6_obj] = IPAddr.new($1) - end - end # darwin - end # RUBY_PLATFORM + end # linux ret end diff --git a/lib/packetfu/packetfu/version.rb b/lib/packetfu/packetfu/version.rb index 8d2e08d76c..89bae4ece6 100644 --- a/lib/packetfu/packetfu/version.rb +++ b/lib/packetfu/packetfu/version.rb @@ -1,7 +1,7 @@ module PacketFu # Check the repo's for version release histories - VERSION = "1.1.5" # Unscrewing the 1.1.4 gem + VERSION = "1.1.3" # Unscrewing the 1.1.2 gem # Returns PacketFu::VERSION def self.version