Finally got one! I recently read this paper (
attached, remove .txt from pdf to open) where the author discuss finding a few algorithms. Sadly they don’t disclose the actual algorithms, which means that we have an egg hunt on our hands!
I found 2 files in the firmware for
elecom's WRH-583WH2 named
wpakey2.4g and
wpakey5g. Loading them into Ghidra was easy and the decompiled pseudo code was simple to grab. Working with AI a bit, I was able to get a working python script of the wpakey5g algorithm (
attached, remove .txt). Testing it in my environment, I am able to confirm that it correctly generates the key shown on the device. There are only a few entries for these SSID on WPA-SEC. Unfortunately the keygen doesn’t crack any of them. I tried using the MAC address +/- 6 as input but still didn’t have any luck. Elecom makes other models with the same SSID and different password format.
Known <MAC:Pass> from images:
bc5c4c2ced61:4772699470186
bc5c4c2d0085:4766205670098
bc5c4c2d016b:5367495178935
The
wpakey2.4g is actually a different algorithm that uses “
HW_WLAN1_WLAN_ADD” as input, but wpakey5g uses “
HW_NIC1_ADDR”. I have been able to emulate wpakey2.4g with QEMU and it spits out "5108498128774”. A bin named “flash" is where the MAC address is pulled from NVRAM that’s used as input, but I haven’t quite worked out feeding it a known MAC to see what it puts out or what the default MAC that it’s generating that key for.