Thursday, June 9, 2011

How to Setup WORKING THCHydra and Cygwin Environment on Windows 7

UPDATED: Now includes video for getting XHYDRA working on Backtrack 5 at the bottom!

Today I will show you how to setup the parallel threaded multi-protocol cracker known as THCHydra to work under a Windows 7 environment. In order to pull this off properly we will need to setup a Cygwin environment on our Windows machine, as there is NO supported .EXE file for Windows to make this magically work (probably a virus if you find one or it is very outdated). Cygwin is like a Linux emulator for Windows, in that it creates a Linux API environment within your windows environment to provide a lot of Linux API functionality (not 100% but close). This is done through the cywin1.dll which allows you to run many programs not originally designed for Windows (i.e. Linux programs like THChydra). The catch is that you can't just run any Linux program you want; you have to build or compile everything you will want to use from source to get it to work in Cygwin environment properly (and even then it is not guaranteed it will work if it was never designed for Windows/Cygwin). OK with that out of the way, we can begin...
What you need:
·        Latest version of Cygwin, available here:
·        Latest source for THCHydra (currently v6.3), available here:
o   NOTE: If you are using Linux or already have Cygwin installed and just want intro to THCHydra and how to compile properly just skip the Cygwin steps and move straight to the bottom where we focus on THChydra.

|       Steps to Install Cygwin and create environment:      |
You need to start by downloading the Setup.EXE file from the main site listed above. Just double click on this when you are ready to get started. This will open the initial setup for Cygwin environment, which by default only includes the basic items needed. You can search through them and choose the ones you want/need or choose simply to include everything if you have the space and want to avoid having to troubleshoot missing items later. For example, if for example you wanted to also compile C++ programs you would need to make sure you included the  gcc-g++ package and some kind of text editor like Vi or Nano. When running setup.exe, clicking on categories and packages in the package installation screen will provide you with the ability to control what is installed or updated. Another option is to install everything by clicking on the Default field next to the All category. If you have low bandwidth this could take some time as it downloads most of the packages from Internet (like SVN), so go have lunch and a beer, smoke or whatever your fancy and come back in a bit. This is what the process should look like for you upon opening the first time through completion with Desktop shortcut created:

**NOTE**: You can choose to only install the basics and add what you want in later, but to keep things easy and avoid having to trouble shoot to many issues I suggest just pick "ALL". Today's HDDs are getting larger and cheaper so I doubt many will have any issues due to space if you select ALL (mine was 8.29Gb total disk space once completely installed with all packages). If you want to go more advanced and select only what you need feel free, be aware that to use the GUI for THChydra, known as XHYDRA, you will need to ensure you also chose to install the proper Cygwin/X requirements as well as the basics since it relies on x-Server and Cygwin/X consists of X server, X libraries, and nearly all of the standard X clients.
When you are done Setup.EXE saves everything and creates a shortcut on your desktop as well as in the start menu. You can then use the Setup.EXE file any time you want to update or install a new Cygwin package, as once you have gone through the initial install choices it will remember your final configuration options so anytime you run it again it will open and allow you to choose to update your system by selecting additional packages.

Installed and working console should look like this; just double click your shortcut on desktop:
Now you can test it out by issuing a few commands that you wouldn’t normally have use to in Windows that are common Linux commands. Here is a quick view of: "pwd", "cd /", "ls", "ps":
**NOTE: If you are trying to find your main Windows OS drive you need to navigate to it through the "cygwindrive" located in the root folder of Cygwin environment. Here is a quick example:
               EXAMPLE: cd /cygdrive/<drive letter>/Users/<username>/path/location

For me I use the following to get to my main OS desktop area:
COMMAND: cd /cygdrive/c/Users/SkyWalker/Desktop

Now to copy the downloaded hydra tar file from our main OS desktop to our Cygwin desktop use this:
               Example: cp hydra-6.3-src.tar.gz /home/<cygwin-username>
               Mine: cp hydra-6.3-src.tar.gz /home/SkyWalker
                              Then: cd /home/SkyWalker
                              Then: ls (to confirm it was copied to where we wanted it)

This ends our brief overview and review for installing Cygwin, please spend time on the homesite and reading the user guide to figure out all the ins and outs of it. If for some reason you decide you want to remove one of the installed Cygwin packages you will simply need to re-run the Setup.EXE file. Once it is open you simply navigate the list of packages that are already installed, and choose the category you want to edit (or click on the View button). Click on the options until it changes to Uninstall and then choose next to finalize the removal of the desired package (just click till you get there, it goes: Default>Install>ReInstall>UnInstall).

