root@treehouses:~# sudo apt install golang git build-essential libpcap-dev libusb-1.0-0-dev libnetfilter-queue-dev Reading package lists... Done Building dependency tree Reading state information... Done build-essential is already the newest version (12.6). git is already the newest version (1:2.20.1-2). The following package was automatically installed and is no longer required: point-rpi Use 'sudo apt autoremove' to remove it. The following additional packages will be installed: golang-1.11 golang-1.11-doc golang-1.11-go golang-1.11-src golang-doc golang-go golang-src libnfnetlink-dev libpcap0.8-dev libusb-1.0-doc Suggested packages: bzr | brz mercurial subversion The following NEW packages will be installed: golang golang-1.11 golang-1.11-doc golang-1.11-go golang-1.11-src golang-doc golang-go golang-src libnetfilter-queue-dev libnfnetlink-dev libpcap-dev libpcap0.8-dev libusb-1.0-0-dev libusb-1.0-doc 0 upgraded, 14 newly installed, 0 to remove and 53 not upgraded. Need to get 52.4 MB of archives. After this operation, 260 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf golang-1.11-src armhf 1.11.6-1+rpi1+deb10u2 [13.0 MB] Get:2 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf golang-1.11-go armhf 1.11.6-1+rpi1+deb10u2 [36.3 MB] Get:3 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf golang-1.11-doc all 1.11.6-1+rpi1+deb10u2 [2,517 kB] Get:4 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf golang-1.11 all 1.11.6-1+rpi1+deb10u2 [24.1 kB] Get:5 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf golang-src armhf 2:1.11~1+b6 [4,660 B] Get:6 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf golang-go armhf 2:1.11~1+b6 [23.7 kB] Get:7 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf golang-doc all 2:1.11~1 [4,392 B] Get:8 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf golang armhf 2:1.11~1+b6 [4,612 B] Get:9 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf libnfnetlink-dev armhf 1.0.1-3 [7,928 B] Get:10 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf libnetfilter-queue-dev armhf 1.0.3-1 [6,548 B] Get:11 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf libpcap0.8-dev armhf 1.8.1-6 [220 kB] Get:12 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf libpcap-dev armhf 1.8.1-6 [25.9 kB] Get:13 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf libusb-1.0-0-dev armhf 2:1.0.22-2 [65.5 kB] Get:14 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf libusb-1.0-doc all 2:1.0.22-2 [182 kB] Fetched 52.4 MB in 23s (2,250 kB/s) Selecting previously unselected package golang-1.11-src. (Reading database ... 154643 files and directories currently installed.) Preparing to unpack .../00-golang-1.11-src_1.11.6-1+rpi1+deb10u2_armhf.deb ... Unpacking golang-1.11-src (1.11.6-1+rpi1+deb10u2) ... Selecting previously unselected package golang-1.11-go. Preparing to unpack .../01-golang-1.11-go_1.11.6-1+rpi1+deb10u2_armhf.deb ... Unpacking golang-1.11-go (1.11.6-1+rpi1+deb10u2) ... Selecting previously unselected package golang-1.11-doc. Preparing to unpack .../02-golang-1.11-doc_1.11.6-1+rpi1+deb10u2_all.deb ... Unpacking golang-1.11-doc (1.11.6-1+rpi1+deb10u2) ... Selecting previously unselected package golang-1.11. Preparing to unpack .../03-golang-1.11_1.11.6-1+rpi1+deb10u2_all.deb ... Unpacking golang-1.11 (1.11.6-1+rpi1+deb10u2) ... Selecting previously unselected package golang-src. Preparing to unpack .../04-golang-src_2%3a1.11~1+b6_armhf.deb ... Unpacking golang-src (2:1.11~1+b6) ... Selecting previously unselected package golang-go. Preparing to unpack .../05-golang-go_2%3a1.11~1+b6_armhf.deb ... Unpacking golang-go (2:1.11~1+b6) ... Selecting previously unselected package golang-doc. Preparing to unpack .../06-golang-doc_2%3a1.11~1_all.deb ... Unpacking golang-doc (2:1.11~1) ... Selecting previously unselected package golang. Preparing to unpack .../07-golang_2%3a1.11~1+b6_armhf.deb ... Unpacking golang (2:1.11~1+b6) ... Selecting previously unselected package libnfnetlink-dev. Preparing to unpack .../08-libnfnetlink-dev_1.0.1-3_armhf.deb ... Unpacking libnfnetlink-dev (1.0.1-3) ... Selecting previously unselected package libnetfilter-queue-dev. Preparing to unpack .../09-libnetfilter-queue-dev_1.0.3-1_armhf.deb ... Unpacking libnetfilter-queue-dev (1.0.3-1) ... Selecting previously unselected package libpcap0.8-dev:armhf. Preparing to unpack .../10-libpcap0.8-dev_1.8.1-6_armhf.deb ... Unpacking libpcap0.8-dev:armhf (1.8.1-6) ... Selecting previously unselected package libpcap-dev:armhf. Preparing to unpack .../11-libpcap-dev_1.8.1-6_armhf.deb ... Unpacking libpcap-dev:armhf (1.8.1-6) ... Selecting previously unselected package libusb-1.0-0-dev:armhf. Preparing to unpack .../12-libusb-1.0-0-dev_2%3a1.0.22-2_armhf.deb ... Unpacking libusb-1.0-0-dev:armhf (2:1.0.22-2) ... Selecting previously unselected package libusb-1.0-doc. Preparing to unpack .../13-libusb-1.0-doc_2%3a1.0.22-2_all.deb ... Unpacking libusb-1.0-doc (2:1.0.22-2) ... Setting up libnfnetlink-dev (1.0.1-3) ... Setting up golang-1.11-src (1.11.6-1+rpi1+deb10u2) ... Setting up libpcap0.8-dev:armhf (1.8.1-6) ... Setting up libusb-1.0-doc (2:1.0.22-2) ... Setting up libusb-1.0-0-dev:armhf (2:1.0.22-2) ... Setting up golang-1.11-go (1.11.6-1+rpi1+deb10u2) ... Setting up libnetfilter-queue-dev (1.0.3-1) ... Setting up golang-src (2:1.11~1+b6) ... Setting up libpcap-dev:armhf (1.8.1-6) ... Setting up golang-1.11-doc (1.11.6-1+rpi1+deb10u2) ... Setting up golang-go (2:1.11~1+b6) ... Setting up golang-1.11 (1.11.6-1+rpi1+deb10u2) ... Setting up golang-doc (2:1.11~1) ... Setting up golang (2:1.11~1+b6) ... Processing triggers for man-db (2.8.5-2) ...
next
1
root@treehouses:~# go get -u github.com/bettercap/bettercap
Once the build process is concluded, the binary will be located in go/bin/bettercap I checked the go/bin/bettercap
1 2
root@treehouses:~# which go/bin/bettercap go/bin/bettercap
start bettercap
need to make sure bettercap command under /usr/bin
1 2 3
root@treehouses:~# cp go/bin/bettercap /usr/bin root@treehouses:~# which bettercap /usr/bin/bettercap
run following command
1 2 3 4 5 6 7 8 9 10
root@treehouses:~# bettercap -eval "caplets.update; ui.update; q" bettercap v2.26.1 (built for linux arm with go1.11.6) [type 'help' for a list of commands]
[00:07:08] [sys.log] [inf] caplets creating caplets install path /usr/local/share/bettercap/ ... [00:07:08] [sys.log] [inf] caplets downloading caplets from https://github.com/bettercap/caplets/archive/master.zip ... [00:07:10] [sys.log] [inf] caplets installing caplets to /usr/local/share/bettercap/caplets ... [00:07:10] [sys.log] [inf] ui checking latest stable release ... [00:07:10] [sys.log] [inf] ui downloading ui v1.3.0 from https://github.com/bettercap/ui/releases/download/v1.3.0/ui.zip ... [00:07:14] [sys.log] [inf] ui installing to /usr/local/share/bettercap/ui ... [00:07:18] [sys.log] [inf] ui installation complete, you can now run the http-ui (or https-ui) caplet to start the UI.
Inorder to login to web UI, I need do check this first
root@treehouses:~ $ cat /usr/local/share/bettercap/caplets/https-ui.cap # api listening on https://0.0.0.0:8083/ and ui on https://0.0.0.0 set api.rest.address 0.0.0.0 set api.rest.port 8083 set https.server.address 0.0.0.0 set https.server.port 443
## make sure both use the same https certificate so api requests won't fail set https.server.certificate ~/.bettercap-https.cert.pem set https.server.key ~/.bettercap-https.key.pem set api.rest.certificate ~/.bettercap-https.cert.pem set api.rest.key ~/.bettercap-https.key.pem # default installation path of the ui set https.server.path /usr/local/share/bettercap/ui
# !!! CHANGE THESE !!! set api.rest.username user set api.rest.password pass
# go! api.rest on https.server on
start bettercap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
root@treehouses:~# bettercap -caplet https-ui bettercap v2.26.1 (built for linux arm with go1.11.6) [type 'help' for a list of commands]