mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1378] Automate generation of JtR-jumbo package for Windows #872
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#872
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kholia on GitHub (Jun 3, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1378
Originally assigned to: @kholia on GitHub.
Once we have MinGW builds working, generation of JtR-jumbo Windows package automatically should be possible.
@jfoug commented on GitHub (Jun 3, 2015):
Ok, if we do this, then what will be built?
SSE2 ? XOP ? Some other SIMD ? Non-SIMD?
OpenMP ?
OpenCL ?
What libs to expect / supply?
What ancillary tools tools also provide?
This is part of the issue with a static build, not done on the proper machine, with proper things installed. NOTE, windows is NOT like unix, where certain libs can be expected, and expected in pretty standard places. Also, for unix, one simply does a ./configure and gets all of the nuances handled.
Do not get me wrong, I think this is a fine goal. But I think in the end, we are going to have to provide a somewhat stripped down and generic version. (I consider base SSE2 to be generic). Also, expecting perl or python to be working can be pushing it for most windows installs.
This is really why I find cygwin a MUCH better solution. Relatively easy to install properly, and gives you a true (close to true) posix shell to configure properly. Also, with cygwin installed, you can change the PATH environment on the windows machine, AND then are able to run john exe's outside of the cygwin shell
@kholia commented on GitHub (Jun 3, 2015):
@jfoug yes, I also expect the first generation of this JtR-jumbo package for Windows to be pretty limited / stripped down ;(
This is more of a long-term vision (one of my friends asked me to solve this problem) :)
@jfoug commented on GitHub (Jun 3, 2015):
After following the instructions on the cross compile links you provided, I created a new ubuntu 14_04 VM, and put mingw on there. It took a bit to get oSSL installed (damn errors in the .pod files, which I do not care about). But now I see this problem within config:
@jfoug commented on GitHub (Jun 3, 2015):
Found the problem. In ~/bin/mingw64 script (from the cross compiling page)
CPP = x86_64-w64-mingw32-cpp
This has to be
CPP = x86_64-w64-mingw32-gcc -E
@magnumripper commented on GitHub (Jun 4, 2015):
I think we should primarily build a basic 64-bit SSE2 binary with no bells and whistles (most binary distros do it that way). Anything we can link statically should be fine to enable. I'm guessing we can't link OpenCL static.
Was that CPP problem something we need to tweak in autoconf?
@jfoug commented on GitHub (Jun 4, 2015):
No, it was caused by the helper scripts I found on http://www.tinc-vpn.org/examples/cross-compiling-64-bit-windows-binary/ The script was
I had to change CPP to
export CPP="$PREFIX-gcc -E"@kholia commented on GitHub (Jun 4, 2015):
@jfoug it would be great if you can commit, and publish your changes to ".travis.yml" (in a separate branch)!
@jfoug commented on GitHub (Jun 4, 2015):
I have not been able to get a mingw build working at all yet. I can not link, and have not been able to figure out why. I am not sure that I am getting openssl built correctly
@jfoug commented on GitHub (Jun 4, 2015):
@kholia can you try to build cross-compile with mingw? I had to make these changes to get a compile (they are not checked in yet) :
Also, the makefile made did not have -lssl and -lcrypto added to the libs line (I have not looked into why). Now, I am not able to correctly link. I get failures listing that some winsock functions are not found (even though -lws2_32 and -lwsock are there, also, there is an error about a bad reloc address in the libs (ssl and crypto). I have tried rebuilding a couple times, and still can not get it.
See if you can do better. If so, possibly all I need is instructions on getting oSSL built and installed properly. I installed ossl using this (to try to integrate it into the system as though it was native)
I have also tried without zlib (default), and also with no-asm Nothing seems to make any difference. I have also done a local install, then added those paths into the configure load of jtr. Same end errors, so for me it is easier to simply try to install the libs 'like' they are native.
@kholia commented on GitHub (Jun 4, 2015):
@jfoug I had to do similar changes yesterday, and I am stuck too at the linking stage!
I will give it another go this weekend, thanks for taking a look.
@jfoug commented on GitHub (Jun 4, 2015):
I have been able to get a cygwin build working, where only a few dll's have to be used. I use forced /lib/libssl.a vs -lssl for many of the libs, so that static code gets linked. This build has quite a few things added (ssl, z, openmp, libdl, libcrypt, libbz2, aes asm, etc). It is apretty robust build.
Here is what it looks like, and the 4 DLL's needed. This was in a CMD.exe shell, with no path entry into my cygwin64 binary directory.
Why are we trying to target mingw as our 'pre-canned' Win32 exe file? Also note, I can reduce to only 3 DLL's by disabling the GMP. I think I can reduce to just one, if I also remove OMP.
NOTE, the john was not stripped. It is 5.1mb when stripped. My john.exe file (stripped) where all libs were dyna libs, was 4.2mb
@kholia commented on GitHub (Jun 4, 2015):
@jfoug good question!
Can we use Cygwin "cross-compiler" under the Travis CI environment? I was planning to use Travis CI to do automated builds for Windows.
The default Travis CI OS (i.e. Ubuntu) sucks when it comes to providing a working MinGW environment.
@jfoug commented on GitHub (Jun 4, 2015):
I do not know. Let me see if I can get cygwin cross under ubuntu. IF that can be done, then we can figure out how to do it on travis.
How do we get the 'base' VM for travis? Since cygwin uses an install, it would be nice to be able to provide a pre-built image (I assume Wine). I doubt we are going to be able to use the apt-get interface to install cygwin properly, BUT if we can just install the cygwin-gcc and libs, 'possibly' we could do that (i.e. using the ubuntu environment to configure and build)
@jfoug commented on GitHub (Jun 5, 2015):
@kholia Is there a better distro for cross compiling with mingw64 than ubuntu? I am using 14_04 Ubuntu, but I could create a VM with any distro if one works better.
Fedora looks good. I will give it a try. There is a MinGW SIG, http://fedoraproject.org/wiki/MinGW so there looks like to be better integrated support.
@kholia commented on GitHub (Jun 5, 2015):
@jfoug Fedora works great for MinGW stuff :-)
"doc/README.MinGW" file has the steps.
@jfoug commented on GitHub (Jun 5, 2015):
Ok, here are my notes:
@jfoug commented on GitHub (Jun 5, 2015):
Yes it DOES work, but we may have some changes to make. Either 'fixing' the mingw64-configure script suite so that CPP, LD, AS and strip are setup properly, documenting what needs to be 'fixed'.
Or we change the configure steps to make things 'work' correctly.
Also, I am wondering why the JOHN_SYSTEMWIDE stuff gets set. It possibly is due to the crap located in /usr/x86_64-w64-mingw32/sys-root/mingw/bin
Also, we should try to get static linkage as much as possible
@jfoug commented on GitHub (Jun 5, 2015):
Here is an interesting 'find'. I found all the static libs (not for gmp however), such as:
mingw64-zlib-static
mingw64-openssl-static
etc
BUT when I build this way, adding the -static flag at proper place on the linkage line, I get the EXACT same problems I was seeing on ubuntu for the static build of oSSL. It is all the winsock __imp_startup, __imp_WSAsetup, etc type functions.
So this must be some shortcoming within openssl mingw64 build that is NOT properly building the static libs. Too bad.
I now have a OMP mingw build also. I had to also load these libs:
mingw64-libgomp (I also put in mingw64-libbz2)
Once gomp was included there were more .dll's to also use (GOMP is not available in static lib)
The DLL's I now have are:
The libgomp-1 and libgcc_s_seh-1 dll's were needed.
@kholia commented on GitHub (Jun 5, 2015):
@jfoug great! 👍
It sucks that Travis CI only supports Ubuntu. I tried finding another CI solution (even Docker based ones, capable of running Fedora), but no luck so far.
@jfoug commented on GitHub (Jun 5, 2015):
The problem with Ubuntu, is that we would have to install mingw64, then pull source for libz and build/install and pull source for oSSL and build/install. The ossl build is about 20 minutes just itself. That's pretty ugly. Of course, we could easily do all of this with a script, BUT are we buying ourselves anything?
I will test ubuntu by building a dynamic oSSL, installing that, and seeing if the mingw64 build works after that. That may be the 'only' thing failing on Ubuntu, since I saw the same link errors with Fedora when doing a static link.
@jfoug commented on GitHub (Jun 5, 2015):
With wine installed, I no longer get cross compiling :( I have to figure some way around that
Btw, back to working with ubuntu
@kholia commented on GitHub (Jun 5, 2015):
@jfoug yeah, wine causes crazy problems during the cross-compilation process.
Maybe disabling the "binfmt_misc" kernel module will help?
@jfoug commented on GitHub (Jun 5, 2015):
I just uninstalled wine for now.
@jfoug commented on GitHub (Jun 5, 2015):
Ok, I now have Ubuntu building john, after making the dynamic ossl.
Here was my configure line for oSSL
CROSS_COMPILE=x86_64-w64-mingw32- ./Configure no-static shared --prefix=/usr/x86_64-w64-mingw32 --openssldir=/usr mingw64
It still builds a static. I get a long warning about putting DLL's into a non-standard location, so I am not 100% sure things are perfect.
But it DID build a ../run/john executable which we were not able to get to link prior to this on ubuntu.
@kholia commented on GitHub (Jun 5, 2015):
@jfoug cool!
The next step would be to get this working within the Travis CI environment.
https://github.com/kholia/JohnTheRipper/tree/Travis+MinGW is what I was doing, before I ran into those linking problems.
@jfoug commented on GitHub (Jun 5, 2015):
Try changing this:
to this:
This may also need work (in .travis.yml)
You may have to add linker flags for oSSL (I did), and I see you do not override the gcc (and other tools) prior to calling configure. I am thinking that needs to be done
@kholia commented on GitHub (Jun 6, 2015):
@jfoug I am now stuck at "aes/aes.a: could not read symbols: Archive has no index; run ranlib to add one" error message.
See https://travis-ci.org/kholia/JohnTheRipper/builds/65681704 for the details.
What is the real problem here? Old toolchain?
@jfoug commented on GitHub (Jun 6, 2015):
The right ranlib must be run. All build tools must be mingw64 stuff. Can you run make without -s and see if it shows which took is used
@kholia commented on GitHub (Jun 6, 2015):
@jfoug "/usr/bin/ar" is being used, which is not right at all!
Also, it seems that we don't propagate "AR" environment variable (if set) to src/Makefile and src/aes/Makefile. I am trying to fix this problem now, but no luck so far.
@jfoug commented on GitHub (Jun 6, 2015):
In my good builds, AR env var was set before calling configure and make
@kholia commented on GitHub (Jun 6, 2015):
@jfoug running "mingw64 ./configure --host=x86_64-w64-mingw32" is overwriting the "AR" value (which is currently set by the mingw64 script).
@kholia commented on GitHub (Jun 6, 2015):
github.com/magnumripper/JohnTheRipper@8bff8a6236has fixed this "ar" problem. Moving on!@kholia commented on GitHub (Jun 6, 2015):
MinGW builds are now working (thanks to @jfoug for doing the heavy lifting).
The next steps are testing, and automated publishing of the build artifacts.
http://docs.travis-ci.com/user/deployment/releases/ might be helpful :)
@jfoug commented on GitHub (Jun 8, 2015):
I think we are really close now. After I fixed my strip (not 100% needed, but is important), I am able to do a
git pullfollowed by a valid JtR build cross compiling on Ubuntu64.Here is the additional inforamation:
The file made is john, not john.exe since we are 'building' under ubuntu, even though cross compiling. I think we can fix that, but I have not looked into it. Since we 'know' the behavior, it really is not all that important.
@kholia commented on GitHub (Jun 8, 2015):
@jfoug thanks! I have merged these changes into the https://github.com/kholia/JohnTheRipper/tree/MinGW branch.
The PR is at https://github.com/magnumripper/JohnTheRipper/pull/1416 URL.
@kholia commented on GitHub (Jun 8, 2015):
@jfoug I still need to figure out how to locate, and copy those .dll files (in an Ubuntu based MinGW setup), which are required for running "john.exe".
@jfoug commented on GitHub (Jun 8, 2015):
I notice that you have a complete unique .travis.yml file. Do you have any plans on how to do this 'for real' ? Are we going to create a 2nd travis environment for this? So travis #1 works just like it does today with travis #2 being only a mingw build?
@kholia commented on GitHub (Jun 8, 2015):
@jfoug take a look at https://github.com/kholia/JohnTheRipper/blob/MinGW/.travis.yml :)
It's ugly but it works fine.
@jfoug commented on GitHub (Jun 8, 2015):
The ossl files that my 'depends' link to are NOT from the mingw build. They are the oSSL for windows DLL's (very fast build), that I have installed.
We can work on the 'test' phase later. We will have to build. Then install wine, then run. We may just have to wget DLL's from somewhere. They may also be 'somewhere' in the ossl build (as a .so???, that simply need to be renamed something like LIBEAY32.dll and SSLEAY32.dll
@jfoug commented on GitHub (Jun 8, 2015):
Yes I had already looked at your .travis.yml file. I see only mingw in there.
@kholia commented on GitHub (Jun 8, 2015):
https://github.com/kholia/JohnTheRipper/blob/MinGW/.travis.yml#L35 (this does the regular Linux build, and testing)
https://github.com/kholia/JohnTheRipper/blob/MinGW/.travis.yml#L41 (this does the MinGW build)
@jfoug commented on GitHub (Jun 8, 2015):
Ok, to get clang to work, try this:
Now within the script, we always do the first line (minus the cd). This builds and tests gcc and clang.
Then we place an IF into the script, and the rest of the commands go into an if block. Those commands are only executed if we are in a GCC building environment (I think there are env vars listing this).
Doing this, we should be able to get all 3 environments working (I think).
@kholia commented on GitHub (Jun 8, 2015):
@jfoug this idea works great 👍
@jfoug commented on GitHub (Jun 8, 2015):
Ok, now with that change, we have 2 new scripts, a modified .travis.yml, and it looks like pretty much everything is running fine. We do install too much on the clang VM, but I think the only way around that, is to make changes to the script to do the installs. I bet the installs are not that huge of an issue (I would think not), but they might be.
It would make sense to ask if some of these things could be installed on the default VM. They do update that every couple of months. I would think having a mingw64 cross compiler would be something they could advertise. It can not just be our project that needs this functionality (Windoze build testing).
But as it stands, I think this is getting close to not being a POC.
@kholia commented on GitHub (Jun 9, 2015):
@jfoug I have a feeling that you will like the https://github.com/kholia/JohnTheRipper/releases/ page.
Check out the "JtR-MinGW.zip" file :)
@kholia commented on GitHub (Jun 9, 2015):
The build crashes for some formats (under Windows 8.1 64-bit) but things are good, in general :)
@jfoug commented on GitHub (Jun 9, 2015):
The ONLY dll's you need to include are:
libeay32.dll
ssleay32.dll
All others have no usage by any of the exe files.
NOTE, I am not sure why we are crashing. I was not getting crashes, IIRC
I am getting a ton of formats coring. md5crypt, dynamic_0, dynamic_1, dynamic_2 (I gave up). Something is very wrong.
@kholia commented on GitHub (Jun 10, 2015):
This ticket is largely solved in commit
0387122fa5(merged now!).The next steps would be to make sure that the builds don't crash, and to package everything up more nicely using NSIS / pynsist.
@kholia commented on GitHub (Jun 10, 2015):
@jfoug the crashes seem to be caused by the super old MinGW toolchain, and getting the new MinGW toolchain on Ubuntu 12.04 (Travis CI OS) seems to be tricky.
@jfoug commented on GitHub (Jun 10, 2015):
Ok, I thought my mingw builds (under ubuntu) were working, but they are not. They fail also :(
@jfoug commented on GitHub (Jun 10, 2015):
We might check to see if mingw-32 works.
@jfoug commented on GitHub (Jun 10, 2015):
Too bad we could not leverage Fedora. I did test the exe built there, and it was fine.
@kholia commented on GitHub (Jun 10, 2015):
@jfoug I am taking a look at CircleCI (https://circleci.com/) now. Maybe it will solve all our problems (TM).
@jfoug commented on GitHub (Jun 10, 2015):
https://circleci.com/docs/environment Uses 12_04 ubuntu as the base VM
@kholia commented on GitHub (Jun 10, 2015):
@jfoug CircleCI supports Docker, and I have a Fedora based Dockerfile for JtR almost ready :)
I just need to spend some time getting familiar with CircleCI's Docker environment.
@jfoug commented on GitHub (Jun 10, 2015):
What is docker, another VM? So we run a OS in a VM inside another VM, lol
@kholia commented on GitHub (Jun 10, 2015):
@jfoug don't even go into that discussion :|
@kholia commented on GitHub (Jun 10, 2015):
@jfoug the binaries built by Fedora's MinGW work like a champ (including OMP) 👍
@jfoug commented on GitHub (Jun 11, 2015):
Once we release, we need to compare speed (oSSL speeds), from the build to the DLL's from here:
http://slproweb.com/products/Win32OpenSSL.html
I find those DLL's to be about optimal for speed, but I would like to compare to the speed we get on the Fedora build
@magnumripper commented on GitHub (Jun 11, 2015):
I've seen sites having a very hard time recovering from a power outage because servers that were needed for booting the physical servers were moved into VMs running on them 😵
@jfoug commented on GitHub (Jun 21, 2015):
I worked to get a 'clean' mingw64 build. It ONLY requires LIBEAY32.DLL and SSLEAY32.DLL files (and windows system dll's). It does not do OMP (libgomp-1.dll is required for that). Thus, there are NO dll's built from MinGW64. However, the exe still crashes 👎
@kholia, since you put a Fedora VM onto a VM inside of CircleCI, I wonder if we could do the same with a Win7 VM with cygwin-64 installed??? If so, I KNOW that cygwin64 works like a champ. Yes, we would have to release DLL's, but, ..... I am just not sure of all the ramifications of doing this.
@kholia commented on GitHub (Jun 22, 2015):
I don't think that CircleCI supports Windows VMs. I will double check this.
@jfoug commented on GitHub (Jul 5, 2015):
Have we found out anything new on this one? It sux that the Mingw64 cross compiled build works like a champ in wine on the build box, but fails terribly in windows environment.
@kholia commented on GitHub (Jul 6, 2015):
No luck, I haven't looked at this stuff in a long while.
@jfoug commented on GitHub (Jul 6, 2015):
How was this URL setup, and work? http://daily-builds.appspot.com/latest
I know it goes to circleci to grab a build. I was wondering if it would be possible to setup a box to simply query git on a timer (4 times a day or so), and if there is new git items, simply pull them, then build and package and ftp upload the final package to some site. I could script something like that pretty easily. That way we would get a WORKING Win32/64 set of files.
@jfoug commented on GitHub (Jul 6, 2015):
This is in x86-64.S
I wonder if things like this are part of the problem. I would be 100% certain that mingw-64 would need to use the same windows-x64 ABI If Mingw-64 does not define _WIN64, then we are in trouble here. ALSO, there may be other locations within JtR code that is like this, where we MUST also do special coding for MinGW-64.
@jfoug commented on GitHub (Jul 6, 2015):
I have this script, and it builds wonderfully, and fully runable exe's I have a 32 bit directory (where cygwin-32 runs in), and a 64 bit environment. I could easily get this script running as a cyg-service, running it every 4 hours or so. This would work fine, if I had somewhere to upload the files to.
@magnumripper commented on GitHub (Jul 6, 2015):
I guess you could upload to http://openwall.info/wiki/john/custom-builds using curl or something.
@magnumripper commented on GitHub (Jul 6, 2015):
MinGW gcc is supposed to define
_WIN64@jfoug commented on GitHub (Jul 7, 2015):
Ok, BUT there may be other things that are _MSC_VER || CYGWIN or just _MSC_VER That was my point. Whatever is going wrong, was not a problem when I was building mingw-32, but now when we are trying mingw-64, something is very wrong.
@jfoug commented on GitHub (Jul 7, 2015):
I plan on curl, but I would really like to be able to also delete. I would like to keep only a 'current' version (or possibly 2). These are 35+mb, and if I do a 32 bit (sse2) and a 64 bit SSE4.1 build, then that is 70mb each build. I do not think we can clean up on the wiki, so if there are 50 builds a week, that is 3.5gb I think Solar might complain after a few years, lol.
@kholia commented on GitHub (Jul 8, 2015):
The mystery around the crash deepens,
All these runs were done on a Windows 8.1 64-bit machine. My current hypothesis is that anything which uses
dynamicformat stuff, will crash.I am trying to use https://github.com/jrfonseca/drmingw to narrow this down now (I don't have much hope though!).
@kholia commented on GitHub (Jul 8, 2015):
The following patch "fixes" this crash,
md5cryptseems to be crashing for a different reason, looking into that one now.@kholia commented on GitHub (Jul 8, 2015):
The following patch fixes the
md5cryptcrash (similar idea),@magnumripper commented on GitHub (Jul 8, 2015):
I'm pretty sure those fixes are mere workaround hacks that will lead to other problems.
@kholia commented on GitHub (Jul 8, 2015):
@magnumripper agreed! we need to nail down the real root cause.
@magnumripper commented on GitHub (Jul 8, 2015):
I'm not sure
-DDYNAMIC_DISABLEDworks as it should right now (it should be fixed if not). You could try a build using that and see what happens.eg
./configure CPPFLAGS=-DDYNAMIC_DISABLED@magnumripper commented on GitHub (Jul 8, 2015):
Feck it's totally broken. I'm on it.
@magnumripper commented on GitHub (Jul 8, 2015):
69501b04fixes./configure CPPFLAGS=-DDYNAMIC_DISABLED@jfoug commented on GitHub (Jul 30, 2015):
I just got a new Fedora VPS, so I will see about setting this up. Heck, I might even build our own 'custom' CI like environment, lol.
@jfoug commented on GitHub (Aug 4, 2015):
I am getting close to having this one done, with an automatic 'gitcheck, gitpull, configure, make, -test=0, zip, deploy' script. The build is done with Cygwin64. I simply have a script that monitors git every 2 minutes, and if there is anything new, it pulls, and builds 2 times (one pure SSE2 and one XOP, I want a 3rd that is AVX2, but I will have to figure out how to build that way on a non-AVX2 cygwin box). Each of those are zip'd, into an only exe files zip. There is also a 'base' zip, that contains ./docs ./run (except the exe files), and the needed cygwin dll's.
I will play with it a bit more, but I think this is very close to release ready.
@magnumripper commented on GitHub (Aug 18, 2016):
I believe this is in place