root-packages/bettercap

This commit is contained in:
termux-actions[bot]
2022-04-20 10:39:57 +00:00
parent 2aca2cb7b8
commit 31c0f61a12
3 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
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_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.32.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/bettercap/bettercap/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=ea28d4d533776a328a54723a74101d1720016ffe7d434bf1d7ab222adb397ac6
TERMUX_PKG_DEPENDS="libpcap, libusb, libnetfilter-queue"
termux_step_configure() {
termux_setup_golang
export GOPATH=$TERMUX_PKG_BUILDDIR
export CGO_CFLAGS="-I$TERMUX_PREFIX/include"
mkdir -p "$GOPATH"/src/github.com/bettercap/
cp -a "$TERMUX_PKG_SRCDIR" "$GOPATH"/src/github.com/bettercap/bettercap
go get github.com/bettercap/recording
}
termux_step_make() {
cd src/github.com/bettercap/bettercap
make build
}
termux_step_make_install() {
cd src/github.com/bettercap/bettercap
make install
}

View File

@@ -0,0 +1,38 @@
diff --git a/modules/https_proxy/https_proxy.go b/modules/https_proxy/https_proxy.go
index 06bc1e0..127bb39 100644
--- a/modules/https_proxy/https_proxy.go
+++ b/modules/https_proxy/https_proxy.go
@@ -47,12 +47,12 @@ func NewHttpsProxy(s *session.Session) *HttpsProxy {
"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 --git a/modules/https_server/https_server.go b/modules/https_server/https_server.go
index 0d9ff80..3e49996 100644
--- a/modules/https_server/https_server.go
+++ b/modules/https_server/https_server.go
@@ -42,12 +42,12 @@ func NewHttpsServer(s *session.Session) *HttpsServer {
"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)."))

View File

@@ -0,0 +1,26 @@
diff --git a/caplets/env.go b/caplets/env.go
index 9ba8706..fd12078 100644
--- a/caplets/env.go
+++ b/caplets/env.go
@@ -19,7 +19,7 @@ func getDefaultInstallBase() string {
if runtime.GOOS == "windows" {
return filepath.Join(os.Getenv("ALLUSERSPROFILE"), "bettercap")
}
- return "/usr/local/share/bettercap/"
+ return "@TERMUX_PREFIX@/share/bettercap/"
}
func getUserHomeDir() string {
diff --git a/modules/ui/ui.go b/modules/ui/ui.go
index 7bc5270..9a5476a 100644
--- a/modules/ui/ui.go
+++ b/modules/ui/ui.go
@@ -34,7 +34,7 @@ func getDefaultInstallBase() string {
if runtime.GOOS == "windows" {
return filepath.Join(os.Getenv("ALLUSERSPROFILE"), "bettercap")
}
- return "/usr/local/share/bettercap/"
+ return "@TERMUX_PREFIX@/share/bettercap/"
}
func NewUIModule(s *session.Session) *UIModule {