vanhauser-thc / thc-hydra

hydra
GNU Affero General Public License v3.0
9.75k stars 2.03k forks source link

get an error when i compile hydra[hydra-ssh.c:(.text+0x3fd): undefined reference to `ssh_is_connected'] #147

Closed calistochen closed 7 years ago

calistochen commented 8 years ago

[root@root thc-hydra]# ./configure --prefix=/Apktest/Pentest/hydra -DWITH_SSH1=On

Starting hydra auto configuration ... Detected 64 Bit Linux OS

Checking for zlib (libz.so, zlib.h) ... ... found 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) ... ... 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, 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) ... ... found 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) ... ... NOT found, optional anyway Checking for Android specialities ... ... rindex() found ... RSA_generate_key() found Checking for secure compile option support in gcc ... Compiling... yes Linking... yes

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

Writing Makefile.in ... now type "make"

[root@root thc-hydra]# make gcc -I. -O3 -pie -fPIE -fstack-protector-all --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro -lm -o hydra hydra.c 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-mssql.o hydra-xmpp.o hydra-http-proxy-urlenum.o hydra-snmp.o hydra-cvs.o hydra-smtp.o hydra-smtp-enum.o hydra-sapr3.o hydra-ssh.o hydra-sshkey.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-oracle-sid.o hydra-oracle.o hydra-vmauthd.o hydra-asterisk.o hydra-firebird.o hydra-afp.o hydra-ncp.o hydra-http-proxy.o hydra-http-form.o hydra-irc.o hydra-redis.o hydra-rdp.o hydra-s7-300.c crc32.o d3des.o bfg.o ntlm.o sasl.o hmacmd5.o hydra-mod.o hydra-rtsp.o hydra-time.o -lm -lz -lcurses -lssl -lidn -lpcre -lmysqlclient -lpq -lsvn_client-1 -lapr-1 -laprutil-1 -lsvn_subr-1 -lssh -lcrypto -L/usr/lib -L/usr/local/lib -L/lib -L/usr/lib64 -L/lib64 -L/usr/lib64 -L/usr/lib -L/usr/lib64 -L/usr/lib64/mysql -I/usr/include/mysql -I/usr/include/ncurses -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include/subversion-1 -I/usr/include/apr-1 -I/usr/include/subversion-1 -DHAVE_MYSQL_MYSQL_H -DLIBOPENSSL -DLIBNCURSES -DLIBIDN -DHAVE_PR29_H -DHAVE_PCRE -DLIBMYSQLCLIENT -DLIBPOSTGRES -DLIBSVN -DLIBSSH -DHAVE_ZLIB -DHAVE_MATH_H hydra-ssh.o: In function start_ssh': hydra-ssh.c:(.text+0x3fd): undefined reference tossh_is_connected' collect2: ld returned 1 exit status make: *\ [hydra] Error 1

vanhauser-thc commented 8 years ago

can you please try to make a bug report with sufficient information? what libssh packages are installed? where? what is your OS? etc.

vanhauser-thc commented 8 years ago

If you do not add to the bug report I will close it

Evi1CLAY commented 8 years ago

Hi,I think I'm having the same problem. My OS is Ubuntu 14.04 I installed environment by "apt-get install libssl-dev libssh-dev libidn11-dev libpcre3-dev libgtk2.0-dev libmysqlclient-dev libpq-dev libsvn-dev firebird2.1-dev libncp-dev libncurses5-dev" when I make thc-hydra-8.3, I encountered this problem:


root@evi1clay:~/Desktop/hydra/thc-hydra-8.3$ make
gcc -I. -O3 -pie -fPIE -fstack-protector-all --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro -lm    -o hydra  hydra.c 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-mssql.o hydra-xmpp.o hydra-http-proxy-urlenum.o hydra-snmp.o hydra-cvs.o hydra-smtp.o hydra-smtp-enum.o hydra-sapr3.o hydra-ssh.o hydra-sshkey.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-oracle-sid.o hydra-oracle.o hydra-vmauthd.o hydra-asterisk.o hydra-firebird.o hydra-afp.o hydra-ncp.o hydra-http-proxy.o hydra-http-form.o hydra-irc.o hydra-redis.o hydra-rdp.o hydra-s7-300.c crc32.o d3des.o bfg.o ntlm.o sasl.o hmacmd5.o hydra-mod.o hydra-rtsp.o hydra-time.o -lm -lz -lcurses -lssl -lfbclient -lidn -lpcre -lmysqlclient -lpq -lsvn_client-1 -lapr-1 -laprutil-1 -lsvn_subr-1 -lssh -lcrypto -L/usr/lib -L/usr/local/lib -L/lib -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/usr/lib -L/usr/lib/x86_64-linux-gnu -I/usr/include/mysql -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include/postgresql -I/usr/include -I/usr/include/subversion-1 -I/usr/include/apr-1.0 -I/usr/include/subversion-1 -DHAVE_MYSQL_MYSQL_H -DLIBOPENSSL -DLIBNCURSES -DLIBFIREBIRD -DLIBIDN -DHAVE_PR29_H -DHAVE_PCRE -DLIBMYSQLCLIENT -DLIBPOSTGRES -DLIBSVN -DLIBSSH -DHAVE_ZLIB -DHAVE_MATH_H
hydra.c: In function ‘main’:
hydra.c:3962:9: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘int’ [-Wformat=]
         printf("[BUG] %lu + %lu < %lu\n", hydra_brains.todo_all, total_redo_count, hydra_brains.sent);
         ^
hydra-ssh.o: In function `start_ssh.constprop.0':
hydra-ssh.c:(.text+0x19e): undefined reference to `ssh_is_connected'
hydra-ssh.o: In function `start_ssh':
hydra-ssh.c:(.text+0x4fe): undefined reference to `ssh_is_connected'
collect2: error: ld returned 1 exit status
make: *** [hydra] Error 1

Any help will be grateful, THANKS!

vanhauser-thc commented 8 years ago

I only have a Kali Rolling and Ubuntu 16.04 available and both do not have that issue.

My guess: you have libssh2 or another library like that installed which makes this fail.

Evi1CLAY commented 8 years ago

I just installed these two packages : libssh-4 libssh-dev, :-( I will test on Ubuntu 16.04. Another question: How do I get Hydra-8.4-dev? I did't find it . ths~

Evi1CLAY commented 8 years ago

Work well on Ubuntu 16.04 :+1:

hostgame commented 7 years ago
#uname -a
Linux server 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux
# apt list --installed | grep ssh
libssh-4/stable,stable,now 0.6.3-4+deb8u2 amd64 [installed]
libssh-dev/stable,stable,now 0.6.3-4+deb8u2 amd64 [installed]
libssh-gcrypt-4/stable,stable,now 0.6.3-4+deb8u2 amd64 [installed]
libssh2-1/stable,stable,now 1.4.3-4.1+deb8u1 amd64 [installed]
libssh2-1-dev/stable,stable,now 1.4.3-4.1+deb8u1 amd64 [installed]
openssh-client/stable,stable,now 1:6.7p1-5+deb8u3 amd64 [installed]
openssh-server/stable,stable,now 1:6.7p1-5+deb8u3 amd64 [installed]
openssh-sftp-server/stable,stable,now 1:6.7p1-5+deb8u3 amd64 [installed,automatic]
task-ssh-server/stable,now 3.31+deb8u1 all [installed]
# ./configure
...
Checking for libssh (libssh/libssh.h) ...
                                      ... found
...
# make
hydra-ssh.o: In function `start_ssh.constprop.0':
hydra-ssh.c:(.text+0x19c): undefined reference to `ssh_is_connected'
hydra-ssh.o: In function `start_ssh':
hydra-ssh.c:(.text+0x4fc): undefined reference to `ssh_is_connected'
collect2: error: ld returned 1 exit status
Makefile:58: recipe for target 'hydra' failed
make: *** [hydra] Error 1
# sudo apt-get remove libssh2-1
# apt list --installed | grep ssh
libssh-4/stable,stable,now 0.6.3-4+deb8u2 amd64 [installed]
libssh-dev/stable,stable,now 0.6.3-4+deb8u2 amd64 [installed]
libssh-gcrypt-4/stable,stable,now 0.6.3-4+deb8u2 amd64 [installed]
openssh-client/stable,stable,now 1:6.7p1-5+deb8u3 amd64 [installed]
openssh-server/stable,stable,now 1:6.7p1-5+deb8u3 amd64 [installed]
openssh-sftp-server/stable,stable,now 1:6.7p1-5+deb8u3 amd64 [installed,automatic]
task-ssh-server/stable,now 3.31+deb8u1 all [installed]
# make clean
# ./configure
# make
hydra-ssh.o: In function `start_ssh.constprop.0':
hydra-ssh.c:(.text+0x19c): undefined reference to `ssh_is_connected'
hydra-ssh.o: In function `start_ssh':
hydra-ssh.c:(.text+0x4fc): undefined reference to `ssh_is_connected'
collect2: error: ld returned 1 exit status
Makefile:58: recipe for target 'hydra' failed
make: *** [hydra] Error 1

Hydra 8.4

vanhauser-thc commented 7 years ago

dunno what is wrong with your system. can you please send the output of ./configure --debug and the last gcc line that is exected? (the very long one)

hostgame commented 7 years ago

I have installed hydra 6.4 by this manual and after that version 8.4 compiles well

BruceTyler0 commented 2 years ago

[root@localhost thc-hydra-9.3]# make cc -I. -O3 -g -fcommon -pie -fPIE -fstack-protector-all --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro -Wl,--allow-multiple-definition -lm -g -o hydra hydra.c 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-memcached.o hydra-mongodb.o hydra-mysql.o hydra-mssql.o hydra-cobaltstrike.o hydra-xmpp.o hydra-http-proxy-urlenum.o hydra-snmp.o hydra-cvs.o hydra-smtp.o hydra-smtp-enum.o hydra-sapr3.o hydra-ssh.o hydra-sshkey.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-oracle-sid.o hydra-oracle.o hydra-vmauthd.o hydra-asterisk.o hydra-firebird.o hydra-afp.o hydra-ncp.o hydra-http-proxy.o hydra-http-form.o hydra-irc.o hydra-redis.o hydra-rdp.o hydra-s7-300.c hydra-adam6500.o hydra-rtsp.o hydra-rpcap.o hydra-radmin2.o crc32.o d3des.o bfg.o ntlm.o sasl.o hmacmd5.o hydra-mod.o hydra-time.o hydra-smb2.o -lm -lz -lssl -lpcre -lpq -lssh -lcrypto -L/usr/lib -L/usr/local/lib -L/lib -L/lib64 -I/usr/include -I/usr/include -DLIBOPENSSL -DHAVE_PCRE -DLIBPOSTGRES -DLIBSSH -DHAVE_ZLIB -DHAVE_MATH_H -DHAVE_SYS_PARAM_H hydra-ssh.o: In function start_ssh': /root/hydra_workspaces/thc-hydra-9.3/hydra-ssh.c:85: undefined reference tossh_is_connected' /root/hydra_workspaces/thc-hydra-9.3/hydra-ssh.c:85: undefined reference to `ssh_is_connected' collect2: error: ld returned 1 exit status make: *** [hydra] Error 1

Hello, how to solve this problem?

BruceTyler0 commented 2 years ago

[root@localhost thc-hydra-9.3]# ./configure debug

Starting hydra auto configuration ... Detected 64 Bit Linux OS

Checking for zlib (libz/zlib.h) ... ... found Checking for openssl (libssl/libcrypto/ssl.h/sha.h) ... ... found Checking for gcrypt (libgcrypt/gpg-error.h) ... ... gcrypt not found, radmin2 module disabled Checking for idn (libidn) ... ... NOT found, unicode logins and passwords will not be supported Checking for curses (libcurses/term.h) ... ... NOT found, color output disabled Checking for pcre (libpcre/pcre.h) ... ... found Checking for Postgres (libpq/libpq-fe.h) ... ... found Checking for SVN (libsvn_client-1/libapr-1/libaprutil-1) ... ... NOT found, module svn disabled Checking for firebird (libfbclient) ... ... NOT found, module firebird disabled Checking for MYSQL client (libmysqlclient/math.h) ... ... NOT found, module Mysql will not support version > 4.x Checking for AFP (libafpclient) ... ... NOT found, module Apple Filing Protocol disabled - Apple sucks anyway Checking for NCP (libncp/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 Checking for Oracle (libocci/libclntsh/oci.h/libaio/liboci) ... ... NOT found, module Oracle disabled Get basic and sdk package from http://www.oracle.com/technetwork/database/features/instant-client/index.html Checking for Memcached (libmemcached/memcached.h) ... ... NOT found, module memcached disabled Checking for Freerdp3 (libfreerdp3/freerdp.h/libwinpr3/winpr.h) ... ... NOT found, checking for freerdp2 module next... Checking for Freerdp2 (libfreerdp2/freerdp.h/libwinpr2/winpr.h) ... ... NOT found, module rdp disabled Checking for Mongodb (libmongoc-1.0/mongoc.h/libbson-1.0/bson.h) ... ... NOT found, module mongodb disabled Checking for smbclient (libsmbclient/libsmbclient.h) ... ... NOT found, module smb2 disabled Checking for GUI req's (pkg-config/gtk+-2.0) ... ... NOT found, optional anyway Checking for Android specialities ... ... strrchr() found ... RSA_generate_key() found Checking for secure compile option support in gcc ... Compiling... yes Linking... yes Checking for --allow-multiple-definition linker option ... yes

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

Writing Makefile.in ... now type "make"

Hello, is this the corresponding debug information?