keepass > 99999999
#3
Thanks for the answer, I will elaborate on all fronts.



Regarding the password I'm pretty sure that I almost know it, but just got some variations that I typically use wrong, as such I created already a dictionary with around 18.000 candidates, so yea that should take some time but sounds feasible. Regarding charset, I should also be fine as I was running tests with newly created keepass databases to make sure the process works apart from that 8 digit limit on iterations.




Now regarding compilation, let me preface this that I'm not the C/C++ coder, usually I develop in Java, so all these compilation stuff is pretty new to me, though I fiddled with it from time to time. Windows is the main system set up for me, in the VM hashcat won't work direkt as I have no CUDA support there, that's why I'm trying to compile it for windows.



I tried the cygwin approach and made sure that I have all the listed packages installed with cygwin. I was following the cygwin instructions like that and when running make ran into this:



Code:
make: g++: No such file or directory


make: *** [src/Makefile:555: obj/strlist.NATIVE.o] Error 127


make: *** Waiting for unfinished jobs....


make: g++: No such file or directory


make: *** [src/Makefile:555: obj/strfn.NATIVE.o] Error 127



So then I thought that I just linux for the compilation stuff, as I feel that actually compilation on linux is much easier than on windows, but maybe that is just because of my inexperience with it... Anyway, here comes the ubuntu endeavour. After writing all of this including the errors I actually found a way to interpret the hints differently and was able to fix the problem. So I will just keep this error log, may it be useful for somebody else. In the end is a short summary on what is exactly needed to do.



After running make clean and make win:



Code:
x86_64-w64-mingw32-gcc  -std=gnu99 -W -Wall -Wextra -O2 -pipe -Iinclude/ -IOpenCL/ -Ideps/LZMA-SDK/C -Ideps/zlib -Ideps/zlib/contrib -Ideps/OpenCL-Headers -DWITH_BRAIN -Ideps/xxHash -DWITH_CUBIN -Ideps/unrar -fPIC -I/opt/win-iconv-64/include/ -DWITH_HWMON  -c -o obj/convert.WIN.o src/convert.c



In file included from src/backend.c:7:



include/types.h:37:10: fatal error: iconv.h: No such file or directory



  37 | #include <iconv.h>



      |          ^~~~~~~~~



In file included from src/benchmark.c:7:



include/types.h:37:10: fatal error: iconv.h: No such file or directory



  37 | #include <iconv.h>



      |          ^~~~~~~~~



compilation terminated.



In file included from src/convert.c:7:



include/types.h:37:10: fatal error: iconv.h: No such file or directory



  37 | #include <iconv.h>



      |          ^~~~~~~~~



compilation terminated.



In file included from src/autotune.c:7:



include/types.h:37:10: fatal error: iconv.h: No such file or directory



  37 | #include <iconv.h>



      |          ^~~~~~~~~



compilation terminated.



make: *** [src/Makefile:689: obj/benchmark.WIN.o] Error 1



make: *** Waiting for unfinished jobs....



compilation terminated.



In file included from src/bitmap.c:7:



include/types.h:37:10: fatal error: iconv.h: No such file or directory



  37 | #include <iconv.h>



      |          ^~~~~~~~~



compilation terminated.



In file included from src/bitops.c:7:



include/types.h:37:10: fatal error: iconv.h: No such file or directory



  37 | #include <iconv.h>



      |          ^~~~~~~~~



compilation terminated.



In file included from src/combinator.c:7:



include/types.h:37:10: fatal error: iconv.h: No such file or directory



  37 | #include <iconv.h>



      |          ^~~~~~~~~



make: *** [src/Makefile:689: obj/autotune.WIN.o] Error 1



make: *** [src/Makefile:689: obj/convert.WIN.o] Error 1



compilation terminated.



make: *** [src/Makefile:689: obj/bitops.WIN.o] Error 1



In file included from src/affinity.c:7:



include/types.h:37:10: fatal error: iconv.h: No such file or directory



  37 | #include <iconv.h>



      |          ^~~~~~~~~



compilation terminated.



make: *** [src/Makefile:689: obj/bitmap.WIN.o] Error 1



make: *** [src/Makefile:689: obj/backend.WIN.o] Error 1



make: *** [src/Makefile:689: obj/combinator.WIN.o] Error 1



make: *** [src/Makefile:689: obj/affinity.WIN.o] Error 1



Go figures, iconv.h is missing, after searching for that, I downloaded some libraries from gnu.org, and compiled them but that wasn't working. After some more searches I found this forum entry (https://github.com/hashcat/hashcat/blob/...#L555-L560) pointing to some remarks in the Makefile.



Code:
## To compile win-iconv with mingw clone from here: https://github.com/win-iconv/win-iconv


## Then patch the makefile with the patches from tools/win-iconv-64.diff and run make install




It seems like I need to crosscompile that version to get it runnning. Ok. As I had read a lot about crosscompiling and exchanging compilers etc. I figured I need to compile the referenced iconv repository, so I cloned the given repo. At first, I saw there is the CMakeLists.txt, so I tried creating a build folder and calling

Code:
CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ cmake ..

, which gave me yet another error that the compiler does not support the -rdynamic flag, at which point I posted here.




Now, while writing this, I found another way to interpret that remark in the Makefile, i.e. maybe using the tool hashcat will actually compile the cloned iconv for me already?



That was not the case and I tried to apply the patch to hashcats Makefile in src:



Code:
patch Makefile ../tools/win-iconv-64.diff


patching file Makefile


Hunk #1 FAILED at 6.


Hunk #2 FAILED at 19.


2 out of 2 hunks FAILED -- saving rejects to file Makefile.rej




After having a look at that, it seems like the tool diff is outdated, as it doesn't match. So then I tried to just manually do the changes where possible (but there is no RANLIB and no DLLTOOL, so it basically does not match very well and the build runs directly into include problems as well and doesn't solve the iconv problem, also changing the prefix got me wondering how that could ever work).



Then, I also saw that this project has a Makefile as well, so I looked into it. And it looked exactly like the diff files that are within the hashcat tools! So I patched this time the actual intended Makefile and used make install. Success!




Afterwards, make win for hashcat runs without a problem.



TLDR;


get and crosscompile win-iconv-64 first:


Code:
git clone https://github.com/win-iconv/win-iconv


move it to /opt/win-iconv-64


cd /opt/win-iconv-64


patch Makefile ~/hashcat/tools/win-iconv-64.diff


make install




That installs crosscompiled iconv header files, now you can compile hashcat, using


Code:
make win



I think this should find its way into the compile instructions for windows on linux. What's wrong with the cygwin installation on windows, I don't know.



The build is currently still running, so I think it should work now. Smile





Thanks!



uraks

Edit: removed lots of unnecessary line breaks between all lines... If they are still there I don't know, must be a problem with this editor...
Reply


Messages In This Thread
keepass > 99999999 - by uraks - 03-02-2021, 12:00 AM
RE: keepass > 999999 - by philsmd - 03-02-2021, 12:04 PM
RE: keepass > 999999 - by uraks - 03-02-2021, 03:35 PM
RE: keepass > 99999999 - by philsmd - 03-05-2021, 11:26 AM
RE: keepass > 99999999 - by alwayswannafly - 03-21-2021, 02:22 AM