PDA

Ver la versión completa : Hydra, Error: Compiled without LIBSSH support, module not available!




jackdragma
10-28-2009, 03:12 PM
Buenas compañeros,

Dar la enhorabuena por la propuesta de Sec-Track y los estupendos videotutoriales de 4v4t4r.

Después de ver todos los videotutoriales y ponerme en marcha para realizar yo los pasos, me encuentro que en Xhydra, después de configurarlo para realizar el ataque a aadams por SSH2 y presionar start, me sale el error:

Error: Compiled without LIBSSH support, module not available!

He buscado por San Google y he encontrado este post:

Hydra compiled without LIBSSH support - Remote Exploit Forums (http://forums.remote-exploit.org/backtrack-4-package-feature-requests/23874-hydra-compiled-without-libssh-support.html)

Mi problema surge al no estar familiarizado en compilar que me pierdo en los pasos de aplicar el patch y todo el resto de abajo.

¿Alguien se ha encontrado el mismo problema y podría ofrecer una solución más clara por favor?

Muchas gracias. Cordialmente,

akru96
10-29-2009, 09:39 AM
Hola.

Estos son los pasos que he seguido:

1.- Creamos carpeta para almacenar los ficheros con los que trabajaremos

1.1.- Entramos en la carpeta desde donde trabajaremos.

2.- Descargamos el fichero "http://freeworld.thc.org/releases/hydra-5.4-src.tar.gz"

3.- Ejecutamos el comando "sudo apt-get install libssh-2-dev"

4.- Descargamos el fichero "http://0xbadc0de.be/libssh/hydra-libssh0.2.patch"

5.- Descompactamos el fichero con el siguiente comando:
"tar zxvf hydra-5.4-src.tar.gz"

6.- Para aplicar el parche deberemos hacer lo siguiente:

cd ./hydra-5.4-src; patch -p1 < ./hydra-libssh0.2.patch

7.- Revisamos que estamos dentro de la carpeta de "hydra-5.4-src" y ejecutaremos la instalación:

./configure

8.- Ejecutamos nano Makefile y eliminamos '-DLIBPOSTGRES' y '-lpq

9.- Ctrl +o guardar y Ctrl + w salir

10.- ejecutamos "make"

11.- ejecutamos "sudo make install"

12.- Reiniciamos el equipo y funciona bien ;)

jackdragma
10-30-2009, 02:17 PM
Buenas noches,

