Home » Featured, Headline

How to compile xHydra (Hydra GUI) on windows

4 April 2014 77 Comments

Hello Internet.

Skip intro

I received several comments saying that i am distributing Malware because some antivirus engines are detecting hydra/pw-inspector as Hacktool.Hydra and that’s not a false positive it is a hack tool, i never did or will harm anyone.. and i even got a take down notice (the exe for some reason was detected by them as PHP) but my provider heard my side of the story and no further actions were taken.

For that and because i will be compiling the newer versions just occasionally but not very often so i thought of teaching you how to compile it yourself instead of downloading the binaries from me or anyone else.


First download and install Cygwin

Don’t do a default install, You have to install packages that Hydra depends on.
Here is the list of the dependencies

make
idn-devel
libncurses-devel
libpcre-devel
libpq-devel
libapr1-devel
libaprutil1-devel
mysqlclient-devel
libssh2-devel
pkg-config
libgtk2.0-devel
libgtk2.0_0
binutil
xorg-server
xinit
gnutls-devel
libgnutls28

Copy paste the names one by one into the search box

Click the “skip” to make it install that package

That would be enough for a basic install of hydra but you should add SSL and SSH support and here is how.

Download the Light version of OpenSSL and install it somewhere then copy libeay32.dll to C:\Cygwin\bin

And download libssh to be able to support SSH.

Install it into the C:\Cygwin\ folder, or install it somewhere else and copy the bin, include, lib folders to C:\Cygwin\

Go to C:\cygwin\usr\i686-pc-mingw32\sys-root\mingw\bin and copy libgcc_s_dw2-1.dll and libz-1.dll to C:\Cygwin\bin – And rename libz-1.dll to libz.dll

And that’s it we are ready to compile it!

Download Hydra http://www.thc.org/releases/hydra-7.6.tar.gz to C:\cygwin\home\%username%

Launch the Cygwin Terminal then unpack the archive: tar xf hydra-7.6.tar.gz
Enter the folder: cd hydra-7.6
Configure it: ./configure
Make it happen!: make && make install

Finally to make it run. Copy hydra.exe, pw-inspector, xhyrda.exe to C:\Cygwin
And instead of having to manually run Cygwin-X manually each time you have to run xHydra i made this startup file save it as launch.bat and put it in C:\Cygwin too

@@echo off
setlocal
SET PATH=%PATH%;bin
SET DISPLAY=:0
C:\cygwin\bin\run.exe /usr/bin/bash.exe -l -c /usr/bin/startxwin.exe
echo Press any key to launch Hydra
@@pause
xhydra.exe

It adds the bin folder (containing the dll files it needs) to the path environment variable.
Prepares DISPLAY to make it connect to Cygwin-X.
Runs Cygwin-X server.
Then launch xHydra.

And viola!! Hydra as GUI


Enjoy!

And if you have any questions or problems comment or reach me at twitter (@0xAli)

