7 Compilation on Linux and macOS
evilsocket edited this page 2019-02-21 15:08:01 +01:00

Make sure you have a correctly configured Go >= 1.8 environment, that $GOPATH/bin is in $PATH and the libusb-1.0, 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 (0x00007ffdbb9f6000)
libpcap.so.0.8 => /usr/lib/x86_64-linux-gnu/libpcap.so.0.8 (0x00007f740925b000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7409057000)
libnetfilter_queue.so.1 => /usr/lib/x86_64-linux-gnu/libnetfilter_queue.so.1 (0x00007f7408e50000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7408c31000)
libusb-1.0.so.0 => /lib/x86_64-linux-gnu/libusb-1.0.so.0 (0x00007f7408a19000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7408628000)
/lib64/ld-linux-x86-64.so.2 (0x00007f740949c000)
libnfnetlink.so.0 => /usr/lib/x86_64-linux-gnu/libnfnetlink.so.0 (0x00007f7408421000)
libmnl.so.0 => /lib/x86_64-linux-gnu/libmnl.so.0 (0x00007f740821b000)
libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007f7407ffd000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7407df5000)

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.