ViRb3 / nMAC

📱 An Android device MAC changer
Other
56 stars 13 forks source link

Help in finding MAC address? #2

Closed rmenessec closed 6 years ago

rmenessec commented 8 years ago

I'd like to see the Nexus 6 supported, but I can't find a file containing the MAC address in sysfs, except in the '80211' driver. The file's read-only, so it's not possible to change the MAC address with it.

Is there any specific method you'd recommend to find the MAC address?

ViRb3 commented 8 years ago

Is your actual MAC address hardcoded in the driver? I would carefully look at all /system and persistent partitions, I highly doubt the driver being the only thing to hold your MAC.

ViRb3 commented 7 years ago

@rmenessec Sorry for bringing up this old issue, but could you please tell me the exact path to the 80211 driver and how you found it? I'm working on something more generic and this would be great help.

rmenessec commented 7 years ago

@ViRb3 Are you looking for a sysfs path, or for a path to the actual driver binary (kmod)?

ViRb3 commented 6 years ago

Both, if possible. Couldn't we byte patch the driver to replace the MAC?

rmenessec commented 6 years ago

Both, if possible. Couldn't we byte patch the driver to replace the MAC?

Uh... No. In almost all cases, either the MAC address is programmed into a network adapter part before it ships, or else the MAC address is programmed into a motherboard / mainboard (if the network controller is integrated) before it ships.

Drivers don't contain MAC addresses. I think you're confusing the sysfs file space with actual files. Linux sysfs is a completely virtual file system that represents the internal state of the Linux kernel. It doesn't correspond to a file or file system or storage device. It's just a convenient way of presenting values stored in kernel working memory.

Either way: no, patching kernel modules is generally not a good idea; not unless you're referring to patching the kernel source code and recompiling from source. On Android--on most modern Linux distributions--there are generally one or more mechanisms protecting the kernel from arbitrary modification like you're talking about. At minimum, you'll probably have to bypass kernel driver signing. On platforms like Samsung KNOX, generally you have to find some way to disable KNOX, assuming that that's possible.

Since we're going 4-12 months between posts here, I'm frankly not interested in the project any more. I'm unsubscribing from notifications.

ViRb3 commented 6 years ago

I feared it would be this way, thanks for the insights! I've been thinking about patching the Android (Java) layer which is responsible for reading and delivering the MAC address, something that a couple of XPosed modules used to do. The only issue would be doing this without XPosed. Maybe Magisk can be used to replace the file, which I assume will be core.jar. Anyway, I'll be closing this now given you have lost interest. Sorry for the delay in my responses, I've been quite busy with things outside programming.