Class: BetterCap::Spoofers::None

Inherits:
Base
  • Object
show all
Defined in:
lib/bettercap/spoofers/none.rb

Overview

Dummy class used to disable spoofing.

Instance Method Summary collapse

Methods inherited from Base

available, get_by_name, inherited

Constructor Details

#initializeNone

Initialize the non-spoofing class.



19
20
21
22
23
24
25
26
27
# File 'lib/bettercap/spoofers/none.rb', line 19

def initialize
  Logger.debug 'Spoofing disabled.'

  @ctx     = Context.get
  @thread  = nil
  @running = false

  update_gateway!
end

Instance Method Details

#startObject

Start the “NONE” spoofer.



30
31
32
33
34
35
# File 'lib/bettercap/spoofers/none.rb', line 30

def start
  stop() if @running
  @running = true

  @thread = Thread.new { fake_spoofer }
end

#stopObject

Stop the “NONE” spoofer.



38
39
40
41
42
43
44
45
46
# File 'lib/bettercap/spoofers/none.rb', line 38

def stop
  return unless @running

  @running = false
  begin
    @thread.exit
  rescue
  end
end