From d4198fdadbf02bab244b1b608c2b9d7ef1494cfc Mon Sep 17 00:00:00 2001 From: James Lee Date: Wed, 11 Sep 2013 14:04:28 -0500 Subject: [PATCH] Add a resource script for running session tests --- test/scripts/test-sessions.rc | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/scripts/test-sessions.rc diff --git a/test/scripts/test-sessions.rc b/test/scripts/test-sessions.rc new file mode 100644 index 0000000000..392210c83a --- /dev/null +++ b/test/scripts/test-sessions.rc @@ -0,0 +1,33 @@ +<% old_mod = active_module %> + +sessions -v + + +def run_for_session(modname, id) + print_line(modname) + run_single("use #{modname}") + run_single("set SESSION #{id}") + run_single("run") +end + +framework.sessions.each do |id, s| + if s.type == 'meterpreter' + run_for_session("post/test/meterpreter", id) + + if s.sys.config.sysinfo["OS"] =~ /win/in + run_for_session("post/test/registry", id) + run_for_session("post/test/services", id) + else + run_for_session("post/test/unix", id) + end + + if s.railgun + run_for_session("post/test/railgun_reverse_lookups", id) + end + end + run_for_session("post/test/file", id) +end + + +<%= old_mod ? "use #{old_mod.refname}" : "back" %> +