Class: Ownlan::Manual::Broadcast

Inherits:
Object
  • Object
show all
Defined in:
lib/ownlan/manual/broadcast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Broadcast

Returns a new instance of Broadcast.



7
8
9
# File 'lib/ownlan/manual/broadcast.rb', line 7

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



5
6
7
# File 'lib/ownlan/manual/broadcast.rb', line 5

def config
  @config
end

#crafted_packetObject (readonly)

Returns the value of attribute crafted_packet.



5
6
7
# File 'lib/ownlan/manual/broadcast.rb', line 5

def crafted_packet
  @crafted_packet
end

Instance Method Details

#generate_packetObject



17
18
19
20
21
22
23
24
25
# File 'lib/ownlan/manual/broadcast.rb', line 17

def generate_packet
  saddr    = config.source_mac
  daddr    = config.victim_mac
  saddr_ip = config.source_ip
  daddr_ip = config.victim_ip


  @crafted_packet = packet_craft(saddr, daddr, saddr_ip, daddr_ip).call
end

#processObject



11
12
13
14
15
# File 'lib/ownlan/manual/broadcast.rb', line 11

def process
  generate_packet

  send_packet
end