Skip to content

Commit

Permalink
add basic randomized mac detection
Browse files Browse the repository at this point in the history
  • Loading branch information
joshschmelzle committed Sep 15, 2020
1 parent ad8af90 commit 976cec7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Release 1.0.2

- add basic detection for randomized mac addresses

Release 1.0.1

- bump scapy version from 2.4.3 to 2.4.4

Release 1.0.0-alpha3

- improve test coverage
Expand Down
2 changes: 1 addition & 1 deletion profiler2/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
__url__ = "https://github.com/joshschmelzle/profiler2"
__author__ = "Josh Schmelzle"
__author_email__ = "josh@joshschmelzle.com"
__version__ = "1.0.1-a1"
__version__ = "1.0.2"
__status__ = "alpha"
__license__ = "BSD-3-Clause"
7 changes: 7 additions & 0 deletions profiler2/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def __del__(self):
""" Clean up while we shut down """
pass

def is_randomized(self, mac) -> bool:
""" Check if MAC Address <format>:'00:00:00:00:00:00' is locally assigned """
return any(local == mac[1] for local in ["2", "6", "a", "e"])

def profile(self, queue):
""" Handle profiling clients as they come into the queue """
frame = queue.get()
Expand All @@ -110,6 +114,9 @@ def profile(self, queue):
self.log.debug("starting oui lookup for %s", frame.addr2)
lookup = manuf.MacParser(update=False)
oui_manuf = lookup.get_manuf(frame.addr2)
if oui_manuf is None:
if self.is_randomized(frame.addr2):
oui_manuf = "Randomized MAC"
self.last_manuf = oui_manuf
self.log.debug("%s oui lookup matched to %s", frame.addr2, oui_manuf)
text_report = self.generate_text_report(
Expand Down

0 comments on commit 976cec7

Please sign in to comment.