Class: Rex::Post::Meterpreter::Ui::Console::CommandDispatcher::Lanattacks::Tftp
Overview
The TFTP portion of the lanattacks extension.
Constant Summary
collapse
- Klass =
Console::CommandDispatcher::Lanattacks::Tftp
- @@tftp_start_opts =
Rex::Parser::Arguments.new(
"-h" => [ false, "Help banner." ])
- @@tftp_stop_opts =
Rex::Parser::Arguments.new(
"-h" => [ false, "Help banner." ])
- @@tftp_reset_opts =
Rex::Parser::Arguments.new(
"-h" => [ false, "Help banner." ])
- @@tftp_add_file_opts =
Rex::Parser::Arguments.new(
"-h" => [ false, "Help banner." ])
Extensions::Lanattacks::COMMAND_ID_LANATTACKS_ADD_TFTP_FILE, Extensions::Lanattacks::COMMAND_ID_LANATTACKS_DHCP_LOG, Extensions::Lanattacks::COMMAND_ID_LANATTACKS_RESET_DHCP, Extensions::Lanattacks::COMMAND_ID_LANATTACKS_RESET_TFTP, Extensions::Lanattacks::COMMAND_ID_LANATTACKS_SET_DHCP_OPTION, Extensions::Lanattacks::COMMAND_ID_LANATTACKS_START_DHCP, Extensions::Lanattacks::COMMAND_ID_LANATTACKS_START_TFTP, Extensions::Lanattacks::COMMAND_ID_LANATTACKS_STOP_DHCP, Extensions::Lanattacks::COMMAND_ID_LANATTACKS_STOP_TFTP, Extensions::Lanattacks::EXTENSION_ID_LANATTACKS, Extensions::Lanattacks::TLV_TYPE_LANATTACKS_OPTION, Extensions::Lanattacks::TLV_TYPE_LANATTACKS_OPTION_NAME, Extensions::Lanattacks::TLV_TYPE_LANATTACKS_RAW, Extensions::Lanattacks::TLV_TYPE_LANATTACKS_UINT
Instance Attribute Summary
#shell, #tab_complete_items
Instance Method Summary
collapse
check_hash, #client, #docs_dir, #filter_commands, #initialize, #log_error, #msf_loaded?, #session, set_hash, #unknown_command
#cmd_background, #cmd_background_help, #cmd_exit, #cmd_irb, #cmd_irb_help, #cmd_irb_tabs, #cmd_pry, #cmd_pry_help, #cmd_resource, #cmd_resource_help, #cmd_resource_tabs, #cmd_sessions, #cmd_sessions_help
#cmd_help, #cmd_help_help, #cmd_help_tabs, #deprecated_cmd, #deprecated_commands, #deprecated_help, #docs_dir, #help_to_s, included, #initialize, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #tab_complete_directory, #tab_complete_filenames, #tab_complete_generic, #tab_complete_source_address, #unknown_command, #update_prompt
Instance Method Details
#cmd_tftp_add_file(*args) ⇒ Object
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb', line 126
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) ⇒ Object
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb', line 103
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) ⇒ Object
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb', line 57
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 started." )
end
|
#cmd_tftp_stop(*args) ⇒ Object
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb', line 80
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 ⇒ Object
List of supported commands.
#name ⇒ Object
Name for this dispatcher.
44
45
46
|
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb', line 44
def name
'Lanattacks: TFTP'
end
|
#print_tftp_add_file_usage ⇒ Object
120
121
122
123
124
|
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb', line 120
def print_tftp_add_file_usage
print("tftp_add_file <file> [-h]\n\n" +
"Add a file to the currently running TFTP server.\n" +
@@tftp_add_file_opts.usage + "\n")
end
|
#print_tftp_reset_usage ⇒ Object
97
98
99
100
101
|
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb', line 97
def print_tftp_reset_usage
print("tftp_reset [-h]\n\n" +
"Resets the currently running TFTP server.\n" +
@@tftp_reset_opts.usage + "\n")
end
|
#print_tftp_start_usage ⇒ Object
51
52
53
54
55
|
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb', line 51
def print_tftp_start_usage
print("tftp_start [-h]\n\n" +
"Starts a TFTP server in the current Meterpreter session.\n" +
@@tftp_start_opts.usage + "\n")
end
|
#print_tftp_stop_usage ⇒ Object
74
75
76
77
78
|
# File 'lib/rex/post/meterpreter/ui/console/command_dispatcher/lanattacks/tftp.rb', line 74
def print_tftp_stop_usage
print("tftp_stop [-h]\n\n" +
"Stops the currently running TFTP server.\n" +
@@tftp_stop_opts.usage + "\n")
end
|