In my humble opinion Bettercap is the ultimate Man-In-The-Middle (MITM) solution: let's discover how to unleash its full potential on the Raspberry Pi.
This first step could be optional (I'll explain it later) but let's do it anyway... just type:
sudo apt-get install build-essential ruby-dev libpcap-dev
Before installing bettercap on the Pi, we first need to update the Ruby distribution (1.2) that comes with Raspbian Jessie, because it's too old for bettercap to work properly. To do this we can simply take advantage of the next Raspbian distribution that is currently under developement, Stretch: it provides Ruby 2.3.
Simply follow this Stack Exchange post that explains how to add the Stretch repository to your Jessie distribution, then type:
sudo apt-get install ruby -t stretch
Next step is to install from Stretch another couple of packages that will help us compile bettercap:
sudo apt-get install ruby-dev libpcap-dev -t stretch
These are the same packages we've installed in the first step, but they will be updated accordingly to the new Ruby version we've just installed: fortunately I've discovered that, in our case, the huge
build-essential package (~500Mb!) is not needed, even if its installation is suggested on the official bettercap github page. That's perhaps because we've already installed it on the aforementioned first step ;)
If you'll try to install bettercap now, you will almost surely encounter at least one compile error regarding the packetfu package: this is caused by some compatibility issues with the last version (1.1.12).
Thanks to this useful post we proceed to install a specific packetfu version:
sudo gem install packetfu -v 1.1.11
Finally, we can install bettercap in all its glory, issuing the following command:
sudo gem install bettercap