2011-01-06 18:26:14 +00:00
|
|
|
module MsfTest
|
|
|
|
module MeterpreterSpecs
|
|
|
|
|
|
|
|
def self.included(base)
|
|
|
|
base.class_eval do
|
|
|
|
|
|
|
|
it "should not error when running help" do
|
|
|
|
success_strings = [ 'Core Commands',
|
|
|
|
'Stdapi: File system Commands',
|
|
|
|
'Stdapi: Networking Commands',
|
|
|
|
'Stdapi: System Commands',
|
|
|
|
'Stdapi: User interface Commands',
|
|
|
|
'Priv: Elevate Commands',
|
|
|
|
'Priv: Password database Commands',
|
|
|
|
'Priv: Timestomp Commands' ]
|
|
|
|
|
|
|
|
hlp_run_command_check_output("help","help", success_strings)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should not error when running the help shortcut" do
|
|
|
|
success_strings = [ 'Core Commands',
|
|
|
|
'Stdapi: File system Commands',
|
|
|
|
'Stdapi: Networking Commands',
|
|
|
|
'Stdapi: System Commands',
|
|
|
|
'Stdapi: User interface Commands',
|
|
|
|
'Priv: Elevate Commands',
|
|
|
|
'Priv: Password database Commands',
|
|
|
|
'Priv: Timestomp Commands' ]
|
|
|
|
|
|
|
|
hlp_run_command_check_output("help_shortcut","?", success_strings)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should not error when taking a screenshot" do
|
|
|
|
success_strings = [ 'Screenshot saved to' ]
|
|
|
|
hlp_run_command_check_output("screenshot","screenshot", success_strings)
|
|
|
|
end
|
|
|
|
|
2011-01-06 19:07:24 +00:00
|
|
|
it "should not error when running each command" do
|
2011-01-06 18:26:14 +00:00
|
|
|
commands = [ "?",
|
|
|
|
"background",
|
|
|
|
"bgkill",
|
|
|
|
"bglist",
|
|
|
|
"bgrun",
|
|
|
|
"channel",
|
|
|
|
"close",
|
|
|
|
"exit",
|
|
|
|
"help",
|
|
|
|
"interact",
|
|
|
|
#"irb",
|
|
|
|
"migrate",
|
|
|
|
#"quit",
|
|
|
|
"read",
|
|
|
|
"run",
|
|
|
|
"use",
|
|
|
|
"write",
|
|
|
|
"cat",
|
|
|
|
"cd",
|
|
|
|
"del",
|
|
|
|
"download",
|
|
|
|
#"edit",
|
|
|
|
"getlwd",
|
|
|
|
"getwd",
|
|
|
|
"lcd",
|
|
|
|
"lpwd",
|
|
|
|
"ls",
|
|
|
|
"mkdir",
|
|
|
|
"pwd",
|
|
|
|
"rm",
|
|
|
|
"rmdir",
|
|
|
|
"search",
|
|
|
|
"upload",
|
|
|
|
"ipconfig",
|
|
|
|
"portfwd",
|
|
|
|
"route",
|
|
|
|
"clearev",
|
|
|
|
"drop_token",
|
|
|
|
"execute",
|
|
|
|
"getpid",
|
|
|
|
"getprivs",
|
|
|
|
"getuid",
|
|
|
|
"kill",
|
|
|
|
"ps",
|
|
|
|
#"reboot",
|
|
|
|
"reg",
|
|
|
|
"rev2self",
|
2011-01-06 19:07:24 +00:00
|
|
|
#"shell",
|
2011-01-06 18:26:14 +00:00
|
|
|
#"shutdown",
|
|
|
|
"steal_token",
|
|
|
|
"sysinfo",
|
|
|
|
"enumdesktops",
|
|
|
|
"getdesktop",
|
|
|
|
"idletime",
|
|
|
|
"keyscan_dump",
|
|
|
|
"keyscan_start",
|
|
|
|
"keyscan_stop",
|
|
|
|
"screenshot",
|
|
|
|
"setdesktop",
|
|
|
|
"uictl",
|
|
|
|
"getsystem",
|
|
|
|
"hashdump",
|
|
|
|
"timestomp"
|
|
|
|
]
|
|
|
|
|
|
|
|
## Run each command, check for execeptions
|
|
|
|
commands.each do |command|
|
2011-01-06 19:07:24 +00:00
|
|
|
hlp_run_command_check_output("#{command}_basic",command)
|
2011-01-06 18:26:14 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should not error when checking for background channels" do
|
|
|
|
success_strings = [ 'No active channels.' ]
|
|
|
|
hlp_run_command_check_output("channel_list_empty","channel -l", success_strings)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|