added option deregistration, kinda lame, need to think of a better way
git-svn-id: file:///home/svn/incoming/trunk@2723 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
1237b31617
commit
543dce4684
|
@ -195,6 +195,17 @@ protected
|
|||
self.datastore.import_options(self.options)
|
||||
end
|
||||
|
||||
#
|
||||
# Removes the supplied options from the module's option container
|
||||
# and data store
|
||||
#
|
||||
def deregister_options(*names)
|
||||
names.each { |name|
|
||||
self.options.remove_option(name)
|
||||
self.datastore.delete(name)
|
||||
}
|
||||
end
|
||||
|
||||
#
|
||||
# Checks to see if a derived instance of a given module implements a method
|
||||
# beyond the one that is provided by a base class. This is a pretty lame
|
||||
|
|
|
@ -215,6 +215,13 @@ class OptionContainer < Hash
|
|||
return false
|
||||
end
|
||||
|
||||
#
|
||||
# Removes an option
|
||||
#
|
||||
def remove_option(name)
|
||||
delete(name)
|
||||
end
|
||||
|
||||
# Adds one or more options
|
||||
def add_options(opts, owner = nil, advanced = false)
|
||||
return false if (opts == nil)
|
||||
|
|
|
@ -5,6 +5,9 @@ module Payloads
|
|||
module Singles
|
||||
module Windows
|
||||
|
||||
module Exec
|
||||
end
|
||||
|
||||
###
|
||||
#
|
||||
# AddUser
|
||||
|
@ -15,7 +18,7 @@ module Windows
|
|||
###
|
||||
module AddUser
|
||||
|
||||
include Msf::Payloads::Singles::Windows::Exec
|
||||
include Exec
|
||||
|
||||
def initialize(info = {})
|
||||
super(update_info(info,
|
||||
|
@ -34,6 +37,9 @@ module AddUser
|
|||
OptString.new('USER', [ true, "The username to create", "metasploit" ]),
|
||||
OptString.new('PASS', [ true, "The password for this user", "" ]),
|
||||
], Msf::Payloads::Singles::Windows::Exec)
|
||||
|
||||
# Hide the CMD option...this is kinda ugly
|
||||
deregister_options('CMD')
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue