diff --git a/CHANGES b/CHANGES index 49cf12d..f6596c2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ Changelog for hydra ------------------- +Release 8.5-dev +* ./configure now honors the CC enviroment variable if present +* Favor strrchr() over rindex() + + Release 8.4 ! Reports came in that the rdp module is not working reliable sometimes, most likely against new Windows versions. please test, report and if possible send a fix * Proxy support re-implemented: diff --git a/configure b/configure index 90969e4..bc66cfa 100755 --- a/configure +++ b/configure @@ -15,9 +15,13 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then echo " --nostrip do not per default strip binaries before install" echo " --debug show debug output to trace errors" echo " --help this here" + echo + echo If the CC environment variable is set, this is used as the compiler for the configure tests. The default is \"gcc\" otherwise. exit 0 fi +test -z "$CC" && CC=gcc + FHS="" SIXFOUR="" DEBUG="" @@ -966,37 +970,37 @@ fi echo "Checking for Android specialities ..." TMPC=comptest$$ -RINDEX=" not" +STRRCHR=" not" echo '#include ' > $TMPC.c echo '#include ' >> $TMPC.c -echo "int main() { char *x = rindex(\"test\", 'e'); if (x == NULL) return 0; else return 1; }" >> $TMPC.c -gcc -o $TMPC $TMPC.c > /dev/null 2>&1 -test -x $TMPC && RINDEX="" +echo "int main() { char *x = strrchr(\"test\", 'e'); if (x == NULL) return 0; else return 1; }" >> $TMPC.c +$CC -o $TMPC $TMPC.c > /dev/null 2>&1 +test -x $TMPC && STRRCHR="" rm -f $TMPC $TMPC.c -echo " ... rindex()$RINDEX found" +echo " ... strrchr()$STRRCHR found" if [ -n "$CRYPTO_PATH" ]; then RSA=" not" echo '#include ' > $TMPC.c echo '#include ' >> $TMPC.c echo "int main() { RSA *rsa = RSA_generate_key(1024, RSA_F4, NULL, NULL); if (rsa == NULL) return 0; else return 1; }" >> $TMPC.c #echo "int main() { RSA *rsa; RSA_generate_key_ex(rsa, 1024, 0, NULL); if (rsa == NULL) return 0; else return 1; }" >> $TMPC.c - gcc -o $TMPC $TMPC.c -lssl -lcrypto > /dev/null 2>&1 + $CC -o $TMPC $TMPC.c -lssl -lcrypto > /dev/null 2>&1 test -x $TMPC && RSA="" rm -f $TMPC $TMPC.c echo " ... RSA_generate_key()$RSA found" fi -echo "Checking for secure compile option support in gcc ..." +echo "Checking for secure compile option support in $CC ..." GCCSEC="no" LDSEC="no" GCCSECOPT="-fstack-protector-all --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" echo '#include ' > $TMPC.c echo 'int main() { printf(""); return 0; }' >> $TMPC.c -gcc -pie -fPIE $GCCSEPOPT -o $TMPC $TMPC.c > /dev/null 2> $TMPC.c.err +$CC -pie -fPIE $GCCSEPOPT -o $TMPC $TMPC.c > /dev/null 2> $TMPC.c.err test -x $TMPC && GCCSEC="yes" grep -q fPI $TMPC.c.err || GCCSECOPT="-pie -fPIE $GCCSECOPT" rm -f "$TMPC" -gcc $GCCSECOPT -Wl,-z,now -Wl,-z,relro -o $TMPC $TMPC.c > /dev/null 2> $TMPC.c.err +$CC $GCCSECOPT -Wl,-z,now -Wl,-z,relro -o $TMPC $TMPC.c > /dev/null 2> $TMPC.c.err test -x $TMPC && { LDSEC="yes" ; GCCSECOPT="$GCCSECOPT -Wl,-z,now -Wl,-z,relro" ; } rm -f $TMPC $TMPC.c $TMPC.c.err echo " Compiling... $GCCSEC" @@ -1060,8 +1064,8 @@ fi if [ -n "$SSH_PATH" ]; then XDEFINES="$XDEFINES -DLIBSSH" fi -if [ -n "$RINDEX" ]; then - XDEFINES="$XDEFINES -DNO_RINDEX" +if [ -n "$STRRCHR" ]; then + XDEFINES="$XDEFINES -DNO_STRRCHR" fi if [ -n "$RSA" ]; then XDEFINES="$XDEFINES -DNO_RSA_LEGACY" diff --git a/hydra-nntp.c b/hydra-nntp.c index 890a5a6..bfa3108 100644 --- a/hydra-nntp.c +++ b/hydra-nntp.c @@ -32,10 +32,10 @@ char *nntp_read_server_capacity(int sock) { buf[strlen(buf) - 1] = 0; if (buf[strlen(buf) - 1] == '\r') buf[strlen(buf) - 1] = 0; -#ifdef NO_RINDEX - if ((ptr = strrchr(buf, '\n')) != NULL) { -#else +#ifdef NO_STRRCHR if ((ptr = rindex(buf, '\n')) != NULL) { +#else + if ((ptr = strrchr(buf, '\n')) != NULL) { #endif ptr++; if (isdigit((int) *ptr) && *(ptr + 3) == ' ') diff --git a/hydra-smtp.c b/hydra-smtp.c index 92ebe61..1f40110 100644 --- a/hydra-smtp.c +++ b/hydra-smtp.c @@ -21,10 +21,10 @@ char *smtp_read_server_capacity(int sock) { buf[strlen(buf) - 1] = 0; if (buf[strlen(buf) - 1] == '\r') buf[strlen(buf) - 1] = 0; -#ifdef NO_RINDEX - if ((ptr = strrchr(buf, '\n')) != NULL) { -#else +#ifdef NO_STRRCHR if ((ptr = rindex(buf, '\n')) != NULL) { +#else + if ((ptr = strrchr(buf, '\n')) != NULL) { #endif ptr++; if (isdigit((int) *ptr) && *(ptr + 3) == ' ') diff --git a/hydra.c b/hydra.c index 7c022e7..19eab9e 100644 --- a/hydra.c +++ b/hydra.c @@ -171,7 +171,7 @@ char *SERVICES = #define RESTOREFILE "./hydra.restore" #define PROGRAM "Hydra" -#define VERSION "v8.4" +#define VERSION "v8.5-dev" #define AUTHOR "van Hauser/THC" #define EMAIL "" #define RESOURCE "http://www.thc.org/thc-hydra"