How to build on/for Win64

Simple directions for installing Cygwin64, pulling the more recent JtR version, and doing a Win64 build.

  • Obtain the cygwin installer for 64 bits from http://cygwin.com/setup-x86_64.exe
  • make a cygwin64 directory (I will default to c:\cygwin64) Do not put ANY spaces into the path name (such as c:\program files\cygwin64). c:\cygwin64 is recommended.
  • place the setup-x86_64.exe into this folder, and run that executable.
  • click Next. Then Next again making sure that 'install from internet' is selected (it should be).
  • put root directory to C:\cygwin64, and install for all users. Click Next.
  • Set local directory to also be C:\cygwin64, click Next
  • Select connection method (For most people direct connect is the right one). Click Next
  • Select a mirror. Some are MUCH faster than others, but this may vary depending upon where you are in the world. I find http://cygwin.mirrors.hoobly.com is pretty good
  • Now, the cygwin package installation page is shown. NOTE, we will be adding many packages to this. Here are the ones recommended. I only install binaries.
  • Here is a list of options to ADD.
    • Archive (these are optional, but recommended)
      • bzip2
      • libz2-devel
      • libz2_1
      • unzip
      • zip
    • Base (just make sure all are selected, they should be)
    • Devel (quite a few here)
      • automake-1.14 (or highest version)
      • binutils
      • bison
      • byacc
      • flex
      • gcc-core
      • gcc-g++
      • gdb
      • git
      • git-completion
      • gnutls-devel
      • libgcc1
      • libgomp1
      • libltdl7
      • libmcrypt-devel
      • libstdc++6
      • make
      • mcpp
      • mingw64-x86_64-binutils
      • mingw64-x86_64-bzip2
      • mingw64-x86_64-gcc-core (note just the -gcc is just source, you do not need it).
      • mingw64-x86_64-gcc-g++
      • mingw64-x86_64-headers
      • mingw64-x86_64-libgcrypt
      • mingw64-x86_64-libgpg
      • mingw64-x86_64-libgpg-error
      • mingw64-x86_64-minizip
      • mingw64-x86_64-pthreads
      • mingw64-x86_64-runtime
      • mingw64-x86_64-winpthreads
      • mingw64-x86_64-xz
      • mingw64-x86_64-zlib
      • nasm
      • openldap-devel
      • patch
      • w32api-headers
      • w32api-runtime
      • yasm
      • yasm-devel
    • Interpreters
      • perl (You may also want python, and ruby, but I do not have knowledge of what to install for them)
    • Libs (quite a few here)
      • crypt
      • gmp
      • libcrypt-devel
      • libcurl-devel
      • libcurl4
      • libevent
      • libevent-devel
      • libevent2.0_5
      • libgcrypt
      • libgcrypt-devel
      • libgcrypt11
      • libgmp-devel
      • libgmp10
      • libiconv
      • libiconv-devel
      • libiconv2
      • libopenmpi
      • libopenmpi-devel
      • libopenmpicxx1
      • openmpi
      • zlib
      • zlib-devel
      • zlib0
    • Math
      • bc
    • Net
      • ca-certificates
      • curl
      • libssh2-devel
      • libssh2_1
      • openldap
      • openssh
      • openssl
      • openssl-devel
      • wget
    • Perl
      • perl-Archive-Zip
      • perl-Authen-SASL
      • perl-Capture-Tiny
      • perl-Clone
      • perl-Config-AutoConf
      • perl-Data-*
      • perl-Digest-*
      • perl-ExtUtils-*
      • perl-File-*
      • perl-Getopt-ArgvFile
      • perl-IO-*
      • perl-IPC-Run3
      • perl-YAML
  • Click Next. This will bring up a window where a lot more packages are checked. These are dependant pagages. Make sure the 'Select required packages' is checked so that all these packages load also, then click Next.
  • Cygwin will now install
  • NOTE, at any time (after this install), you can run the setup-x86_64.exe to install new packages, OR to update the packages which are alrady installed. NOTE, when doing so, it is always best to download the newest version of this tool from www.cygwin.com. Also, when running the update, make sure that ALL cygwin terminal are shut down, AND that all processes built using cygwin (linked against the dll's) are shutdown. Cygwin will warn you (hopefully), that files are locked. But Shut things down anyway, just to be safe.
  • After a while, install completes. At the time I wrote this (March 2014), I was getting a message: “Package: bash bash.sh exit code 1” message. Does not seem to cause problems. Click Next.
  • I always create a desktop icon, and start menu
  • Now Cygwin64 should be 'base' installed. From the start menu, run the Cygwin64 Terminal. On first run, it should create your home directory, telling you where it is, and set some default files.
  • close this terminal.
  • edit the file c:/cygwin64/home/username/.bashrc (I edit using notepad++. This can also be edited from WITHIN the cygwin64 shell).
  • In this file, add the line: export GCC=gcc I am not sure why cyg 64 does not do this, but I have found it is NOT done, and make's will fail. NOTE, there are many things you may want to change within this file (many things you may simply want to uncomment). Also look at .bash_profile in the same directory. Save the file
  • Start a new cygwin64 terminal
  • Obtain JtR source (we will get the most current bleeding release), build and test:
    • git clone git:\/\/github.com/magnumripper/JohnTheRipper -b bleeding-jumbo JtR-Bleeding
    • cd JtR-Bleeding/src
    • make -j4 win64-cygwin-x86-64
    • after the make (if it succeeds), you should have ../run/john.exe and the command above ran some tests to make sure things work properly.
    • ../run/john -test=0
    • also do a file ../run/john.exe Make sure it looks like this. This shows it is a 'proper' x86-64 build.
    • ../run/john.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
  • Setup perl (easiest thing is using pass_gen.pl). Simply go into the run directory (cd ../run if you are still in src).
    • Easy way to 'test' : ./pass_gen.pl –tstall
    • There will usually be errors about missing items. Start a new cygwin64 window (so you can keep running ./pass_gen.pl, until all modules are loaded).
    • In the new terminal, type cpan [enter] Then enter again, to allow cpan to configure automatically. NOTE, on cyg64, I am getting a can not write to perl lib directories. I just said to install libs 'manual', and things worked out fine. NOTE, use 'manual'. Trying to to local::lib will fail miserably, and sudo is not available on cygwin. This problem mostly happens on 64 bit Win Vista or newer OS's, where there are some directory permission issues that confuse cpan.
    • The CPAN issue has been resolved. It takes 2 things. #1 Start a clean cygwin bash shell with Administration rights. Right click on shortcut and click 'Run as Administrator' #2 use the Install libs 'manual'. With those 2 changes, it is 'similar' to running sudo on a real Unix environment.
    • It looks like the perl in Cygwin64 at this time is pretty old (even MakeMaker is out of date to even START cpan for the first time.) Give it time, it will start and build what it needs to minimally run.
    • After cpan starts, these modules need to be installed (from within cpan):
      • install CPAN (Note, I have even had to do force install CPAN::Meta::Requirements depending upon how things were installed).
      • reload cpan
      • Install these 5 packages: Digest::SHA Digest::MD4 Digest::MD5 Digest::Tiger Digest::GOST
      • Force install this one: Digest::Haval256
      • Install these 6 packages: Crypt::Blowfish Crypt::DES Crypt::RC4 Crypt::Digest Crypt::ECB Crypt::CBC
      • Install these 3 packages: String::CRC32 Math::BigInt Authen::Passphrase MIME::Base64
      • Install this package: Crypt::PBKDF2 (This is big and ugly, it installs moose)
      • Other good packages: Encode Env ExtUtils::CBuilder ExtUtils::ParseXS File::Spec::Cygwin Getopt::Long Math::BigInt XSLoader
    • This should be the majority of packages needed to run pass_gen.pl The only one I had problem with was Digest::Haval256.
    • When these packages are installed, ./pass_gen.pl -tstall should work and show things are 'done'.

ENJOY.

john/tutorials/win64-howto-build.txt · Last modified: 2015/05/24 07:09 by solar
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate to DokuWiki Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki Powered by OpenVZ Powered by Openwall GNU/*/Linux