| 1 |
Description: Use bettercap-caplets package. |
| 2 |
We packaged the bettercap-caplets so remove the install/update function |
| 3 |
for caplets and use the correct path to caplets:/usr/share/bettercap. |
| 4 |
Author: Sophie Brun <[email protected]> |
| 5 |
Origin: Kali Linux, https://gitlab.com/kalilinux/packages/bettercap/-/blob/b97175cfd96369ca42aa931ac08eba81444586f4/debian/patches/disable-install-update-caplets.patch |
| 6 |
Forwarded: not-needed |
| 7 |
Reviewed-By: Francisco Vilmar Cardoso Ruviaro <[email protected]> |
| 8 |
Last-Update: 2024-08-06 |
| 9 |
|
| 10 |
--- a/caplets/env.go |
| 11 |
+++ b/caplets/env.go |
| 12 |
@@ -19,7 +19,7 @@ func getDefaultInstallBase() string { |
| 13 |
if runtime.GOOS == "windows" { |
| 14 |
return filepath.Join(os.Getenv("ALLUSERSPROFILE"), "bettercap") |
| 15 |
} |
| 16 |
|
| 17 |
+ return "/usr/share/bettercap/" |
| 18 |
} |
| 19 |
|
| 20 |
func getUserHomeDir() string { |
| 21 |
|
| 22 |
--- a/modules/caplets/caplets.go |
| 23 |
+++ b/modules/caplets/caplets.go |
| 24 |
@@ -2,18 +2,13 @@ package caplets |
| 25 |
|
| 26 |
import ( |
| 27 |
"fmt" |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
"github.com/bettercap/bettercap/caplets" |
| 33 |
"github.com/bettercap/bettercap/session" |
| 34 |
|
| 35 |
"github.com/dustin/go-humanize" |
| 36 |
|
| 37 |
|
| 38 |
"github.com/evilsocket/islazy/tui" |
| 39 |
|
| 40 |
) |
| 41 |
|
| 42 |
type CapletsModule struct { |
| 43 |
@@ -36,12 +31,11 @@ func NewCapletsModule(s *session.Session) *CapletsModule { |
| 44 |
func(args []string) error { |
| 45 |
return mod.Paths() |
| 46 |
})) |
| 47 |
|
| 48 |
mod.AddHandler(session.NewModuleHandler("caplets.update", "", |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
+ "Install/updates the caplets.", |
| 54 |
+ func(args []string) error { |
| 55 |
+ return mod.Update() |
| 56 |
+ })) |
| 57 |
|
| 58 |
return mod |
| 59 |
} |
| 60 |
@@ -51,7 +45,7 @@ func (mod *CapletsModule) Name() string { |
| 61 |
} |
| 62 |
|
| 63 |
func (mod *CapletsModule) Description() string { |
| 64 |
|
| 65 |
+ return "A module to list caplets." |
| 66 |
} |
| 67 |
|
| 68 |
func (mod *CapletsModule) Author() string { |
| 69 |
@@ -73,7 +67,7 @@ func (mod *CapletsModule) Start() error { |
| 70 |
func (mod *CapletsModule) Show() error { |
| 71 |
caplets := caplets.List() |
| 72 |
if len(caplets) == 0 { |
| 73 |
|
| 74 |
+ return fmt.Errorf("no installed caplets on this system, in Debian install bettercap-caplets package") |
| 75 |
} |
| 76 |
|
| 77 |
colNames := []string{ |
| 78 |
@@ -113,38 +107,6 @@ func (mod *CapletsModule) Paths() error { |
| 79 |
} |
| 80 |
|
| 81 |
func (mod *CapletsModule) Update() error { |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
+ mod.Info("this command is inactive in Debian. Install the Debian package bettercap-caplets to get the caplets") |
| 117 |
+ return nil |
| 118 |
} |