Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track mac addresses, if possible #3

Open
nhoening opened this issue Jul 8, 2019 · 2 comments
Open

Track mac addresses, if possible #3

nhoening opened this issue Jul 8, 2019 · 2 comments

Comments

@nhoening
Copy link
Collaborator

nhoening commented Jul 8, 2019

This would be better, as IP addresses can refer to differetn computers over time.

For this, the aileen-lan calling code needs to be on the same local are network and we need to use sudo.

@nhoening
Copy link
Collaborator Author

nhoening commented Jul 8, 2019

https://serverfault.com/questions/148113/can-i-use-nmap-to-discover-ips-and-mac-addresses

Hints and also a nice command using awk. Apparently, root privileges are needed so that nmap gets the mac address:

sudo nmap -sP 172.31.201.0/24 | awk '/Nmap scan report for/{printf $5;}/MAC Address:/{print " => "$3;}' 

I tested it locally and it works. But only with sudo, so that is the technical bottleneck.

Nice that it also stores the hostname, which we can put in the observations dictionary (where now we store source: "nmap").

This would also make parsing the nmap result easier, as we let awk do this.

@nhoening
Copy link
Collaborator Author

Issue #2 (using python-nmap) would not make the sudo issue go away, see here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant