bettercap: fix uninitialized constant PacketFu::EthHeaderMixin

Today I was going to test bettercap from source and I ran into a rather nasty but quite popular issue:

<br />
$ sudo bettercap --help<br />
/usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.1b/lib/bettercap/spoofers/icmp.rb:24:in `&lt;class:ICMPRedirectPacket&gt;': uninitialized constant PacketFu::EthHeaderMixin (NameError)<br />
from /usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.1b/lib/bettercap/spoofers/icmp.rb:17:in `&lt;module:Spoofers&gt;'<br />
from /usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.1b/lib/bettercap/spoofers/icmp.rb:15:in `&lt;module:BetterCap&gt;'<br />
from /usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.1b/lib/bettercap/spoofers/icmp.rb:14:in `&lt;top (required)&gt;'<br />
from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'<br />
from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'<br />
from /usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.1b/lib/bettercap.rb:58:in `block in bettercap_autoload'<br />
from /usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.1b/lib/bettercap.rb:57:in `each'<br />
from /usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.1b/lib/bettercap.rb:57:in `bettercap_autoload'<br />
from /usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.1b/lib/bettercap.rb:62:in `&lt;top (required)&gt;'<br />
from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'<br />
from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'<br />
from /usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.1b/bin/bettercap:19:in `&lt;top (required)&gt;'<br />
from /usr/local/bin/bettercap:22:in `load'<br />
from /usr/local/bin/bettercap:22:in `&lt;main&gt;'</p>
<p>

That uninitialized constant PacketFu::EthHeaderMixin is a popular error if you look in bettercap’s issue tracker, and among all it’s hard to find the correct solution! But thanks to evilsocket himself I was led to the correct fix.

The problem has been identified in issue 379 in packetfu > 1.1.11, which it’s apparently that’s the last compatible version. In order to clean up broken previous versions of both bettercap and packetfu I removed the following directories (this is for MacOS, may vary in *Linux):

  • /usr/local/lib/ruby/gems/2.4.0/gems/bettercap-1.6.*
  • /usr/local/lib/ruby/gems/2.4.0/gems/packetfu-1.1*

Then I proceeded with the normal installation, with a specific packetfu version:

<br />
gem install packetfu -v 1.1.11<br />
git clone https://github.com/evilsocket/bettercap<br />
cd bettercap<br />
gem build bettercap.gemspec<br />
sudo gem install bettercap*.gem<br />

and everything worked!

 

Image credit: bettercap’s twitter

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Solve : *
1 × 28 =


Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.