WIP: First stab at creds add-* subcommands

bug/bundler_fix
James Lee 2014-07-22 02:05:55 -05:00
parent 9db951cadc
commit 2013e28608
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
1 changed files with 37 additions and 0 deletions

View File

@ -18,6 +18,8 @@ class Db
# TODO: Not thrilled about including this entire module for just store_local.
include Msf::Auxiliary::Report
include Metasploit::Credential::Creation
#
# The dispatcher's name.
#
@ -668,6 +670,25 @@ class Db
print_line
end
def creds_add(private_type, *args)
username, password, realm = args.pop(3)
cred_data = {
username: username,
private_data: password,
private_type: private_type,
workspace_id: framework.db.workspace,
}
if realm
cred_data.merge(
realm_value: realm,
realm_key: Metasploit::Model::Realm::Key::ACTIVE_DIRECTORY_DOMAIN
)
end
$stderr.puts("Your mom")
create_credential(cred_data)
end
#
# Can return return active or all, on a certain host or range, on a
# certain port or range, and/or on a service name.
@ -690,6 +711,22 @@ class Db
return
end
subcommand = args.shift
case subcommand
when "add-ntlm"
creds_add(:ntlm_hash, *args)
return
when "add-password"
creds_add(:password, *args)
return
when "add-hash"
creds_add(:non_replayable_hash, *args)
return
else
# then it's not actually a subcommand
args.unshift(subcommand)
end
while (arg = args.shift)
case arg
when "-h"