hashcat Forum

Full Version: Creating Custom Password List
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hopefully it is ok to ask this question here, but here it is.

I am trying to create a custom password list.  The routers I am testing have a default password that uses the last 10 of LAN MAC.  It just so happens that the value of the last two digits of the LAN MAC is one less hex value than the WLAN MAC.

For example.

WLAN MAC is 112233445566, therefore I know the default WiFi password is going to be 2233445565.  

Another example
WLAN MAC is 112233abcdef, so the WiFi password will be 2233abcdee.

Of course the tricky one would be

WLAN MAC of 112233abcde0 therefore the WiFi password will be 2233abcddf

In Linux: I can easily cut digits 3-12, but is there any way to decrease the last two digits by one hex value?
(10-23-2019, 10:48 PM)slawson Wrote: [ -> ]is there any way to decrease the last two digits by one hex value?
I would build an array and walk through it.
Never done that before, I'll see what I can find online. Thanks.
For example with Bash:

$ for WLAN_MAC in 112233445566 112233abcdef 112233abcde0; do ETH_MAC=`printf '%x' $(( 0x$WLAN_MAC - 1 ))`; echo $ETH_MAC | cut -c 3-; done
2233445565
2233abcdee
2233abcddf

What routers work like that? That's seriously terrible Smile
Awesome. That's exactly what I was looking for. Thank you.

Since I have the MACs in a file this was my command:

for WLAN_MAC in $(cat macs.txt); do ETH_MAC=`printf '%x' $(( 0x$WLAN_MAC - 1 ))`; echo $ETH_MAC | cut -c 3-; done > macpasswords.txt

Would you mind explaining what the '%x' is there for in the printf syntax?
%x tells printf to print the variable in lower-case hexadecimal, to be able then to decrease the value by 1.
Thanks for the info. This little project worked wonderfully.