Add a meterpreter test for enumerating core commands
This commit is contained in:
parent
998b38cf0d
commit
7cf5879836
|
@ -104,6 +104,7 @@ class ClientCore < Extension
|
|||
def get_loaded_extension_commands(extension)
|
||||
request = Packet.create_request(COMMAND_ID_CORE_ENUMEXTCMD)
|
||||
|
||||
# handle 'core' as a special case since it's not a typical extension
|
||||
extension = EXTENSION_ID_CORE if extension == 'core'
|
||||
extension = Rex::Post::Meterpreter::ExtensionMapper.get_extension_id(extension) unless extension.is_a? Integer
|
||||
request.add_tlv(TLV_TYPE_UINT, extension)
|
||||
|
|
|
@ -47,6 +47,19 @@ class MetasploitModule < Msf::Post
|
|||
super
|
||||
end
|
||||
|
||||
def test_core_command_id_enumeration
|
||||
commands = []
|
||||
|
||||
it "should enumerate supported core commands" do
|
||||
commands.concat(session.core.get_loaded_extension_commands('core'))
|
||||
!commands.empty?
|
||||
end
|
||||
|
||||
# 3 is arbitrary, but it's probably a good bare minimum to include enumextcmd, machine_id, and loadlib
|
||||
it "should support 3 or more core commands" do
|
||||
commands.length >= 3
|
||||
end
|
||||
end
|
||||
|
||||
def test_sys_process
|
||||
vprint_status("Starting process tests")
|
||||
|
|
Loading…
Reference in New Issue