Skip to main content

Posts

Showing posts with the label Java

Java Code to Get MAC Address From Target IP Address

MAC Address is a Unique identification of a Device. Computer, Mobile, Tablet, PC all have a Unique MAC Address. If you want to know about MAC Address here is some, MAC on Wiki . MAC Address is generally 48 bits long eg, 00:ff:a3:f0:76:ae Here we are going to discuss about How to get that address by using supplied IP Address over the network. Here is the Java Code GetMACAddress.java import java.net.Inet4Address; import java.net.InetAddress; import java.util.Arrays; import jpcap.*; import jpcap.packet.*; public class GetMACAddress{     public static byte[] arp(InetAddress ip) throws java.io.IOException{         //find network interface         NetworkInterface[] devices=JpcapCaptor.getDeviceList();         NetworkInterface device=null; loop:    for(NetworkInterface d:devices){             for(NetworkInterfaceAddress addr:...