Installing THC-Hydra 5.9 on Ubuntu 10.10 (Maverick Meerkat) with SSL support

UPDATE: 5.9.1 seems to work without the need to manually compile libssh. Simply replace the libssh part below with

sudo apt-get install libssh-dev

Also, grab 5.9.1 using

wget -c http://freeworld.thc.org/releases/hydra-5.9.1-src.tar.gz

Wikipedia describes THC-Hydra as “… software … that uses a dictionary attack to test for weak or simple passwords on one or many remote hosts running a variety of different services.” Its useful for doing quick tests against your servers to make sure that your users are not using simple passwords. In pen tester speak, this is called a brute-force attack.

Here are the steps needed for installing it on the 32-bit version of Ubuntu 10.10 (Maverick Meerkat).

Make sure you have all the necessary development tools (i.e. libraries, compilers, headers) and the source files for GTK:

sudo apt-get install build-essential linux-headers-$(uname -r) libgtk2.0-dev libssl-dev cmake

Before we compile Hydra, we need to install libssh. For some odd reason, hydra does not like the libssh-dev package that comes with Ubuntu.

wget -c http://www.libssh.org/files/0.4/libssh-0.4.6.tar.gz
tar -xvzf libssh-0.4.6.tar.gz
cd libssh-0.4.6
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
make
sudo make install
cd ../..

Download and extract the THC-Hydra tarball

wget -c http://edwincastillo.com/wp-content/uploads/2010/12/hydra-5.9-src.tar.gz
tar -xvzf hydra-5.9-src.tar.gz
cd hydra-5.9-src

Now you are ready to compile:

./configure
make
sudo make install

You are now ready to use Hydra. Type ./hydra -h to get syntax help. The GUI version can be started by running xhydra.

If you have a GMail account with IMAP enabled, you can use the following example to test hydra:

hydra -S -l email@gmail.com -p your_password -V imap.gmail.com imap

I believe that I am only at a beginning, only knocking at a door, and I believe that the best is yet to come. –Pat Buckley

You can leave a response, or trackback from your own site.