Muchas gracias por tan rápida y detallada respuesta. Lamento comunicarte que me sigue dando error :(

He copiado todos los resultados de los pasos, ya que lo he intentado como en 3 máquinas virtuales probando cosas diferentes, pero nada. Así que te adjunto los pasos más coherentes que he realizado haciendo caso de tu tutorial.

Omitiré los pasos de aptitude install libssh-2-dev y lo de bajar archivos.

root@bt4pre:~# - cd ./hydra-5.4-src; patch -p1 < ./hydra-libssh0.2.patch
bash: -: command not found
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Les sous-répertoires hydra-5.4-src/arm et hydra-5.4-src-libssh0.2/arm sont identiques.
|diff -u hydra-5.4-src/configure hydra-5.4-src-libssh0.2/configure
|--- hydra-5.4-src/configure 2006-01-20 14:44:15.000000000 +0100
|+++ hydra-5.4-src-libssh0.2/configure 2008-10-31 22:32:47.000000000 +0100
--------------------------
File to patch: hydra-5.4-src/configure(AQUÍ HE COPIADO hydra-5.4-src/configure)
patching file hydra-5.4-src/configure
can't find file to patch at input line 25
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Seulement dans hydra-5.4-src-libssh0.2/: .hydra-ftp.c.swp
|Les sous-répertoires hydra-5.4-src/hydra-gtk et hydra-5.4-src-libssh0.2/hydra-gtk sont identiques.
|Seulement dans hydra-5.4-src-libssh0.2/: .hydra-mod.c.swp
|diff -u hydra-5.4-src/hydra-ssh2.c hydra-5.4-src-libssh0.2/hydra-ssh2.c
|--- hydra-5.4-src/hydra-ssh2.c 2007-03-22 15:04:29.000000000 +0100
|+++ hydra-5.4-src-libssh0.2/hydra-ssh2.c 2008-11-01 21:21:08.000000000 +0100
--------------------------
File to patch: hydra-5.4-src/hydra-ssh2.c(AQUÍ HE COPIADO hydra-5.4-src/hydra-ssh2.c)
patching file hydra-5.4-src/hydra-ssh2.c


* Parece que en el otro patch da un error.

root@bt4pre:~# cd hydra-5.4-src
root@bt4pre:~/hydra-5.4-src# ./configure

Starting hydra auto configuration ...

Checking for openssl (libssl/ssl.h) ...
... found
Checking for Postgres (libpq) ...
... found
Checking for SVN (ibsvn_client-1 libapr-0.so libaprutil-0.so) ...
... found
Checking for SAP/R3 (librfc/saprfc.h) ...
... NOT found, module sapr3 disabled
Get it from SAP on Linux (http://www.sap.com/solutions/netweaver/linux/eval/index.asp)
Checking for libssh (libssh/libssh.h) ...
... found
NOTE: ensure that you have libssh v0.2 or later installed!! Get it from Libssh [0xbadc0de.be] (http://0xbadc0de.be) !

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

Writing Makefile.in ...

NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES NOTES
================================================== =====================
ARM/PalmPilot users: please run ./configure-arm or ./configure-palm respectivly

now type "make"

* Antes de hacer el make borro '-DLIBPOSTGRES' y '-lpq' que salen al principio de editar el archivo y lo grabo.

root@bt4pre:~/hydra-5.4-src#make
gcc -I. -Wall -O2 -o pw-inspector pw-inspector.c
gcc -I. -Wall -O2 -c hydra-vnc.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-pcnfs.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-rexec.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-nntp.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-socks5.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-telnet.c -DLIBOPENSSL -DLIBSSH
hydra-telnet.c: In function 'service_telnet':
hydra-telnet.c:177: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra-telnet.c:191: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra-telnet.c:198: warning: ignoring return value of 'write', declared with attribute warn_unused_result
gcc -I. -Wall -O2 -c hydra-cisco.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-http.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-ftp.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-imap.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-pop3.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-smb.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-icq.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-cisco-enable.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-ldap.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-mysql.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-http-proxy.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-smbnt.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-mssql.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-snmp.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-cvs.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-smtpauth.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-sapr3.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-ssh2.c -DLIBOPENSSL -DLIBSSH
hydra-ssh2.c:10:2: warning: #warning "If compilation of hydra-ssh2 fails, you are not using v0.2 or 0.2.1. Download from http://www.0xbadc0de.be/"
gcc -I. -Wall -O2 -c hydra-teamspeak.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-postgres.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-rsh.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-rlogin.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-oracle-listener.c -DLIBOPENSSL -DLIBSSH
hydra-oracle-listener.c:10:2: warning: #warning "The Oracle Listener module does not work yet"
gcc -I. -Wall -O2 -c hydra-svn.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-pcanywhere.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-sip.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-vmauthd.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-http-proxy-auth-ntlm.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-imap-ntlm.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-pop3-ntlm.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-smtpauth-ntlm.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-http-form.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c crc32.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c d3des.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c md4.c -DLIBOPENSSL -DLIBSSH
gcc -I. -Wall -O2 -c hydra-mod.c -DLIBOPENSSL -DLIBSSH
hydra-mod.c: In function 'hydra_child_exit':
hydra-mod.c:279: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra-mod.c:281: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra-mod.c:283: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra-mod.c: In function 'hydra_get_next_pair':
hydra-mod.c:297: warning: ignoring return value of 'read', declared with attribute warn_unused_result
hydra-mod.c: In function 'hydra_completed_pair':
hydra-mod.c:330: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra-mod.c: In function 'hydra_completed_pair_found':
hydra-mod.c:339: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra-mod.c:341: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra-mod.c: In function 'hydra_completed_pair_skip':
hydra-mod.c:350: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra-mod.c:352: warning: ignoring return value of 'write', declared with attribute warn_unused_result
gcc -I. -Wall -O2 -c ntlm.c -DLIBOPENSSL -DLIBSSH
ntlm.c: In function 'buildAuthResponse':
ntlm.c:1278: warning: the address of 'lmRespData' will always evaluate as 'true'
ntlm.c:1279: warning: the address of 'ntRespData' will always evaluate as 'true'
gcc -I. -Wall -O2 -c hydra.c -DLIBOPENSSL -DLIBSSH
hydra.c: In function 'hydra_restore_write':
hydra.c:309: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
hydra.c:310: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
hydra.c:322: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
hydra.c:324: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
hydra.c:327: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
hydra.c: In function 'hydra_restore_read':
hydra.c:356: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
hydra.c:364: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
hydra.c:366: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
hydra.c:372: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
hydra.c:380: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
hydra.c:385: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
hydra.c:392: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
hydra.c:395: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
hydra.c:402: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
hydra.c:403: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
hydra.c:408: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
hydra.c:410: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
hydra.c:417: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result
hydra.c: In function 'hydra_spawn_arm':
hydra.c:689: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra.c: In function 'hydra_main':
hydra.c:1766: warning: ignoring return value of 'write', declared with attribute warn_unused_result
hydra.c:1895: warning: ignoring return value of 'write', declared with attribute warn_unused_result
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-http-proxy-auth-ntlm.o hydra-imap-ntlm.o hydra-pop3-ntlm.o hydra-smtpauth-ntlm.o hydra-http-form.o crc32.o d3des.o md4.o hydra-mod.o ntlm.o hydra.o -lm -lssl -lssh -lcrypto -L/usr/lib -L/usr/local/lib -L/lib -L/usr/lib || echo -e "\nIF YOU RECEIVED THE ERROR MESSAGE \"cannot find -lpq\" DO THE FOLLOWING:\n make clean; ./configure\n vi Makefile <- and remove the \"-lpq\" and \"-DLIBPOSTGRES\" statements\n make\n"

If men could get pregnant, abortion would be a sacrament

cd hydra-gtk && ./make_xhydra.sh
Trying to compile xhydra now (hydra gtk gui) - dont worry if this fails, this is really optional ...
Error: configure wasnt happy. Analyse this:
configure: error: Library requirements (gtk+-2.0 >= 2.0.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
make: [xhydra] Error 1 (ignored)

Now type make install

*Al hacer el make salen muchos errores que no sé si también te saldrían a ti, aunque entiendo que si te funciono no te deberían de salir.

root@bt4pre:~/hydra-5.4-src# make install
test -e hydra.exe && touch Makefile || strip hydra pw-inspector
test -e hydra.exe && strip hydra.exe pw-inspector.exe || touch hydra
test -e xhydra && strip xhydra || touch Makefile
test -e hydra.exe && touch Makefile || cp hydra pw-inspector /usr/local/bin && cd /usr/local/bin && chmod 755 hydra pw-inspector
test -e hydra.exe && cp hydra.exe pw-inspector.exe /usr/local/bin && cd /usr/local/bin && chmod 755 hydra.exe pw-inspector.exe || touch Makefile
test -e xhydra && cp xhydra /usr/local/bin && cd /usr/local/bin && chmod 755 xhydra
make: [install] Error 1 (ignored)

* Aquí ya me dice que también detectó un error.

root@bt4pre:~# ssh 192.168.1.100 -l aadams
The authenticity of host '192.168.1.100 (192.168.1.100)' can't be established.
RSA key fingerprint is ab:ab:a8:ad:a2:f2:fd:c2:6f:05:99:69:40:54:ec:10.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.100' (RSA) to the list of known hosts.
[email protected]'s password:
Linux 2.6.16.
aadams@slax:~$

* Pruebo la conexión para ver que no es problema del ssh2 del servidor.

Hydra v5.4 (c) 2006 by van Hauser / THC - use allowed only for legal purposes.
Hydra (#!/bin/the hacker's choice - THC (http://www.thc.org)) starting at 2009-10-30 20:12:57
[DATA] 36 tasks, 1 servers, 3117 login tries (l:1/p:3117), ~86 tries per task
[DATA] attacking service ssh2 on port 22
Error: ssh2 protocol error
Error: ssh2 protocol error
Error: ssh2 protocol error

*Al configurar xhydra como en el videotutorial y darle start me sale el mensaje de error de arriba.


¿He realizado algún paso incorrectamente? Supongo que si pero es que no sé detectarlo. Muchas gracias nuevamente.

kmilo
11-05-2009, 03:41 PM
No debería ser:
root@bt4pre:~# - cd ./hydra-5.4-src; patch -p1 < ./hydra-libssh0.2.patch

sino:
root@bt4pre:~# cd ./hydra-5.4-src; patch -p1 < ./hydra-libssh0.2.patch

Este error:
Trying to compile xhydra now (hydra gtk gui) - dont worry if this fails, this is really optional ...
Error: configure wasnt happy. Analyse this:
configure: error: Library requirements (gtk+-2.0 >= 2.0.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
make: [xhydra] Error 1 (ignored)

se soluciona instalando las librerias de desarrollo de gtk+-2.0 esto se puede hacer con el comando:
sudo apt-get install libgtk2.0-dev

akru96
11-06-2009, 08:28 AM
Hola.

En la línea del patch se me escapó un "-" que como bien comenta nuestro compañero no debe estar, no obstante lo que puedes hacer es copiar el patch dentro de la carpeta y ejecutarlo:

cp hydra-libssh0.2.patch ./hydra-5.4-src

cd hydra-5.4-src

patch -p1 < ./hydra-libssh0.2.patch


Pruébalo y me dices qué tal te va.


Saludos.