we will learn few concepts related to MAC addresses — those unique identifiers that play a imp. role in hacking & networking. Have u ever wondered how to find your machine’s MAC address? We’ll guide you through it, breaking it down with manual methods and throwing in some code for good measure. But that’s just the beginning! We’ll also introduce you to 6 powerhouse resources over MAC addresses. We’ll also cover MAC spoofing — yes, that’s a thing! Methods for Linux &Windows, and we’ll even decode the MAC address alphabet soup, exploring the size ranges, Unique Organization Identifier (OUI), and the more details about manufacturers and their company addresses. So, lets start..
import re
import platform
import subprocess
def get_mac_addresses():
if platform.system().lower() == 'windows':
result = subprocess.run(['ipconfig', '/all'], capture_output=True, text=True)
mac_addresses = re.findall(r'Physical Address[\. ]+: ([\dA-Fa-f\-:]+)', result.stdout)
elif platform.system().lower() == 'linux':
result = subprocess.run(['ifconfig'], capture_output=True, text=True)
mac_addresses = re.findall(r'ether ([\dA-Fa-f\-:]+)', result.stdout)
else:
mac_addresses = []
return mac_addresses
print(get_mac_addresses())
Now that we’ve laid the groundwork, let’s move on to explore further.
https://www.macvendorlookup.com/
https://www.networkcenter.info/inform/mac
https://2ip.ua/ru/services/information-service/mac-find
http://samy.pl/mapxss/
https://wigle.net/
https://uni-tools.net/services/mac-location
https://www.kali.org/tools/macchanger/
https://technitium.com/tmac/
example: 01:23:45:67:89:ab
How To Find Your MAC Address?
Before we start into the details of MAC address exploration, let’s start with the basics. You can easily display your MAC address on Windows using the command “ipconfig” or on Linux with “ifconfig.” Alternatively, you can use the following Python code snippet to display a list of all available MAC addresses on your machine:import re
import platform
import subprocess
def get_mac_addresses():
if platform.system().lower() == 'windows':
result = subprocess.run(['ipconfig', '/all'], capture_output=True, text=True)
mac_addresses = re.findall(r'Physical Address[\. ]+: ([\dA-Fa-f\-:]+)', result.stdout)
elif platform.system().lower() == 'linux':
result = subprocess.run(['ifconfig'], capture_output=True, text=True)
mac_addresses = re.findall(r'ether ([\dA-Fa-f\-:]+)', result.stdout)
else:
mac_addresses = []
return mac_addresses
print(get_mac_addresses())
Now that we’ve laid the groundwork, let’s move on to explore further.
Resources To Find MAC Address Information
[1] macvendorlookup.com:
https://www.macvendorlookup.com/
Features:
- Provides detailed information about the manufacturer associated with a MAC address.
- Offers a user-friendly interface for easy MAC address lookup.
- Displays additional details such as address blocks and associated companies.
They have now added support to below additional IEEE registries:
MA-L: IEEE MAC Address Large (24-bit block size)
MA-M: IEEE MAC Address Medium (28-bit block size)
MA-S: IEEE MAC Address Small (36-bit block size)
OUI24: Organizationally Unique Identifier (24-bit block size)
OUI36: Organizationally Unique Identifier (36-bit block size)
IAB: Individual Address Blocks (36-bit block size)
CID: Company ID Blocks (24-bit block size)
EUI48: Extended Unique Identifier (48-bit block size)
[2] networkcenter.info:
https://www.networkcenter.info/inform/mac
Features:
- Allows users to search for MAC addresses and obtain information about the associated organization.
- Offers a comprehensive database with a vast range of MAC addresses.
[3] 2ip.ua:
https://2ip.ua/ru/services/information-service/mac-find
Features:
- Provides a MAC address information service with an easy-to-use search interface.
- Offers information about the manufacturer and device type associated with the MAC address.
[4] samy.pl:
http://samy.pl/mapxss/
Features:
- Focuses on geolocation data associated with MAC addresses, providing a visual representation on a map.
- Offers insights into the physical locations of devices based on their MAC addresses.
[5] wigle.net:
https://wigle.net/
Features:
- Specializes in wireless network mapping and geolocation.
- Allows users to search for MAC addresses and view their associated locations on a map.
- Provides a vast database of wireless networks worldwide.
[6] uni-tools.net:
https://uni-tools.net/services/mac-location
Features:
- Offers a MAC location lookup service with geolocation data.
- Provides information about the manufacturer and country associated with a MAC address.
Do you know about MAC spoofing?
MAC spoofing is a technique used by hackers to alter their device’s MAC address, making it appear as a different device on the network. This can be employed for malicious purposes by cyber criminals, such as bypassing network restrictions or conducting unauthorized activities.By changing the MAC address, hackers can avoid detection on a network, making it as a challenge for security measures to identify and block them.
MAC Spoofing Method for Linux
Macchanger: A tool for changing MAC addresses on Linux systems.
https://www.kali.org/tools/macchanger/
Features
- set specific MAC address of a network interface
- set the MAC randomly
- set a MAC of another vendor
- set another MAC of the same vendor
- set a MAC of the same kind (eg: wireless card)
- display a vendor MAC list (today, 6200 items) to choose from
MAC Spoofing Method for Windows
TMAC: A MAC address changing tool for Windows systems.
https://technitium.com/tmac/
Features
- Works on Windows 10, 8 & 7 for both 32-bit and 64-bit.
- Enhanced network configuration presets with IPv6 support allow you to quickly switch between network configurations.
- Allows complete configuration of any network adapter.
- Command line options with entire software functionality available. You can select a preset from specified preset file to apply directly.
- Update network card vendors list feature allows you to download latest vendor data (OUI) from IEEE.org.
Ok! Let’s Understand MAC Addresses more..
As you know, a Media Access Control (MAC) address is a unique identifier assigned to network interfaces for communication on a network. It consists of six pairs of hexadecimal digits, separated by colons or dashesexample: 01:23:45:67:89:ab
3 Size Ranges: MA-L, MA-M, and MA-S
- MA-L (Large): Globally unique and assigned by the IEEE Registration Authority. Example: 00-1A-2B.
- MA-M (Medium): Locally administered addresses. Example: 02-3C-4D.
- MA-S (Small): Reserved for future use. Example: 06-7E-8F.
Unique Organization Identifier (OUI)
- The first three pairs of digits in a MAC address represent the OUI, identifying the manufacturer or vendor.
- For example, in the MAC address 74-C6-3B-15-AF-6E, 74-C6-3B is the OUI.