28 Responses to “Installing THC-Hydra 5.9 on Ubuntu 10.10 (Maverick Meerkat) with SSL support”

  1. freud says:

    Thanks! Just what I needed! Great job.

  2. john says:

    thanks a lot for the help! this worked perfectly

  3. Hey I m getting some errors on the first step plz help , thought it was my computer problem but on my friends laptop also this occurred

    After I type
    “sudo apt-get install build-essential linux-headers-$(uname -r) libgtk2.0-dev libssl-dev cmake”

    I get the error

    ERROR –
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    cmake is already the newest version.
    linux-headers-2.6.35-22-generic is already the newest version.
    linux-headers-2.6.35-22-generic set to manually installed.
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    libssl-dev : Depends: libssl0.9.8 (= 0.9.8o-1ubuntu4) but 0.9.8o-1ubuntu4.1 is to be installed
    E: Broken packages

    Help….

  4. Dave says:

    Hi I have followed the instructions and am still receiving the same error when running the make command.

    I have installed the libssh as the guide suggests above.

    The out put of the make command is below:

    gcc -I. -Wall -O2 -c hydra-ssh2.c -DLIBOPENSSL -DLIBPOSTGRES -DLIBSSH -I/usr/local/include
    hydra-ssh2.c:9:2: warning: #warning “If compilation of hydra-ssh2 fails, you are not using v0.4.x. Download from http://www.libssh.org
    hydra-ssh2.c:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘session’
    hydra-ssh2.c: In function ‘start_ssh2’:
    hydra-ssh2.c:40: error: ‘session’ undeclared (first use in this function)
    hydra-ssh2.c:40: error: (Each undeclared identifier is reported only once
    hydra-ssh2.c:40: error: for each function it appears in.)
    hydra-ssh2.c:40: warning: implicit declaration of function ‘ssh_new’
    hydra-ssh2.c:41: warning: implicit declaration of function ‘ssh_options_set’
    hydra-ssh2.c:41: error: ‘SSH_OPTIONS_PORT’ undeclared (first use in this function)
    hydra-ssh2.c:42: error: ‘SSH_OPTIONS_HOST’ undeclared (first use in this function)
    hydra-ssh2.c:43: error: ‘SSH_OPTIONS_USER’ undeclared (first use in this function)
    hydra-ssh2.c:44: error: ‘SSH_OPTIONS_COMPRESSION_C_S’ undeclared (first use in this function)
    hydra-ssh2.c:45: error: ‘SSH_OPTIONS_COMPRESSION_S_C’ undeclared (first use in this function)
    hydra-ssh2.c:68: warning: implicit declaration of function ‘ssh_auth_list’
    hydra-ssh2.c:69: error: ‘SSH_AUTH_METHOD_PASSWORD’ undeclared (first use in this function)
    hydra-ssh2.c:71: error: ‘SSH_AUTH_METHOD_INTERACTIVE’ undeclared (first use in this function)
    make: *** [hydra-ssh2.o] Error 1

    Any Ideas?

    Thanks

    Dave

    • Dave says:

      Hi I wanted to add a update. I have re followed the steps above and am still getting the same error.

      I dono if it makes a difference but I am running Kubuntu 64Bit.

      Please help me get this working.

      Thanks,

      Dave

      • Edwin says:

        Hi Dave,

        I downloaded Kubuntu 10.10 64-bit, installed it in VMWare, ran all updates and than followed the instructions above. I did not get any errors. The error shows that there is a syntax error in hydra-ssh2.c. Could it be that the file you downloaded is corrupt? Try downloading the files again from here: http://freeworld.thc.org/releases/hydra-5.9-src.tar.gz

      • Justin says:

        Dave i am getting the exact same error messages. Configure goes well and when i type make i get the same stuff. I have tried hydra-5.4 and hydra5.9 with the same results.

        I am on Maverick 32 bit, fresh install with all updates. After my botched 5.4 install i cleared everything out and started fresh on this page following every step.

        root@home:~/hydra-5.9-src# ./configure

        Starting hydra auto configuration …

        Checking for openssl (libssl/ssl.h) …
        … found
        Checking for Postgres (libpq.so) …
        … found
        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) …
        … NOT found, module Mysql will not support version > 4.x
        Checking for AFP (libafpclient.so) …
        … NOT found, module Apple Filing Protocol disabled
        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) …
        … found
        NOTE: ensure that you have libssh v0.4.x installed!! Get it from http://www.libssh.org !
        Checking for GUI req’s (pkg-config) …
        … found

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

        Writing Makefile.in …
        now type “make”

        root@home:~/hydra-5.9-src# make
        gcc -I. -Wall -O2 -c hydra-ssh2.c -DLIBOPENSSL -DLIBPOSTGRES -DLIBSSH -I/usr/local/include
        hydra-ssh2.c:9: warning: #warning “If compilation of hydra-ssh2 fails, you are not using v0.4.x. Download from http://www.libssh.org
        hydra-ssh2.c:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘session’
        hydra-ssh2.c: In function ‘start_ssh2’:
        hydra-ssh2.c:40: error: ‘session’ undeclared (first use in this function)
        hydra-ssh2.c:40: error: (Each undeclared identifier is reported only once
        hydra-ssh2.c:40: error: for each function it appears in.)
        hydra-ssh2.c:40: warning: implicit declaration of function ‘ssh_new’
        hydra-ssh2.c:41: warning: implicit declaration of function ‘ssh_options_set’
        hydra-ssh2.c:41: error: ‘SSH_OPTIONS_PORT’ undeclared (first use in this function)
        hydra-ssh2.c:42: error: ‘SSH_OPTIONS_HOST’ undeclared (first use in this function)
        hydra-ssh2.c:43: error: ‘SSH_OPTIONS_USER’ undeclared (first use in this function)
        hydra-ssh2.c:44: error: ‘SSH_OPTIONS_COMPRESSION_C_S’ undeclared (first use in this function)
        hydra-ssh2.c:45: error: ‘SSH_OPTIONS_COMPRESSION_S_C’ undeclared (first use in this function)
        hydra-ssh2.c:68: warning: implicit declaration of function ‘ssh_auth_list’
        hydra-ssh2.c:69: error: ‘SSH_AUTH_METHOD_PASSWORD’ undeclared (first use in this function)
        hydra-ssh2.c:71: error: ‘SSH_AUTH_METHOD_INTERACTIVE’ undeclared (first use in this function)
        make: *** [hydra-ssh2.o] Error 1

    • dmaciejak says:

      I believe your libssh is not well setup, that’s maybe why you got all these errors

  5. James says:

    After I ./configure it lists several items not found. I’ve install all but SAP/R3. Are these important?

    Starting hydra auto configuration …

    Checking for openssl (libssl/ssl.h) …
    … found
    Checking for Postgres (libpq.so) …
    … found
    Checking for SVN (libsvn_client-1 libapr-1.so libaprutil-1.so) …
    … found
    Checking for firebird (libfbclient.so) …
    … NOT found, module firebird disabled
    Checking for MYSQL client (libmysqlclient.so) …
    … found
    Checking for AFP (libafpclient.so) …
    … NOT found, module Apple Filing Protocol disabled
    Checking for NCP (libncp.so / nwcalls.h) …
    … found
    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) …
    … found
    NOTE: ensure that you have libssh v0.4.x installed!! Get it from http://www.libssh.org !
    Checking for GUI req’s (pkg-config) …
    … found

    When I use the GUI, on start it says:

    Error: Compiled without LIBAFP support, module not available!

    Where can I find LIBAFP?

  6. Monkey says:

    Thanks for the tutorial, it’s very nicely done. It almost worked for me.

    Any advice on this error during the make?

    hydra-mysql.o: In function `start_mysql’:
    hydra-mysql.c:(.text+0x64d): undefined reference to `hydra_address2string’
    collect2: ld returned 1 exit status
    make: *** [hydra] Error 1

    It’s something with the mysql bit. But I don’t know what to do about it.

  7. Dz says:

    Ubuntu maveric, followed instructions from the post, but I get this error after typing “make”:

    hydra-5.9-src$ make
    gcc -I. -Wall -O2 -lm -o hydra hydra-vnc.o hydra-pcnfs.o hydra-rexec.o hydra-nntp.o hydra-socks5.o hydra-telnet.o hydra-cisco.o hydra-http.o hydra-ftp.o hydra-imap.o hydra-pop3.o hydra-smb.o hydra-icq.o hydra-cisco-enable.o hydra-ldap.o hydra-mysql.o hydra-http-proxy.o hydra-smbnt.o hydra-mssql.o hydra-snmp.o hydra-cvs.o hydra-smtpauth.o hydra-sapr3.o hydra-ssh2.o hydra-teamspeak.o hydra-postgres.o hydra-rsh.o hydra-rlogin.o hydra-oracle-listener.o hydra-svn.o hydra-pcanywhere.o hydra-sip.o hydra-vmauthd.o hydra-smtpauth-ntlm.o hydra-firebird.o hydra-afp.o hydra-ncp.o hydra-http-proxy-auth-ntlm.o hydra-imap-ntlm.o hydra-pop3-ntlm.o hydra-http-form.o crc32.o d3des.o md4.o hydra-mod.o ntlm.o hydra.o -lm -lssl -lpq -lssh -lcrypto -L/usr/lib -L/usr/local/lib -L/lib -L/lib -L/usr/lib
    /usr/bin/ld: cannot find -lpq
    collect2: ld returned 1 exit status
    make: *** [hydra] Error 1

  8. fred_151 says:

    Great! It works! I’m using Ubuntu 10.10 x64

  9. [...] smb, several databases, and much more. Like THC Amap this release is from the fine folks at THC. This guide (for v5.9 worked for me) Notice that I’m not responsible for other peoples [...]

  10. mulo says:

    Connecting to http://www.libssh.org|91.121.49.183|:80… failed: No route to host.

  11. mulo says:

    wget -c http://www.libssh.org/files/0.4/libssh-0.4.6.tar.gz
    when i past this link to my terminal getting error message “Connecting to http://www.libssh.org|91.121.49.183|:80… failed: No route to host” anyone got an idea?

  12. CBrown says:

    Thank u so much man, it was brilliant!

  13. Knightmare says:

    i got it to work in 11.04 the way you have it thanks man :D

  14. hunter says:

    Very nice tutorial, everything worked perfectly.
    Thank you very much!!

  15. edvin says:

    thanks

  16. DeckerXL says:

    Notes for Hydra module dependencies for Ubuntu 10.x:
    ====================================================

    Here are the additional modules you’ll need to build Hydra with support for these:

    ===================================================================
    MySQL:
    ——
    apt-get install libmysqlclient-dev

    ===================================================================
    idn:
    —-
    apt-get install libidn11-dev

    ===================================================================
    pcre:
    —–
    apt-get install libpcre3-dev

    ===================================================================
    postgres:
    ———
    apt-get install postgresql-client libpq-dev

    ===================================================================
    svn:
    —-
    apt-get install libsvn-dev

    ===================================================================
    ncp:
    —-
    apt-get install libncp libncp-dev

    ===================================================================
    firebird:
    ———
    apt-get install libfbclient2 firebird2.0-dev

    ===================================================================
    afp:
    —-
    apt-get install libfuse-dev libgcrypt11 libgcrypt11-dev libgmp3-dev libgmp3c2 libreadline-dev libgmp3c2 libgmpxx4ldbl automake

    Download the appropriate afpfs-ng package from Sourceforge. If running 64-bit Linux, you’ll need to grab the source tarball and compile rather than using the .deb Here is the one I got: afpfs-ng-0.8.1.tar.bz2. If compiling from source, one twist after you do the ./configure, make, make install is that the make install does not copy the C header files (like afp.h) to /usr/include/afpfs-ng/, so I had to manually do a mkdir /usr/include/afpfs-ng and then cp /include/*.h files from the afpfs-ng build directory manaully to /usr/include/afpfs-ng. When you’re done, afp.h and about 8 other header files should be in /user/include/afpfs-ng. Otherwise if you don’t do this, when you do the ./configure for hydra, it will say it’s can’t find the AFP dependencies.

    Also add /usr/local/lib to /etc/ld.so.conf and do another ldconfig. That’s where libafpclient.so was installed by the make install, at least on my system.

    ===================================================================
    oracle:
    ——-
    download the following three Oracle Instant Client rpm’s from Oracle ( http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html ) – you’ll need to register for an OTN online account (free).
    oracle-instantclient11.2-basic-*.rpm
    oracle-instantclient11.2-devel-*.rpm
    oracle-instantclient11.2-sqlplus-*.rpm

    Then you need to convert RPM to DEB format, so do this apt-get:
    apt-get install alien libaio1

    Then run alien to convert and install:
    alien -i oracle-instantclient11.2-basic-*.rpm
    alien -i oracle-instantclient11.2-devel-*.rpm
    alien -i oracle-instantclient11.2-sqlplus-*.rpm

    Add the following to /etc/ld.so.conf (that’s where it put my libs for version 11.2 – substitute your version there)
    /usr/lib/oracle/11.2/client64/lib

    Then do an: ldconfig

    Then when running ./configure for hydra, use the –with-oracle and –with-oracle-lib switches. Here is the one I used.
    ./configure –with-oracle=/usr/include/oracle/11.2/client64 –with-oracle-lib=/usr/lib/oracle/11.2/client64/lib

    Then one final twist before you do the make – you have to edit the Makefile and manaully add the Oracle include dir to the XIPATHS var. Here is mine where I had to manually add to the end:
    XIPATHS= -I/usr/include/subversion-1 -I/usr/include/apr-1.0 -I/usr/include/subversion-1 -I/usr/include/mysql -I/usr/include/afpfs-ng -I/usr/include/oracle/11.2/client64
    (Remember to substitute your include path if different.)

    SAP/R3
    ——
    Only one I didn’t do. I’ll leave that one for someone else to document… :-)

Leave a Reply

Powered by WordPress | Designed by: video games | Thanks to Webdesign Agentur, SUV Reviews and Bed in a Bag