What are the compile instructions needed for this? "file not found with <angled> include; use "quotes" instead"
I've tried using the make file and using gcc but I still get errors about Yubi header files on OSX. I downloaded the Yubi tool CLI resources and put the header files it's looking for right next to the yubicrack.c file as seen in the CLI output. Am I missing something obvious?
I'm not familiar with compiling C files but this seems like it shouldn't be too hard. Seeing how this repo is 14 years maybe something is outdated, lol
ian@M-C02DQ2VRMD6R compileStuff % ls -lah
total 144
drwxr-xr-x 15 ian staff 480B Feb 29 15:40 .
drwx------@ 19 ian staff 608B Feb 29 15:33 ..
-rw-r--r--@ 1 ian staff 395B Feb 29 15:37 Makefile
drwxr-xr-x@ 16 ian staff 512B Apr 24 2018 json
drwxr-xr-x@ 16 ian staff 512B Apr 24 2018 json-c
-rw-r--r--@ 1 ian staff 7.4K Apr 24 2018 ykcore.h
-rw-r--r--@ 1 ian staff 14K Apr 24 2018 ykdef.h
-rw-r--r--@ 1 ian staff 2.1K Apr 24 2018 ykpbkdf2.h
drwxr-xr-x@ 8 ian staff 256B Apr 24 2018 ykpers-1
-rw-r--r--@ 1 ian staff 3.0K Apr 24 2018 ykpers-version.h
-rw-r--r--@ 1 ian staff 9.2K Apr 24 2018 ykpers.h
-rw-r--r--@ 1 ian staff 2.2K Apr 24 2018 ykstatus.h
-rw-r--r-- 1 ian staff 3.9K Feb 29 15:36 yubicrack.c
-rw-r--r--@ 1 ian staff 4.6K Apr 24 2018 yubikey.h
user@M-C02DQ2VRMD6R compileStuff % make
gcc -Wall -O3 `pkg-config --cflags --libs ykpers-1` yubicrack.c -o yubicrack
Package ykpers-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `ykpers-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'ykpers-1' found
In file included from yubicrack.c:20:
./ykpers.h:36:10: error: 'ykstatus.h' file not found with <angled> include; use "quotes" instead
#include <ykstatus.h>
^~~~~~~~~~~~
"ykstatus.h"
In file included from yubicrack.c:20:
In file included from ./ykpers.h:36:
./ykstatus.h:35:10: error: 'ykcore.h' file not found with <angled> include; use "quotes" instead
#include <ykcore.h>
^~~~~~~~~~
"ykcore.h"
In file included from yubicrack.c:20:
./ykpers.h:37:10: error: 'ykdef.h' file not found with <angled> include; use "quotes" instead
#include <ykdef.h>
^~~~~~~~~
"ykdef.h"
3 errors generated.
make: *** [yubicrack] Error 1
I am working this out as well.
apt-get install libykpers-1-dev
gcc -I/usr/include/ykpers-1 yubicrack.c
This is closer, but it appears the library has changed in later versions so not compatible with this code:
gcc -I/usr/include/ykpers-1 -I/usr/include yubicrack.c
# Result
yubicrack.c:(.text+0x1f4): undefined reference to `yk_write_config'
https://developers.yubico.com/yubikey-personalization/Release_Notes.html
Use yk_write_command() instead of yk_write_config().
Gave up on compiling this and tried a slow bash variant:
cat yubikey_bruteforce_access_code.bash
#for ((i=0; i < 281474976710656; i++)); do
for ((i=0; i < 16; i++)); do
echo $i
access_code=$(printf "%012x" $i)
echo $access_code
if ykpersonalize -y -1 -z -c$access_code; then
echo FOUND ACCESS CODE $i
exit
fi
done
Pick the sequence range you want to try. There are 48-bits in the access code.