Python Forum
Get User Mac Address ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get User Mac Address ?
#1
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())))
Reply
#2
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?
Reply
#3
(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.
Reply
#4
from uuid import getnode
macaddr = getnode()
print(macaddr)
Reply
#5
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?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020