Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are you sure of libaio.dll need for Oracle on Cygwin ? #520

Closed
maaaaz opened this issue Apr 25, 2020 · 2 comments
Closed

Are you sure of libaio.dll need for Oracle on Cygwin ? #520

maaaaz opened this issue Apr 25, 2020 · 2 comments

Comments

@maaaaz
Copy link

maaaaz commented Apr 25, 2020

Hello @vanhauser-thc,

I'm struggling to compile hydra on Cygwin with Oracle support.
You seem to look for libaio.dll in configure, but I really can't find a way to get this file (no cygwin repo, or in instant_client package etc.)...to the point that I think it's not needed on such platform (Cywin / Windows).

By the way, libclntsh does not exist on Windows, its name is oci.dll.

Cheers.

@vanhauser-thc
Copy link
Owner

feel free to send in a patch (pull request).
I dont have Cygwin anymore so I cannot test it myself.

@maaaaz
Copy link
Author

maaaaz commented Apr 26, 2020

So, I did investigate on this and manage to compile with Oracle support on Cygwin. So first, there's no need of libaio on Cygwin, and libcltnsh.dll does not exist as well.

Then here are the steps needed beforehand:

  1. Downloadinstantclient basic + sdk and unzip them in a same root folder, for instance /cygdrive/c/oracle/instantclient_12_2 so that you have this tree:
$ ll /cygdrive/c/oracle/instantclient_12_2
...
-rwxrwx---+ 1 Admin None  1,3M 14 févr.  2017 oci.dll*
...
drwxrwx---+ 1 Admin None     0 26 avr.  13:32 sdk/
...
$ ll /cygdrive/c/oracle/instantclient_12_2/sdk/
total 318K
drwxrwx---+ 1 Admin None    0 26 avr.  13:32 admin/
drwxrwx---+ 1 Admin None    0 26 avr.  14:23 demo/
drwxrwx---+ 1 Admin None    0 26 avr.  13:32 include/
drwxrwx---+ 1 Admin None    0 26 avr.  14:14 lib/
-rwxrwx---+ 1 Admin None  358 31 janv.  2015 ott.bat*
-rwxrwx---+ 1 Admin None 306K 26 janv.  2017 ottclasses.zip*
-rwxrwx---+ 1 Admin None  508 14 févr.  2017 SDK_README*
  1. Extract definitions of oci.dll with gendef.exe, it will produce a oci.def file
> gendef.exe "C:\oracle\instantclient_12_2\oci.dll"
  1. Copy the oci.def file to C:\oracle\instantclient_12_2

  2. Generate the liboci.a lib in the same previous folder

> dlltool -D oci.dll -d oci.def -l liboci.a

For information, some articles that showed me the way and the need of that liboci.a procedure:

  1. Finally, configure hydra with these options and then make
$ ./configure --debug --disable-xhydra --prefix=$PWD/build --with-oracle="/cygdrive/c/oracle/instantclient_12_2/sdk/include/" --with-oracle-lib="/cygdrive/c/oracle/instantclient_12_2/"
...
...
Checking for Oracle (libocci.so libclntsh.so / oci.h and libaio.so / liboci.a and oci.dll) ...
DEBUG: ORACLE_LIB= /lib /usr/lib /usr/local/lib /opt/local/lib /cygdrive/c/oracle/instantclient_12_2/
DEBUG: ORACLE_INC=/usr/include /usr/local/include /opt/include /opt/local/include /cygdrive/c/oracle/instantclient_12_2/sdk/include/
DEBUG: ORACLE_PATH=/cygdrive/c/oracle/instantclient_12_2//libocci
DEBUG: ORACLE_PATH=/cygdrive/c/oracle/instantclient_12_2//libaio
DEBUG: ORACLE_IPATH=/cygdrive/c/oracle/instantclient_12_2/sdk/include//oci.h
                                                                    ... found
...
...
DEBUG: XDEFINES= -DHAVE_MYSQL_MYSQL_H -DLIBOPENSSL -DLIBIDN -DHAVE_PR29_H -DHAVE_PCRE -DLIBMYSQLCLIENT -DLIBORACLE -DLIBPOSTGRES -DLIBSSH -DHAVE_ZLIB -DHAVE_GCRYPT -DLIBFREERDP2 -DLIBWINPR2 -DHAVE_MATH_H -DHAVE_SYS_PARAM_H
DEBUG: XLIBS= -lgcrypt -lz -lssl -loci -lidn -lpcre -lmysqlclient -lpq -lssh -lcrypto -lfreerdp2 -lwinpr2
DEBUG: XLIBPATHS=-L/usr/lib -L/usr/local/lib -L/lib -L/lib -L/cygdrive/c/oracle/instantclient_12_2/ -L/lib -L/cygdrive/c/oracle/instantclient_12_2/ -L/lib
DEBUG: XIPATHS= -I/usr/include/mysql -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/cygdrive/c/oracle/instantclient_12_2/sdk/include/ -I/usr/include/freerdp2 -I/usr/include/winpr2
...
...
cc -I. -O3 -march=native -flto -fcommon -pie -fPIE -fstack-protector-all --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -lm -march=native -flto   -o hydra hydra-logo.o 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-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 -lgcrypt -lz -lssl -loci -lidn -lpcre -lmysqlclient -lpq -lssh -lcrypto -lfreerdp2 -lwinpr2 -L/usr/lib -L/usr/local/lib -L/lib -L/lib -L/cygdrive/c/oracle/instantclient_12_2/ -L/lib -L/cygdrive/c/oracle/instantclient_12_2/ -L/lib -I/usr/include/mysql -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/cygdrive/c/oracle/instantclient_12_2/sdk/include/ -I/usr/include/freerdp2 -I/usr/include/winpr2 -DHAVE_MYSQL_MYSQL_H -DLIBOPENSSL -DLIBIDN -DHAVE_PR29_H -DHAVE_PCRE -DLIBMYSQLCLIENT -DLIBORACLE -DLIBPOSTGRES -DLIBSSH -DHAVE_ZLIB -DHAVE_GCRYPT -DLIBFREERDP2 -DLIBWINPR2 -DHAVE_MATH_H -DHAVE_SYS_PARAM_H

Executing hydra.exe shows the oracle support:

$ ./hydra -h
...
...
Supported services: adam6500 asterisk cisco cisco-enable cvs ftp[s] http[s]-{head|get|post} http[s]-{get|post}-form http-proxy http-proxy-urlenum icq imap[s] irc ldap2[s] ldap3[-{cram|digest}md5][s] mssql mysql nntp oracle oracle-listener oracle-sid pcanywhere pcnfs pop3[s] postgres radmin2 rdp redis rexec rlogin rpcap rsh rtsp s7-300 sip smb smtp[s] smtp-enum snmp socks5 ssh sshkey teamspeak telnet[s] vmauthd vnc xmpp

I'm proposing you this PR for configure this.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants