
all power.what u guys think is this handy.
Code: Select all
import java.io.*;
import java.net.*;
import java.util.*;
import static java.lang.System.out;
public class JavaTest{
public static void main(String[] argv) throws Exception {
String str2 = "00:13:E8:D6:EC:83";
Process p = Runtime.getRuntime().exec("sudo arp-scan 192.168.1.2-192.168.1.20");
p.waitFor();
BufferedReader buf = new BufferedReader(new InputStreamReader(
p.getInputStream()));
String line = "";
String output = "";
while ((line = buf.readLine()) != null) {
output += line + "\n";
}
System.out.println(output);
if(output.toLowerCase().contains(str2.toLowerCase()))
{
System.out.println("laptop mac found!");
}
}
}
Code: Select all
sudo chmod u+s /usr/bin/arp-scan