By using some Python codes in Ubunto terminal with nmap or arp-scan I got result of all devices mac addresses which are connected with my router .. and i store that results in one text file1 which contain only mac address like that :
C4:E9:A4:30:98:22
5C:8A:F2:9B:0C:CD
E8:A9:60:4C:56:D1
C8:0A:3F:85:MD:D6
I have also already another text file2
which contain all mac addresses in the building.
i need help in script that i can compare between file1 and file2 then record which mac address in file1 and its from list in file2 are connected with my router - then save it in third file3 .
may this will not be clear for some people .so. i work with system that will take attendance in company by using phone mac address for employees .. hope this will help to understand my point .. and please help i am beginner :) thank you
EDIT
I already did this:
for i in range(2):
os.system("ping -c5 -b 192.168.0.255") os.system("nmap -sP 192.168.0.1/24 >rec.txt")
os.system("grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' rec.txt >mac.txt")