Land #10162, tab completion for audio output

4.x 4.16.61
Tim W 2018-06-14 14:56:23 +08:00 committed by Metasploit
parent e78715b073
commit 972e89b2d7
No known key found for this signature in database
GPG Key ID: CDFB5FA52007B954
1 changed files with 8 additions and 21 deletions

View File

@ -39,34 +39,21 @@ class Console::CommandDispatcher::Stdapi::AudioOutput
end
def cmd_play(*args)
audio_path = nil
play_start_opts = Rex::Parser::Arguments.new(
'-h' => [ false, "Help Banner" ],
'-f' => [ true, "The audio file path (warning: will be copied to memory)" ]
)
play_start_opts.parse(args) do |opt, _idx, val|
case opt
when '-h'
print_line('Usage: audio_play [options]\n')
print_line('Upload file to targets memory and play it from memory')
print_line(play_start_opts.usage)
return
when '-f'
audio_path = val
end
end
if audio_path == nil
print_line('Please specify a path to an audio file via the -f option or use -h')
if args.length == 0
print_line('Please specify a path to an audio file')
return
end
audio_path = args[0]
print_status("Playing #{audio_path}...")
client.audio_output.play_file(audio_path)
print_status('Done')
end
def cmd_play_tabs(str, words)
tab_complete_filenames(str, words)
end
end
end