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

Constructor Details

#initializeNone

Initialize the non-spoofing class.


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

def initialize
  Logger.warn 'Spoofing disabled.'

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

  update_gateway!
end

Instance Method Details

#startObject

Start the “NONE” spoofer.


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

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

  @thread = Thread.new { fake_spoofer }
end

#stopObject

Stop the “NONE” spoofer.


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

def stop
  return unless @running

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