If you want to remove it entirely from your system simply stop all services from running and delete all files, folders and subdirectories as well as any Desktop shortcuts from your machine and from the Setup.EXE install folder and it will be gone.

|          Steps to Compile THCHydra, once Cygwin is operational       |
I have showed you above how you can move the THCHydra tar file from where ever you downloaded it so we can start working with it. Now navigate their using your Cygwin terminal, and we will begin by extracting the contents of the download using the following command:
               COMMAND: tar -zxvf hydra-6.3-src.tar.gz
NOTE: you can add "-C /desired/path/location" to the end of the command to extract it to another location other than where you currently are located
OK, now that it is extracted you will have a new folder called hydra-6.3-src and inside you will find the contents of what was extracted, but we still need to compile it in order to get it working (you can delete the original tar file when we are done extracting). In order to compile the program you will need to use the following commands from the terminal:
               COMMAND:  cd hydra-6.3-src/
               COMMAND:  ./configure
               COMMAND:  make
               COMMAND:  make install (THIS IS ERROR PRONE ON CYGWIN)
NOTE: The last one for make install is not required but allows it to install to the local path environment to avoid always having to navigate to the install folder to use/run. This is mainly for my Linux users as it doesn’t properly work in Cygwin environment due to the default paths being different and errors can be ignored. You can edit this if needed to try and get it working, or simply navigate to the hydra folder before running it each time. If you want to add SSH you need to setup libssh on your machine as well (available at:, and you will also need to add the "-DWITH_SSH1=On" argument to the first make command (i.e. ./configure>make -DWITH_SSH1=On>make install). The default make will also setup the necessary requirements for Xhydra if you have all of the dependencies needed, however I should mention that it is not functional in Cygwin environment due to issues with the GTK+ front end and Cygwin X Server. I previous had XHYDRA working but now seems to fail due to multiple errors but I am not a real programmer and don’t quite have the time to troubleshoot it. If you know anyone that is good with GTK programs then you might be able to fix the errors when it runs under Cygwin/X (just start X Server and then X-terminal and then run ./xhydra at command line in X-terminal to start the GUI. It will appear to be fine until you hit start to run it), until then XHYDRA only works in a 100% real Linux environment.

Now let us confirm we did not waste our time for nothing, check successful installation by issuing the following command to bring up the help menu and see all of the available options:
               COMMAND: ./hydra -h

I will not go into great detail as the user guide is chalked full of details and there are already a lot of other tutorials on the net the cover how to use it, but not a lot on how to get it working on Windows (which is why I wrote this article). In order to get you started I will show you a quick example of cracking password on a basic home router user/pass for my network with Hydra (I am using a spare Netgear home router for this test), it goes a little something like this...

COMMAND: hydra -l admin -P /path/to/wordlist/passwords.txt -e ns -t 15 -f -s -vV http-get -m /

Here is how it breaks down:
·        the "-l" defins the username to use for all attempts
·        the "-P" defines password to use or the path to use for wordlist to read passwords while attacking
·        the "-e ns" instructs Hydra to attempt check for valid NULL connection (meaning blank or no password used)
·        the "-t x" defines the thread count to be used, or how many tasks at once (where x = a number)
·        the "-f" instructs Hydra to exit upon finding the first set of valid credentials or user/pass combo
·        the "-s" instruct Hydra to use SSL for connection
·        the "-vV" simply puts Hydra into verbose mode so you see what is going on while it is running
·        "" is being used as the IP address we are targeting (simply change to fit your need)
·        the "http-get"  defines the method or protocol to use for attacking (see below for full list of protocols)
·        the "-m /" is defining where to target the attacks at, or the page to try and crack

You can see above it found the password (P@ssword1) for the username admin. You can search the user guide or Google if you need further explanations on how to use it or how to target other protocols, but that should atleast give you enough to get started. I must also note some important pieces of information that you should be aware of when cracking over the network with Hydra. First, if the password is not in your dictionary you will never find it (Period - the end!). Secondly, there are going to be some basic limitations that will impact your time, for example the maximum number of attempts possible per connection, protocol being attacked/used, bandwidth, size of word list and CPU power. These factors can all impact overall time it takes to exhasut all possibilities. The "-t" argument referenced aboved can be used to change the parallel thread count being used to help speed things up, but dont set it too high or will have the reverse affect.  Here are some common max limits for attempts per connection, from the tools creators: telnet=4, ftp=6, pop3=1, amd imap=3, and here is the list of all supported protocols (as of the writing of this tutorial) so have fun cracking as the possibilities are limited only by your imagination:
               AFP, Cisco AAA, Cisco auth, Cisco enable, CVS, Firebird, FTP, HTTP-FORM-GET, 
              SSH(v1 and v2), Subversion, Teamspeak (TS2), TELNET, VMware-Auth, VNC and XMPP.
A key tip to helping stay secure is to always use a VPN connection when testing to help hide your IP, but Proxies are also a great thing to use. If you need a list of up to date working proxies please see my page dedicated to this here: Once you have identified the proxy you will be using you can incorporate it into THCHydra when testing.
If you are using the http/www service for cracking then you need to use the following argument in your command you are using:

               COMMAND: ./hydra -m /dir/ -l dumbuser -P /path/to/your/passlist http -HYDRA_PROXY_HTTP=""
If you are using any other service for cracking then you will need to use this format instead (very similar but notice the end of the argument changes from HTTP to CONNECT):

               COMMAND: ./hydra -m LH -l dumbuseradmin -P sam.dump smbnt -HYDRA_PROXY_CONNECT=""

If you need to enter credentials to use your proxy then you would add this to the end of either option:
               COMMAND: HYDRA_PROXY_AUTH="user:pass"
                              COMMAND: ./hydra -m LH -l dumbuseradmin -P sam.dump smbnt -HYDRA_PROXY_CONNECT="" -HYDRA_PROXY_AUTH="user:pass"

A strong word list is also very helpful when it comes to cracking, so try to keep manageable word lists or use tools to help create narrowed down word lists for better, or more targeted, results. THCHydra comes with the PW-INSPECTOR tool which can be used to trim a wordlist down based on password policy or known details. I like to use the word list tools provided by the Hashcat team as well as a tool called Shmoosh2x64.exe. The Hashcat team has a set of tools to help with expanding, sorting, and splitting wordlists and the shmoosh tool helps to combine multiple wordlists while also sorting out duplicates so you get a new wordlist that is full of unique words. I suggest playing with them all as they can all come in handy in various occasions, and all have been documented on their respective sites if you need help with the proper command syntax to use (Google is your friend). If you need to find a good wordlist just search around Google as there are many out there, and I also highly suggest tools like CeWL, CUPP (Common User Passwords Profiler), or WyD (Who's Your Daddy Password Profiler) which can be used to spider sites to help create wordlists based on unique words found on the site that you can then turn around and use to performing bruteforce attacks with (as mentioned above start focused if you can and then broaden your search/attempts to increase your effectiveness).

Hopefully this tutorial has showed you how you can get the latest version of THCHydra working under a Windows 7 environment. This should be another great tool to add to your collection and along with my previous post on the Hashcat tools you should be covered now for all of you password cracking needs, both local and remote. I may cover some word list techniques down the road to complete the series and create a triple threat. I also hope this tutorial helps to ignite some creativity in others to think outside the box for what tools are available to them and how they can be used.
Enjoy, and until next time...

UPDATE - Here is a VIDEO of showing how to get XHYDRA working under Backtrack 5:


  1. I use mobaxterm, when I enter the command cp hydra-7.1-src.tar.gz / home / mobaxterm
    cp: can not stat 'hydra-7.1-src.tar.gz': No such file or directory
    how do you think?

    1. "cd /cygdrive/c" is where your C:/ is located

  2. Unfortunately I have never heard about mobaxterm until your post above, seems pretty cool at first glance. I dont know enough about it to give you any real guidance, sorry. You might try using the full paths in your commands to see if it helps or seeing if there is any community support for mobaxterm where you might find a better answer as I am not sure your problem necessarily relates to Hydra itself and may be more environmental details, hope you figure it out though.

    1. nossa muito bom porem nao comsegui vcpodia fazeruma video éé´uma video vc iria ter varios acessos seu sir ia fika conhecido e seria uma video aula unica japrocurei e nao tem cara vc tem uma mina deouro de acessos se alguem consegui faça uma video eposte aki

    2. check YouTube, there are a few videos....

    3. eu procurei mas não achei se puder me envie alguns videos seria até bom para outras pessoas entenderem tambem

  3. =>
    cd /cygdrive//Users//path/location

    I have done the same as what the instructions said but it doesn't work

  4. when I enter "cd /hydra-7.1-src" to compile the program I get the message:
    "-bash: cd: /hydra-7.1-src: No such file or directory"

    I have run the "ls" command and see that "hydra-7.1-src" is on my Cygwin desktop and when I navigate to the Cygwin desktop on my computer I can verify that the directory listing exists with files in it. What am I doing wrong?

    1. I found my answer. (Since I am new to Cygwin I didn't notice there was a typo in the command given in this tutorial. The command should be "cd hydra-7.1-src/" not "cd /hydra-7.1-src".

  5. Yeah, sorry about that. Thanks for calling it out, I will try to update later today...

  6. all works fine but when i come to the point where i need to type "make", i get error and it doesn't work

  7. When i type make
    -bash: make: command not found
    this error is flash


  8. all work fine from start to finish but what's the command for pop3?

    1. should be able to define this with the protocol setting before the target ip. Hydra supports both pop3 and pop3s, but not sure Cygwin install will support this or not. pop3://IP or pop3s://IP to define target...

  9. all works fine but after installation when I do,
    Nishant@Cognizant ~/hydra-7.2-src
    $ hydra -h
    -bash: hydra: command not found
    Why is this happening,Please reply soon.

  10. Did you get errors during the build process? if you list the directory content can you see the compiled version there? ./hydra -h

  11. Thank you for replying,I have figured out the error.Path of the folder was wrong...sorry for asking so minor thing...Now It's ok. I can use hydra now.

  12. This comment has been removed by the author.

  13. Awesome. thank you so much for this. pro-tip, install the make thingy under Devel, if you get the error -bash make doesn't exist or something to that effect. and make sure to copy the file from where ever you have it stored if you get the error 'no such file in directory'. if it's from a file with two name use a back slash. eg. Zombie\ outbreak. thats all the low level issues I had

    1. Thanks for the feedback and added guidance based on your troubles. I'm sure it will save others some time :)

  14. This comment has been removed by the author.

  15. hello, help me pls, i couldnt copy the hydra file to the cygwin. i did it like this.. "cp hydra-6.3-src.tar.gz /home/RealMadrid" but it's give me this error.... -bash: cpcp: command not found... please help what should i do?

  16. hey when i type make it says command not found

  17. I am getting this msg when I am trying to extract files from hydra-7.4.2-src.tar.gz :

    ""tar (child): hydra-5.9.1-src.tar.gz: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now""

    I have installed all the packages of cygwin.
    What should I do?

  18. This comment has been removed by the author.

  19. It is hard to tell without knowing what arguments you pas when running it. For others, I'm sorry but I don't support doing the install this way and neither does HTC and I finally understand why. Please no more questions on this one, it wasn't designed for windows so dont be surprised if your stuck figuring things out as your might very well be the first. Ditch winblows and run it with ease on *nix :)

  20. After long search I found this page with instructions of how to install and compile hydra. When I key in "make" the command is run showing some library and then it fails. I trying uninstalling HYdra and installing all packages but still I get this error.

    I raised my query on stackoverflow but seems no one is interested in helping out there. Could you please help me with this? below is the link to my query with detailed error.

  21. When i type MAKE i get this error, why?

    collect2: ld returnerade avslutningsstatus 1
    Makefile:51: recipe for target `hydra' failed
    make: *** [hydra] Error 1

  22. This comment has been removed by the author.

  23. Everthin was goin fine but at the point where we should type "make", I stuck. Pls help, logs are here under,
    Writing ...

    Cygwin detected, if compilation fails just update your installation.

    Windres found, will attach icons to hydra cygwin executables

    now type "make"

    Administrator@MyPC ~/hydra-6.3-src
    $ make
    -bash: make: command not found

  24. My cousin recommended this blog and she was totally right keep up the fantastic work!

    working environment

  25. when i type in cp hydra-7.5-src.tar.gz /home/bobby
    it says that
    cp: cannot stat'hydra-7.5-src.tar.gz': No such file or directory

    what should i do? :(

  26. This comment has been removed by the author.

  27. $ cp hydra-7.5-src.tar.gz/home/Nebojsa
    cp: missing destination file operand after `hydra-7.5-src.tar.gz/home/Nebo jsa'
    Try `cp --help' for more information.
    ..What to do?

  28. Hey, first off, amazing tutorial! Keep it up :)

    My hydra-7.6-src.tar.gz file is having problems. I cant tar, cd, nothing. However I can tar and cd hydra-7.6.tar.gz. Doing that works fine until I have to use the "make" command. My cygwin is fully operational. If I would like to completely erase and re-install all of hydra 7.6, what file in my cygwin library do I delete? Because I think I may have messed with the format of a make file while attempting to open it. What do you suggest I do?

    Thanks in advance,

  29. $ ./configure

    Starting hydra auto configuration ...

    Checking for openssl (libssl, libcrypto, ssl.h, sha.h) ...
    ... NOT found, SSL support disabled
    Get it from
    Checking for idn ( ...
    ... NOT found, unicode logins and passwords will not be supported
    Checking for curses ( / term.h) ...
    ... NOT found, color output disabled
    Checking for pcre (, pcre.h) ...
    ... NOT found, server response checks will be less reliable
    Checking for Postgres (, libpq-fe.h) ...
    ... DISABLED - postgres is buggy in Cygwin at the moment
    Checking for SVN (libsvn_client-1 ...
    ... NOT found, module svn disabled
    Checking for firebird ( ...
    ... NOT found, module firebird disabled
    Checking for MYSQL client (, math.h) ...
    ... NOT found, module Mysql will not support version > 4.x
    Checking for AFP ( ...
    ... NOT found, module Apple Filing Protocol disabled - Apple sucks anyway
    Checking for NCP ( / nwcalls.h) ...
    ... NOT found, module NCP disabled
    Checking for SAP/R3 (librfc/saprfc.h) ...
    ... NOT found, module sapr3 disabled
    Get it from
    Checking for libssh (libssh/libssh.h) ...
    ... NOT found, module ssh disabled
    Get it from
    Checking for Oracle ( / oci.h and ...
    ... NOT found, module Oracle disabled
    Get basic and sdk package from
    Checking for GUI req's (pkg-config, gtk+-2.0) ...
    ... NOT found, optional anyway
    Checking for Android specialities ...
    ... rindex() not found

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

    Writing ...

    Cygwin detected, if compilation fails just update your installation.

    which: no windres in (/usr/local/bin:/usr/bin:/cygdrive/c/Windows Microsoft SQL strver/80/tools~binn:/usr/bin)
    Windres NOT found, you will not have pretty icon files in the hydra cygwin executables

    now type "make"

    $ make
    -bash: make: command not found

    WHat is the problem?

    1. Same problem here , if you found an answer tell me

    2. you need to install "make" in "DEVEL" package when you install the cygwin

      image URL for help

    3. omg god you are my save your

    4. Ya I had to reinstall it, for some reason.

  30. I'm so confused...I have hydra installed...It doesn't have a passlist, so I downloaded it. If I were to download it onto my desktop, what would be the path (I know stupid question) I saw other pple putting home ? issue...hydra gives us an example of how you would use against an FTP server, but won't show other examples. I have this site with open ports on 21 and 23...I'm able to telnet what do I do? How would I enter the info into Havij...that includes where my admin list, passwords list in and that connects over telnet on ports 21 or 23...I don't even know if this makes sense. I'm so frustrated. I wish people would just make it easier by putting damn examples into their programs. Also it says it can use http, ssl would you write those up? Honestly I've been searching for weeks on how to do this. So much info out there is wrong or a just plain waste of time. I just want to be able to do this already! I'm sick of getting absolutely NO WHERE....please help

  31. if the password is not in your dictionary you will never find it. what password you are referring to? the wifi pass or the router pass?

  32. what does it mean?
    Dave@Dave-PC ~/hydra-6.3-src
    $ hydra -l admin -P /Home/Dave/passwords1.txt -e ns -t 10 -f -s -vV http-get /
    Hydra v6.3 (c) 2011 by van Hauser / THC and David Maciejak - use allowed only for legal purposes.
    Hydra ( starting at 2014-12-25 14:12:23
    Error: File for passwords not found!

  33. How can I run hydra with a proxy? How is the syntax written to add a proxy to the command?

  34. When I type make this is what happens
    $ make
    gcc -I. -Wall -O2 -o pw-inspector pw-inspector.c
    make: gcc: Command not found
    Makefile:61: recipe for target 'pw-inspector' failed
    make: [pw-inspector] Error 127 (ignored)
    gcc -I. -Wall -O2 -c hydra-vnc.c
    make: gcc: Command not found
    Makefile:64: recipe for target 'hydra-vnc.o' failed
    make: *** [hydra-vnc.o] Error 127

  35. I have the same problem when I type make has anyone found the solution?
    Thank you!


    hi, I am doing everything accordingly but when when I enter the command "make" then it prompts "-bash: make: command not found"
    kindly help me to fix this problem.
    thanks in advance