Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to update ieee-oui.txt on macOS? #165

Open
luckman212 opened this issue Jul 13, 2023 · 3 comments
Open

how to update ieee-oui.txt on macOS? #165

luckman212 opened this issue Jul 13, 2023 · 3 comments

Comments

@luckman212
Copy link

luckman212 commented Jul 13, 2023

I've got arp-scan 1.10.0 on macOS 13.4.1. Installed via Homebrew.

I noticed today, for example, mac d8:b3:70 is not in the standard OUI db that comes with this version. I also noted there is a get-oui program that can update these db's. When I tried it, it failed with:

Can't locate LWP/UserAgent.pm in @INC (you may need to install the LWP::UserAgent module) (@INC contains: /opt/homebrew/opt/perl/lib/perl5/site_perl/5.36/darwin-thread-multi-2level /opt/homebrew/opt/perl/lib/perl5/site_perl/5.36 /opt/homebrew/opt/perl/lib/perl5/5.36/darwin-thread-multi-2level /opt/homebrew/opt/perl/lib/perl5/5.36 /opt/homebrew/lib/perl5/site_perl/5.36/darwin-thread-multi-2level /opt/homebrew/lib/perl5/site_perl/5.36) at /opt/homebrew/bin/get-oui line 31.
BEGIN failed--compilation aborted at /opt/homebrew/bin/get-oui line 31.

Ok, so researching that it seems my system needs Perl and also the LWP::UserAgent module. Off I went down a bit of a rabbit hole... involving sudo cpan followed by trying to install cpanm but failing, then eventually running sudo cpan followed by install LWP::UserAgent manually, which spit out a huge wall of text around 5,542 lines long of various spew, warnings and compilation.

Evenutally that ceased and it appeared I had the precious LWP::UserAgent module...so I tried again

$ get-oui
Can't locate Text/CSV.pm in @INC (you may need to install the Text::CSV module) (@INC contains: /opt/homebrew/opt/perl/lib/perl5/site_perl/5.36/darwin-thread-multi-2level /opt/homebrew/opt/perl/lib/perl5/site_perl/5.36 /opt/homebrew/opt/perl/lib/perl5/5.36/darwin-thread-multi-2level /opt/homebrew/opt/perl/lib/perl5/5.36 /opt/homebrew/lib/perl5/site_perl/5.36/darwin-thread-multi-2level /opt/homebrew/lib/perl5/site_perl/5.36) at /opt/homebrew/bin/get-oui line 32.
BEGIN failed--compilation aborted at /opt/homebrew/bin/get-oui line 32.

Ok, back to sudo cpan and then install Text::CSV...
another 700+ lines of text...

Then

$ get-oui
Could not get IAB data from https://standards-oui.ieee.org/iab/iab.csv

Here is where I gave up.
Does anyone know how to update this simple text file and put it in the correct place for arp-scan to find it?

Thank you 🙏

@luckman212
Copy link
Author

luckman212 commented Jul 13, 2023

I realized I could specify a custom MAC file via --macfile

So for now, I came up with this

UBNT_OUI_FILE='ubnt-ouis.txt'
IEEE_OUI_DB='https://standards-oui.ieee.org/oui/oui.txt'

#grab latest ouis
curl -Lso- "$IEEE_OUI_DB" |
awk 'BEGIN { FS="\t"; OFS="\t" } /hex.*Ubiquiti/ { print substr($1, 1, 8), $3}' >"$UBNT_OUI_FILE"

arp-scan \
  --interface en1 \
  --localnet \
  --plain \
  --macfile="$UBNT_OUI_FILE" |
grep Ubiquiti

Still would love to know if the original thing is possible...

@royhills
Copy link
Owner

Thanks for reporting this issue.

The easiest way to add a Mac address prefix is to edit the mac-vendor.txt file.

It looks like you are close to getting get-oui working. If you add a -v then hopefully it will tell you more about the error that it is encountering.

I realise the perl dependencies are a pain. Ideally arp-scan would move away from perl, but I've not found a better alternative so far.

@luckman212
Copy link
Author

Thank you. 🚀

For now, the small helper script above has got me sorted. I wish I knew more about Perl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants