class Rex::Post::Meterpreter::Ui::Console::CommandDispatcher::Lanattacks::Tftp

The TFTP portion of the lanattacks extension.

Constants

Klass

Public Instance Methods

cmd_tftp_add_file(*args) click to toggle source
# File lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb, line 136
def cmd_tftp_add_file(*args)
  @@tftp_add_file_opts.parse(args) { |opt, idx, val|
    case opt
    when '-h'
      print_tftp_add_file_usage
      return true
    end
  }

  name = args.shift

  print_status( "Adding file #{name} ..." )
  client.lanattacks.tftp.add_file(name, ::File.read(name))
  print_good( "File added." )
end
cmd_tftp_reset(*args) click to toggle source
# File lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb, line 113
def cmd_tftp_reset(*args)
  @@tftp_reset_opts.parse(args) { |opt, idx, val|
    case opt
    when '-h'
      print_tftp_reset_usage
      return true
    end
  }

  print_status( "Resetting TFTP server ..." )
  client.lanattacks.tftp.reset
  print_good( "TFTP server reset." )
end
cmd_tftp_start(*args) click to toggle source
# File lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb, line 67
def cmd_tftp_start(*args)
  @@tftp_start_opts.parse(args) { |opt, idx, val|
    case opt
    when '-h'
      print_tftp_start_usage
      return true
    end
  }

  print_status( "Starting TFTP server ..." )
  client.lanattacks.tftp.start
  print_good( "TFTP server startd." )
end
cmd_tftp_stop(*args) click to toggle source
# File lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb, line 90
def cmd_tftp_stop(*args)
  @@tftp_stop_opts.parse(args) { |opt, idx, val|
    case opt
    when '-h'
      print_tftp_stop_usage
      return true
    end
  }

  print_status( "Stopping TFTP server ..." )
  client.lanattacks.tftp.stop
  print_good( "TFTP server stopped." )
end
commands() click to toggle source

List of supported commands.

# File lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb, line 22
def commands
  all = {
    "tftp_start"    => "Start the TFTP server",
    "tftp_stop"     => "Stop the TFTP server",
    "tftp_reset"    => "Reset the TFTP server",
    "tftp_add_file" => "Add a file to the TFTP server"
  }

  reqs = {
    "tftp_start"    => [ "lanattacks_start_tftp" ],
    "tftp_stop"     => [ "lanattacks_stop_tftp" ],
    "tftp_reset"    => [ "lanattacks_reset_tftp" ],
    "tftp_add_file" => [ "lanattacks_add_tftp_file" ],
  }

  all.delete_if do |cmd, desc|
    del = false
    reqs[cmd].each do |req|
      next if client.commands.include? req
      del = true
      break
    end

    del
  end

  all
end
name() click to toggle source

Name for this dispatcher.

# File lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb, line 54
def name
  "Lanattacks: TFTP"
end
print_tftp_add_file_usage() click to toggle source
print_tftp_reset_usage() click to toggle source
print_tftp_start_usage() click to toggle source
print_tftp_stop_usage() click to toggle source