77 Comments »

  • Alon said:

    Trying to compile xhydra now (hydra gtk gui) – dont worry if this fails, this is really optional …
    Error: could not compile. Analyse this:
    /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lintl
    /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lintl
    collect2: error: ld returned 1 exit status
    make[3]: *** [xhydra] Error 1
    make[2]: *** [all-recursive] Error 1
    make[1]: *** [all-recursive-am] Error 2

    Do not worry, as I said, xhydra is really optional. ./hydra is ready to go!

    Now type make install
    cd hydra-gtk && sh ./make_xhydra.sh
    Trying to compile xhydra now (hydra gtk gui) – dont worry if this fails, this is really optional …
    Error: could not compile. Analyse this:
    /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lintl
    /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lintl
    collect2: error: ld returned 1 exit status
    make[3]: *** [xhydra] Error 1
    make[2]: *** [all-recursive] Error 1
    make[1]: *** [all-recursive-am] Error 2

    Do not worry, as I said, xhydra is really optional. ./hydra is ready to go!

  • Accelerator said:

    Could you please compile the Hydra 8.0 for us ? I have tried to compile it by myself, but there’re too many errors,I have to give up.

  • Javier said:

    Hi 0xAli,

    Please compile the Hydra 8.0 version like you did for the windows 7 version.
    Much appreciated, you are the best !

    Kind regards,
    Javier

  • K80theSHADE said:

    Win32OpenSSl_Light-1_0_1f.exe can now be found here:
    http://code.x2go.org/releases/binary-win32/3rd-party/Win32OpenSSL/
    The old link is 404…

  • 0xAli (author) said:

    Can’t find a light version there. Anyway thanks for saying so, i updated the link.

  • DCG said:

    Hi!You forgot to mention the Mingw package..i.e we have to download this package as well for this path to exist- “C:\cygwin\usr\i686-pc-mingw32\sys-root\mingw\bin”..else we don’t have the sys-root directory..Thanks very much..

  • DCG said:

    Well!You mentioned binutil..
    Buh it doesn’t show the sys-root directory..itz missing!!!

  • buzz said:

    http://i.imgur.com/Y18ZCqx.jpg

    hour of installing. fucking excellent.

    0xAli, sweetheart, upload the gui somewhere will you

  • 0xAli (author) said:

    The dependencies are too much, it will be ugly… trust me i thought about it and tried it.

  • matthew said:

    was working fine but now i get this:

    (xhydra:64836): Gtk-WARNING **: cannot open display: :0

    Help please

  • 0xAli (author) said:

    You have to run launch.bat each time you want it to run.

  • fudztown said:

    Hello 0xAli,

    I’ve followed this tutorial to the letter and I’ve tried this on the stand along hydra and on the xHydra examples.
    When I come to run the hydra command i get the following:

    Hydra (http://www.thc.org/thc-hydra) starting at 2014-09-15 13:00:14
    [ERROR] Compiled without LIBSSH v0.4.x support, module is not available!

    I struggle on this section here:
    “Go to C:\cygwin\usr\i686-pc-mingw32\sys-root\mingw\bin and copy libgcc_s_dw2-1.dll and libz-1.dll to C:\Cygwin\bin – And rename libz-1.dll to libz.dll”

    As I only seem to have a “bin” and “lib” directory in my:
    “C:\cygwin64\usr\i686-pc-mingw32”

    I am using Cygwin64 on a windows 7 64bit OS, which may be the issue? Can you confirm this?

  • fudztown said:

    OK… I’ve overcome the issue with “Go to C:\cygwin\usr\i686-pc-mingw32\sys-root\mingw\bin and copy libgcc_s_dw2-1.dll and libz-1.dll to C:\Cygwin\bin – And rename libz-1.dll to libz.dll”

    I installed more of the mingw libs on the cygwin installer.

    I’ve also downloaded and installed the 32bit version and it’s still giving me the same error

    Any ideas?

  • 0xAli (author) said:

    I have no idea, but i will try later to compile the newer version and see if i can do it statically.

  • Enri said:

    hi 0xAli, thx for this post, it was really useful for me.
    I made all steps and succeded in compiling and installing hydra and xhydra with cygwin, i created launch.bat and it makes hydra run correctly, but i have a problem when i try to insert the password list: as soon as i click the white box of the password list xhydra shuts down and the cmd.exe does the same, only the cygwin xserver does not shut down.
    What is the problem? do i have to save the password list in a particoular folder??
    Hope u can help me and thanks again for the guide!

  • 0xAli (author) said:

    It shouldn’t do that, so i don’t know really. If you can find more errors it would be helpful.

  • Enri said:

    I solved the problem…I enter the “password list” box with the TAB botton and then everything’s ok. Anyway i still don’t understand why mouse click makes the program shut down

  • Enri said:

    Hi again, as i said i solved the problem with the “tab” botton and not using the mouse click in the password list box…
    But i have another problem, i don’t know if u can help me. I am playing a little bit with xhydra ( the GUI version to be clear) and i have good results with one of my gmail accounts ( hydra gives me the password that i put in a 25 words list ) but with my other mail account hydra can’t give me the password even if it is in the list ( that is always composed of 25 words ) it says some thing like “[STATUS] attack finished on smtp.gmail.com ecc. 0 password found” .
    I also noticed that when hydra finds out the password there is a difference in on of the last lines of the output, in fact there is a line that is almost like this “[465][smtp] ecc. 1 valid password found”
    It is very strange cause the settings are the same for both cases and the accounts are both gmail…the only thing i thought is that maybe i should change the “http/https url” in the specific tab , so to change the default /foo/bar/…ecc.html
    Hope u can help me, and sorry if the comment is too long
    bye

  • Jasper said:

    Hi!

    I have done every step as you say (except for installing ssh and ssl because I didn’t need them).

    But I get this error:

    $ make
    gcc -I. -O3 -o pw-inspector pw-inspector-logo.o pw-inspector.c
    make: gcc: command not found
    Makefile:62: recipe for target ‘pw-inspector’ has failed
    make: [pw-inspector] error 127 (ignored)
    gcc -I. -O3 -c hydra-vnc.c -DLIBOPENSSL -DLIBNCURSES -DLIBIDN -DHAVE_PR29_H -DHAVE_PCRE -DLIBMYSQLCLIENT -DNO_RINDEX -DNO_RSA_LEGACY -DHAVE_MATH_H -I/usr/include/mysql
    make: gcc: command not found
    Makefile:65: recipe for target ‘hydra-vnc.o’ has failed
    make: *** [hydra-vnc.o] error 127

    I have translated this from my native language so if something differs from the real error, I tried my best 😛

  • 0xAli (author) said:

    Install the gcc library first.

  • Joe said:

    What files in the gcc library needs to be installed? I got the same thing as Jasper.

  • VP said:

    You also need to check the following packages in cygwin:
    mingw-gcc-core
    mingw-zlib1

  • nino said:

    Bonjour
    Mon problème tous c’est bien passer et quand je lance xhydra.exe erreur manque
    cygatk 1.0 0 dll : hydra erreur manque cygssp-0.dll
    merci pour votre aide

  • nino said:

    Hello
    My problem all it is good to pass and when I throw(launch) xhydra.exe error misses cygatk 1.0 0 dll: hydra error is lacking cygssp-0.dll thank you for your help(assistant)
    Sadden for my English

  • noob said:

    i got the following error everytime i want to run it:

    : Gtk-WARNING **: cannot open display: :0

    any idea?
    tnx!

  • 0xAli (author) said:

    There is a problem with startxwin (Your X)

  • Assman said:

    It says that I am missing cygatk-1.0-0.dll
    “The program can’t start because cygatk-1.0-0.dll is missing from your computer. Try reinstalling to fix this problem”

    What went wrong here?

  • 0xAli (author) said:

    Locate the missing .dll file (It’s in cygwin’s directory) and put it in the same folder as hydras exe

  • sdfgdsg said:

    NOT ONE single person has compiled this successfully with your instructions.

    Gtk-WARNING **: cannot open display:

  • sdfgdsg said:

    Finally got it to open, only after I manually had to start XWin.exe from C:\cygwin\bin first.

    Your instructions obviously DO NOT WORK.

  • Sophia said:

    Hey OxAli,
    I followed your tutorial step by step, and made it all the way until creating the launch.bat file.

    Whenever I launch the start up file, I get to the screen that says
    “Press any key to launch to Hydra”
    “Press any key to continue…”

    But when I hit a key it comes back with ‘xhydra.exe is not recognized as an internal or external command, operable program or batch file”, and force-closes the cmd terminal..

    Any idea how to fix this? would really appreciate your help.

    thank you very much

  • 0xAli (author) said:

    You should locate the xhydra file and put the absolute path instead of xhydra.exe in the start file.

  • Alx said:

    Hi 0xAli,

    Trying to execute this what I have:

    USER@USER-PC /cygdrive/c/cygwin/hydra-8.1
    $ hydra.exe
    36214169 [main] -bash 6044 fork: child -1 – forked process 2508 died unexpectedly, retry 0, exit code 0xC0000135, errno 11
    -bash: fork: retry: No child processes
    37211780 [main] -bash 6044 fork: child -1 – forked process 6040 died unexpectedly, retry 0, exit code 0xC0000135, errno 11
    -bash: fork: retry: No child processes
    39211193 [main] -bash 6044 fork: child -1 – forked process 2552 died unexpectedly, retry 0, exit code 0xC0000135, errno 11
    -bash: fork: retry: No child processes
    43218904 [main] -bash 6044 fork: child -1 – forked process 5872 died unexpectedly, retry 0, exit code 0xC0000135, errno 11
    -bash: fork: retry: No child processes
    51222506 [main] -bash 6044 fork: child -1 – forked process 6124 died unexpectedly, retry 0, exit code 0xC0000135, errno 11
    -bash: fork: Resource temporarily unavailable

    Any help?

  • 0xAli (author) said:

    No idea, any logs?

  • Levi said:

    Hi I followed your directions for installing Hydra, and everything installed just fine. But when I try to launch it using the code you put in launch.bat it says it cannot find the specified path. Is it a problem that I have it installed on my F:\ drive?

  • Levi said:

    Never mind I found the issue, I think but it still isn’t launching. The error message however is gone. So I suppose that I have a new question on why that may be.

  • semenelin said:

    i follow the tut i get the error:

    (xhydra:1308): Gtk-WARNING **: cannot open display: :0

    what is wrong please help

  • sarah said:

    I’ve followed the instructions but I didn’t have any luck at all to get this to launch. Any chance you can compile this and post it?

  • 0xAli (author) said:

    I will do that whenever i get free time, although a lot of people bugged me when i posted the hydra (without GUI) saying it’s a virus (And anti-viruses call it: Hack.tool) and i got a take down notice from my host.

  • Miguel said:

    Hello friend, Thanks for the tutorial,
    friend, I finally managed to run the hydra windows thanks to you, but I have a problem though put the correct password, the hydra shows as if he had not found

    because that happens

  • 0xAli (author) said:

    I have no idea why that happens.

  • pitromattio said:

    The website for libssh is 404. Anywhere else i can download it??

  • 0xAli (author) said:

    Just checked it, it’s working.

  • Thiago said:

    Hey man, I did all the steps correctly, but an error arose (0xc000007b). Can you help me? Thanks!

  • ralf said:

    i compile it but it dose not run.and i download your v7.5 from github.and test it.it run but in rdp brute give me no result with currect user and pass.

  • Anthony said:

    Yeah, also got all the way up to the launch batch file and nothing happens upon pressing any key. If I use the absolute path for xhydra.exe, I get the missing dll, as has been mentioned, but if I locate it and copy it to the root cygwin folder, I just get more and more missing dll’s.

  • Anonymous said:

    Change the .bat file to this:
    @@echo off
    setlocal
    SET PATH=%PATH%;bin

    C:\cygwin\bin\run.exe –quote /usr/bin/bash.exe -l -c “cd; /usr/bin/startxwin”

    Run it, another window will pop up. Enter;
    xhydra

    OR
    Search for recently installed programs (Start->Programs->Cygwin-X) and open XWin Server.

  • Anthony said:

    My bad – I’d inadvertently ignored the part about creating the batch file in C:\Cygwin (I chose to put it on my desktop, rather than just making a shortcut -_- ). Once I actually went back and double checked the batch code, I realised that step was probably integral to “SET PATH=%PATH%;bin”.

    Firing on all four now. Thanks for the guide!

  • Dafire said:

    is there a reason you’re using v7.6 and not v8.1?

  • 0xAli (author) said:

    No, it was the newest version back then.

  • commando said:

    how to fix this error? plz help 🙁

    Starting hydra auto configuration …

    Checking for openssl (libssl, libcrypto, ssl.h, sha.h) …
    … found
    Checking for idn (libidn.so) …
    … found
    Checking for curses (libcurses.so / term.h) …
    … found, color output enabled
    Checking for pcre (libpcre.so, pcre.h) …
    … found
    Checking for Postgres (libpq.so, libpq-fe.h) …
    … DISABLED – postgres is buggy in Cygwin at the moment
    Checking for SVN (libsvn_client-1 libapr-1.so libaprutil-1.so) …
    … NOT found, module svn disabled
    Checking for firebird (libfbclient.so) …
    … NOT found, module firebird disabled
    Checking for MYSQL client (libmysqlclient.so, math.h) …
    … found
    Checking for AFP (libafpclient.so) …
    … NOT found, module Apple Filing Protocol disabled – Apple sucks anyway
    Checking for NCP (libncp.so / nwcalls.h) …
    … NOT found, module NCP disabled
    Checking for SAP/R3 (librfc/saprfc.h) …
    … NOT found, module sapr3 disabled
    Get it from http://www.sap.com/solutions/netweaver/linux/eval/index.asp
    Checking for libssh (libssh/libssh.h) …
    … NOT found, module ssh disabled
    Get it from http://www.libssh.org
    Checking for Oracle (libocci.so libclntsh.so / oci.h and libaio.so) …
    … NOT found, module Oracle disabled
    Get basic and sdk package from http://www.oracle.com/technetwork/database/features/instant-client/index.html
    Checking for GUI req’s (pkg-config, gtk+-2.0) …
    … found
    Checking for Android specialities …
    … rindex() not found
    … RSA_generate_key() not found

    Hydra will be installed into …/bin of: /usr/local
    (change this by running ./configure –prefix=path)

    Writing Makefile.in …

    Cygwin detected, if compilation fails just update your installation.

    Windres found, will attach icons to hydra cygwin executables
    /bin/sh: gcc: command not found
    windres: preprocessing failed.
    /bin/sh: gcc: command not found
    windres: preprocessing failed.

    now type “make”

    CommandoMRQJunior@MRQ ~/hydra-7.6
    $ make
    -bash: make: command not found

  • 0xAli (author) said:

    Install the make package from cygwin.

  • Jidan said:

    I accidentally pressed all instead of customizing which package to download,
    Is there any problem if i do this?
    And could there be any video tutorial of this?

  • 0xAli (author) said:

    No problem but it will take a lot of resources (internet/space).

    AFAIK there is no video tutorial.

  • ian said:

    hey a lil help please
    I follow all steps my problem is when i try to run xhydra or hydra both insta shut down

  • cyberfive said:

    where to get download cygatk-1.0-0.dll file missing i can search on google

  • 0xAli (author) said:

    Did you search your cygwin directory properly?

  • valdez said:

    Alban@Valdez ~
    $ xhydra.exe

    (xhydra:6048): Gtk-WARNING **: cannot open display:

    Alban@Valdez ~
    $ xhydra.exe

    (xhydra:2348): Gtk-WARNING **: cannot open display:

    Alban@Valdez ~
    $ xhydra.exe

    (xhydra:6936): Gtk-WARNING **: cannot open display:

    So That’s each time i try xhydra.exe. please how could i fixe This problem and open xhydra?

  • Jiri said:

    When I run launch.bat -> Cygwin/X:0.0 popup -> Press any key to launch Hydra -> Pango-WARNING **:failed to choose a font, expect ugly output. engine-type=’PangoRenderFc’, script=’common’ AND ,script=’latin’

    In Cygwin/X:0.0 text as rectangle boxes.

    Any ideas?

    Thank you

    PS>
    I have to replace
    C:\cygwin\bin\run.exe /usr/bin/bash.exe -l -c /usr/bin/startxwin.exe
    with
    C:\cygwin\bin\run.exe /bin/bash.exe -l -c /bin/xwin.exe
    to run Cygwin/X

    After search> startxwin.exe went to script only, becauce retired

  • Jiri said:

    More info to starting Cygxwin/X
    http://x.cygwin.com/docs/ug/using.html

  • pikachu23 said:

    hey, I downloaded cygwin and hydra8.1. however, i couldnt find hydra.exe in it(extracted).

  • 0xAli (author) said:

    My hydra.exe is on github https://github.com/0xAli/THC-Hydra/releases
    THC doesn’t supply binaries for windows, that’s why i do it.

  • Hello said:

    Hi 0xAli

    ur post helped my a lot and Ive done the progress by following ur instructions but when I open the gui application the hydra gui appears with a Square fonts
    can u tell me how to fix this??

  • sagar said:

    error:library requirements (gtk+-2.0 >=2.0.0) not met
    makefile:59: recipe for target ‘xhydra’ failed
    make: [xhydra] Error 1 (ignored)

    plz help to solve it….

  • 0xAli (author) said:

    You have to download that package from the cygwin downloader

  • Roman said:

    Hi, guys.
    Can anybody give me compiled hydra for windows, please.

  • Tehseen said:

    Hey can u plz [post screenshots of written words while u was starting hydra in gui using cygwin?Where i should put my hydra file to execute it using cygwin?Plz reply quickly

  • Tehseen said:

    HAshmi@HAshmi-PC ~
    $ C:\cygwin\home\
    > cd hydra-7.0
    -bash: C:cygwinhomecd: command not found

    HAshmi@HAshmi-PC ~
    $

    Here it happens in the begning

  • jaypee said:

    where to find the exe file

  • Jack said:

    When i type MAKE this happens:

    gcc -I. -O3 -o pw-inspector pw-inspector-logo.o pw-inspector.c
    make: gcc: Command not found
    Makefile:62: recipe for target ‘pw-inspector’ failed
    make: [pw-inspector] Error 127 (ignored)
    gcc -I. -O3 -c hydra-vnc.c -DLIBOPENSSL -DLIBNCURSES -DLIBIDN -DHAVE_PR29_H -DHAVE_PCRE -DLIBMYSQLCLIENT -DNO_RINDEX -DNO_RSA_LEGACY -DHAVE_MATH_H -I/usr/include/mysql
    make: gcc: Command not found
    Makefile:65: recipe for target ‘hydra-vnc.o’ failed
    make: *** [hydra-vnc.o] Error 127

  • Craig said:

    Hi 0xAli Let me explain i am a Noob but i am really enjoying learning all this stuff but i have been stuck on this for 3 days now and i am at complete stand still, I have basicly got to

    “Finally to make it run. Copy hydra.exe, pw-inspector, xhyrda.exe to C:\Cygwin
    And instead of having to manually run Cygwin-X manually each time you have to run xHydra i made this startup file save it as launch.bat and put it in C:\Cygwin too”

    My problem is when i go into the unpacked Hydra files i cant find the hydra.exe file to copy i found the pw-inspector and xhyrda file but no Hydra.exe i have downloaded about 6 different hydras and still joy. Please someone help me i will have no hair left soon and i cant sleep as i know it will be something stupid im missing. Thanks alot

  • sohail said:

    some one compile and place on ftp server

  • noname said:

    Thank you very much!!!

  • Demon said:

    Hi 0xAli
    Everytime i open launch.bat it shows-
    “The system cannot find the path specified.
    Press any key to launch Hydra
    Press any key to continue . . .”
    Any suggestions??
    Thanks a lot

  • Jonathan said:

    Hi, i need DESPARATE HELP! i followed everything on this article to the T!

    I noticed that the libgcc_s_dw2-1.dll and libz-1.dll, are nowhere to be found in the c:\cygwin directory!! and i did download all the packages you said needed to be downloaded including the Mingw one!

    please help as i was able to install hydra but when i go to launch your launch.bat file i get “(xhydra:6944): Gtk-WARNING **: cannot open display: :0”

    PLEASE HELP!

  • Jonathan said:

    I am running windows 7 64bit by the way. is this the reason why?

Your opinion matters!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.