Method: Rex::Socket.ipv6_mac

Defined in:
lib/rex/socket.rb

.ipv6_mac(intf) ⇒ Object

Identifies the mac address of a given interface (if IPv6 is enabled)



617
618
619
620
621
622
# File 'lib/rex/socket.rb', line 617

def self.ipv6_mac(intf)
  r = ipv6_link_address(intf)
  return if not r
  raw = addr_aton(r)[-8, 8]
  (raw[0,3] + raw[5,3]).unpack("C*").map{|c| "%.2x" % c}.join(":")
end