Class: BetterCap::Spoofers::MAC
- Defined in:
- lib/bettercap/spoofers/mac.rb
Overview
Instance Method Summary collapse
-
#initialize ⇒ MAC
constructor
Initialize the BetterCap::Spoofers::MAC object.
-
#start ⇒ Object
Start the MAC spoofing.
-
#stop ⇒ Object
Stop the MAC spoofing.
Methods inherited from Base
available, get_by_name, inherited
Constructor Details
#initialize ⇒ MAC
Initialize the BetterCap::Spoofers::MAC object.
45 46 47 48 49 50 51 |
# File 'lib/bettercap/spoofers/mac.rb', line 45 def initialize @ctx = Context.get @flood_thread = nil @running = false update_gateway! end |
Instance Method Details
#start ⇒ Object
Start the MAC spoofing
54 55 56 57 58 59 60 61 |
# File 'lib/bettercap/spoofers/mac.rb', line 54 def start Logger.debug 'Starting MAC spoofer ...' stop() if @running @running = true @flood_thread = Thread.new { mac_flood } end |
#stop ⇒ Object
Stop the MAC spoofing
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/bettercap/spoofers/mac.rb', line 64 def stop raise 'MAC spoofer is not running' unless @running Logger.debug 'Stopping MAC spoofer ...' @running = false begin @flood_thread.exit rescue end end |