From 236d269a2b3cd3d998f7ecf41e7472f507916a29 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 31 Jan 2017 11:04:39 +0100 Subject: [PATCH] hydra: Add as disabled package --- disabled-packages/hydra/Makefile.am.patch | 12 ++++ disabled-packages/hydra/Makefile.unix.patch | 8 +++ disabled-packages/hydra/build.sh | 17 +++++ disabled-packages/hydra/rindex.patch | 70 +++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 disabled-packages/hydra/Makefile.am.patch create mode 100644 disabled-packages/hydra/Makefile.unix.patch create mode 100644 disabled-packages/hydra/build.sh create mode 100644 disabled-packages/hydra/rindex.patch diff --git a/disabled-packages/hydra/Makefile.am.patch b/disabled-packages/hydra/Makefile.am.patch new file mode 100644 index 000000000..30363a72d --- /dev/null +++ b/disabled-packages/hydra/Makefile.am.patch @@ -0,0 +1,12 @@ +diff -u -r ../thc-hydra-8.4/Makefile.am ./Makefile.am +--- ../thc-hydra-8.4/Makefile.am 2017-01-27 17:19:18.000000000 +0100 ++++ ./Makefile.am 2017-01-31 11:02:20.625685814 +0100 +@@ -3,7 +3,7 @@ + # + OPTS=-I. -O3 + # -Wall -g -pedantic +-LIBS=-lm ++LIBS?=-lm + BINDIR = /bin + MANDIR ?= /man/man1/ + DATADIR ?= /etc diff --git a/disabled-packages/hydra/Makefile.unix.patch b/disabled-packages/hydra/Makefile.unix.patch new file mode 100644 index 000000000..41b200561 --- /dev/null +++ b/disabled-packages/hydra/Makefile.unix.patch @@ -0,0 +1,8 @@ +diff -u -r ../thc-hydra-8.4/Makefile.unix ./Makefile.unix +--- ../thc-hydra-8.4/Makefile.unix 2017-01-27 17:19:18.000000000 +0100 ++++ ./Makefile.unix 2017-01-31 10:26:50.507597579 +0100 +@@ -1,2 +1,2 @@ +-CC=gcc +-STRIP=strip ++CC?=gcc ++STRIP?=strip diff --git a/disabled-packages/hydra/build.sh b/disabled-packages/hydra/build.sh new file mode 100644 index 000000000..8e65f653f --- /dev/null +++ b/disabled-packages/hydra/build.sh @@ -0,0 +1,17 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/vanhauser-thc/thc-hydra +TERMUX_PKG_DESCRIPTION="Network logon cracker supporting different services" +TERMUX_PKG_VERSION=8.4 +TERMUX_PKG_SRCURL=https://github.com/vanhauser-thc/thc-hydra/archive/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=b478157618e602e0a8adc412efacc1c2a5d95a8f5bfb30579fbf5997469cd8b4 +TERMUX_PKG_FOLDERNAME=thc-hydra-$TERMUX_PKG_VERSION +TERMUX_PKG_BUILD_IN_SRC=yes +TERMUX_PKG_DEPENDS="openssl" + +termux_step_configure() { + # Skip the ./configure file (which does not support cross compilation) + # and configure the build manually. + CFLAGS+=" -Dindex=strchr -DLIBOPENSSL" + export MANDIR=/share/man/man1 + export LIBS="-lcrypto -lssl" + cat Makefile.am | sed 's/^install:.*/install: all/' >> Makefile +} diff --git a/disabled-packages/hydra/rindex.patch b/disabled-packages/hydra/rindex.patch new file mode 100644 index 000000000..8579e17a3 --- /dev/null +++ b/disabled-packages/hydra/rindex.patch @@ -0,0 +1,70 @@ +diff -u -r ../thc-hydra-8.4/Android.mk ./Android.mk +--- ../thc-hydra-8.4/Android.mk 2017-01-27 17:19:18.000000000 +0100 ++++ ./Android.mk 2017-01-31 10:34:18.962143259 +0100 +@@ -2,7 +2,7 @@ + include $(CLEAR_VARS) + + LOCAL_CFLAGS:= -O3 -DLIBOPENSSL -DLIBIDN -DHAVE_PR29_H -DHAVE_PCRE \ +- -DLIBNCP -DLIBPOSTGRES -DLIBSVN -DLIBSSH -DNO_RINDEX \ ++ -DLIBNCP -DLIBPOSTGRES -DLIBSVN -DLIBSSH \ + -DHAVE_MATH_H -DOPENSSL_NO_DEPRECATED -DNO_RSA_LEGACY \ + -fdata-sections -ffunction-sections + +diff -u -r ../thc-hydra-8.4/configure ./configure +--- ../thc-hydra-8.4/configure 2017-01-27 17:19:18.000000000 +0100 ++++ ./configure 2017-01-31 10:33:11.214967286 +0100 +@@ -966,14 +966,6 @@ + + echo "Checking for Android specialities ..." + TMPC=comptest$$ +-RINDEX=" 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="" +-rm -f $TMPC $TMPC.c +-echo " ... rindex()$RINDEX found" + if [ -n "$CRYPTO_PATH" ]; then + RSA=" not" + echo '#include ' > $TMPC.c +@@ -1060,9 +1052,6 @@ + if [ -n "$SSH_PATH" ]; then + XDEFINES="$XDEFINES -DLIBSSH" + fi +-if [ -n "$RINDEX" ]; then +- XDEFINES="$XDEFINES -DNO_RINDEX" +-fi + if [ -n "$RSA" ]; then + XDEFINES="$XDEFINES -DNO_RSA_LEGACY" + fi +diff -u -r ../thc-hydra-8.4/hydra-nntp.c ./hydra-nntp.c +--- ../thc-hydra-8.4/hydra-nntp.c 2017-01-27 17:19:18.000000000 +0100 ++++ ./hydra-nntp.c 2017-01-31 10:33:23.022823648 +0100 +@@ -32,11 +32,7 @@ + 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 +- if ((ptr = rindex(buf, '\n')) != NULL) { +-#endif + ptr++; + if (isdigit((int) *ptr) && *(ptr + 3) == ' ') + resp = 1; +diff -u -r ../thc-hydra-8.4/hydra-smtp.c ./hydra-smtp.c +--- ../thc-hydra-8.4/hydra-smtp.c 2017-01-27 17:19:18.000000000 +0100 ++++ ./hydra-smtp.c 2017-01-31 10:34:10.814242368 +0100 +@@ -21,11 +21,7 @@ + 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 +- if ((ptr = rindex(buf, '\n')) != NULL) { +-#endif + ptr++; + if (isdigit((int) *ptr) && *(ptr + 3) == ' ') + resp = 1;