Created
November 5, 2016 21:09
-
-
Save picatz/3e848c367f05350c7cfb169320c25ca9 to your computer and use it in GitHub Desktop.
Example use case to use packetfu to get basic iface information.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'packetfu' | |
# iface becomes the default routeable interface | |
iface = PacketFu::Utils.default_int | |
# config will determine the ifconfig data for iface | |
config = PacketFu::Utils.ifconfig(iface) | |
# print out some of the relevant information | |
puts " iface: " + config[:iface] | |
puts "mac address: " + config[:eth_saddr] | |
puts " local ip: " + config[:ip_saddr] | |
# => example output ... | |
# iface: en0 | |
# mac address: t0:0s:1l:ly:4y:0u | |
# local ip: 10.0.0.10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment