Python Forum

Full Version: Get User Mac Address ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm using the uuid module to try to capture the source mac address ( cleinte ). Using the code below locally I can get the source mac address (local device), but when I remotely run the destination mac address is captured, (I believe it is from the remote device)? I know that the place where the mac addresses are processed (from source to destination), in the TCP/IP protocol stack, is in the Data Link layer. But how do I be able to get the Source Mac Address ?

import uuid, re
print (':'.join(re.findall('..', '%012x' % uuid.getnode())))
Did you solve this already?

I'm not sure I understood what you are trying to do. Do you want to run a script remotely to get a local mac adress? If this is the case, how are you estabilishing this connection? Via Sockets?
(Nov-16-2022, 01:42 PM)carecavoador Wrote: [ -> ]Did you solve this already?

I'm not sure I understood what you are trying to do. Do you want to run a script remotely to get a local mac adress? If this is the case, how are you estabilishing this connection? Via Sockets?

Yes, I'm giving a study to see how I solve it.
from uuid import getnode
macaddr = getnode()
print(macaddr)
Thank you for your question! Unfortunately, I'm not sure what you are asking. Could you please provide more information about the issue you are having?