Skip to content

Commit e9c3fdd

Browse files
committed
in network tab, decode and id "Private MAC" addresses
In RFC7042 section 2.1 specifies the “Local bit”: The Local bit is zero for globally unique EUI-48 identifiers assigned by the owner of an OUI or owner of a longer prefix. If the Local bit is a one, the identifier has been considered by IEEE 802 to be a local identifier under the control of the local network administrator... Both iOS and Android use this as part of their randomized anti-tracking mechanisms. So, display it to admins, so they can tell what device is their phone. Signed-off-by: Robin Getz <rgetz503@gmail.com>
1 parent 62c55dc commit e9c3fdd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/js/network.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ $(() => {
183183
$("td:eq(1)", row).html(
184184
utils.escapeHtml(data.hwaddr) + "<br>" + utils.escapeHtml(data.macVendor)
185185
);
186+
} else if (data.hwaddr && data.hwaddr.includes(":")) {
187+
const firstOctet = Number.parseInt(data.hwaddr.split(":")[0], 16);
188+
// Check whether the 2 (0x02) bit is set using arithmetic to avoid bitwise operators:
189+
if (Math.floor(firstOctet / 2) % 2 === 1) {
190+
const cell = $("td:eq(1)", row);
191+
cell.html(cell.html() + "<br>Private MAC");
192+
}
186193
}
187194

188195
// Make mock MAC addresses italics and add title

0 commit comments

Comments
 (0)