From 1ecf76ab95cbc76cacf58ad127d35e064a9e49e7 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Fri, 19 Jul 2019 22:07:01 +0200 Subject: [PATCH] bettercap: add package --- root-packages/bettercap/build.sh | 20 ++++++++++++ root-packages/bettercap/fix-home-path.patch | 36 +++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 root-packages/bettercap/build.sh create mode 100644 root-packages/bettercap/fix-home-path.patch diff --git a/root-packages/bettercap/build.sh b/root-packages/bettercap/build.sh new file mode 100644 index 000000000..884a70629 --- /dev/null +++ b/root-packages/bettercap/build.sh @@ -0,0 +1,20 @@ +TERMUX_PKG_HOMEPAGE=https://www.bettercap.org +TERMUX_PKG_DESCRIPTION="The Swiss Army knife for 802.11, BLE and Ethernet networks reconnaissance and MITM attacks" +TERMUX_PKG_LICENSE="GPL-3.0" +TERMUX_PKG_VERSION=2.24.1 +TERMUX_PKG_SRCURL=https://github.com/bettercap/bettercap/archive/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=590cef2b2b24fd9f67c57c8cb19ab8ff08b11d43bfc23b468013ddad907bb8b8 +TERMUX_PKG_DEPENDS="libpcap, libusb" +TERMUX_PKG_BUILD_IN_SRC=yes + +termux_step_configure() { + termux_setup_golang +} + +termux_step_make() { + make build +} + +termux_step_make_install() { + install bettercap $TERMUX_PREFIX/bin/ +} diff --git a/root-packages/bettercap/fix-home-path.patch b/root-packages/bettercap/fix-home-path.patch new file mode 100644 index 000000000..097453198 --- /dev/null +++ b/root-packages/bettercap/fix-home-path.patch @@ -0,0 +1,36 @@ +diff -u -r ../modules.orig/https_proxy/https_proxy.go ./modules/https_proxy/https_proxy.go +--- ../modules.orig/https_proxy/https_proxy.go 2019-07-19 21:29:31.672237775 +0200 ++++ ./modules/https_proxy/https_proxy.go 2019-07-19 21:26:42.776456311 +0200 +@@ -43,12 +43,12 @@ + "URL, path or javascript code to inject into every HTML page.")) + + mod.AddParam(session.NewStringParameter("https.proxy.certificate", +- "~/.bettercap-ca.cert.pem", ++ "@TERMUX_HOME@/.bettercap-ca.cert.pem", + "", + "HTTPS proxy certification authority TLS certificate file.")) + + mod.AddParam(session.NewStringParameter("https.proxy.key", +- "~/.bettercap-ca.key.pem", ++ "@TERMUX_HOME@/.bettercap-ca.key.pem", + "", + "HTTPS proxy certification authority TLS key file.")) + +diff -u -r ../modules.orig/https_server/https_server.go ./modules/https_server/https_server.go +--- ../modules.orig/https_server/https_server.go 2019-07-19 21:29:41.980474175 +0200 ++++ ./modules/https_server/https_server.go 2019-07-19 21:28:13.267671735 +0200 +@@ -42,12 +42,12 @@ + "Port to bind the http server to.")) + + mod.AddParam(session.NewStringParameter("https.server.certificate", +- "~/.bettercap-httpd.cert.pem", ++ "@TERMUX_HOME@/.bettercap-httpd.cert.pem", + "", + "TLS certificate file (will be auto generated if filled but not existing).")) + + mod.AddParam(session.NewStringParameter("https.server.key", +- "~/.bettercap-httpd.key.pem", ++ "@TERMUX_HOME@/.bettercap-httpd.key.pem", + "", + "TLS key file (will be auto generated if filled but not existing).")) +