Compilation on Linux and macOS - rhaidiz/bettercap GitHub Wiki

Make sure you have a correctly configured Go >= 1.8 environment, that $GOPATH/bin is in $PATH and the libpcap-dev package installed for your system, otherwise you can compile it from sources with:

$ wget https://www.tcpdump.org/release/libpcap-1.8.1.tar.gz
$ tar xvf libpcap-1.8.1.tar.gz && cd libpcap-1.8.1
$ ./configure --prefix=/usr --disable-optimizer-dbg --disable-yydebug --disable-bluetooth --disable-dbus --without-libnl --without-dag --without-septel --without-snf --without-turbocap
$ make -j4
$ sudo make install

Then you can just:

$ go get github.com/bettercap/bettercap

This command will download bettercap, install its dependencies, compile it and move the bettercap executable to $GOPATH/bin, the binary will have the following runtime dependencies:

$ ldd $GOPATH/bin/bettercap
     
linux-vdso.so.1 =>  (0x00007fff6c3d3000)
libpcap.so.1 => /usr/lib/libpcap.so.1 (0x00007f424ddef000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f424dbd0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f424d7f0000)
/lib64/ld-linux-x86-64.so.2 (0x00007f424e030000)

Now you can use sudo bettercap -h to show the basic command line options and just sudo bettercap to start an interactive session on your default network interface.