Multi Manage Post Module Macro Execution - Metasploit
This page contains detailed information about how to use the post/multi/manage/multi_post metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Multi Manage Post Module Macro Execution
Module: post/multi/manage/multi_post
Source code: modules/post/multi/manage/multi_post.rb
Disclosure date: -
Last modification time: 2020-12-23 11:36:38 +0000
Supported architecture(s): -
Supported platform(s): Linux, OSX, Solaris, Unix, Windows
Target service / protocol: -
Target network port(s): -
List of CVEs: -
This module will execute a list of modules given in a macro file in the format of <module> <opt=val,opt=val> against the select session checking for compatibility of the module against the sessions and validation of the options provided.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
There are two ways to execute this post module.
From the Meterpreter prompt
The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post module against that specific session:
meterpreter > run post/multi/manage/multi_post
From the msf prompt
The second is by using the "use" command at the msf prompt. You will have to figure out which session ID to set manually. To list all session IDs, you can use the "sessions" command.
msf > use post/multi/manage/multi_post
msf post(multi_post) > show options
... show and set options ...
msf post(multi_post) > set SESSION session-id
msf post(multi_post) > exploit
If you wish to run the post against all sessions from framework, here is how:
1 - Create the following resource script:
framework.sessions.each_pair do |sid, session|
run_single("use post/multi/manage/multi_post")
run_single("set SESSION #{sid}")
run_single("run")
end
2 - At the msf prompt, execute the above resource script:
msf > resource path-to-resource-script
Required Options
SESSION: The session to run this module on.
MACRO: File with Post Modules and Options to run in the session
Go back to menu.
Msfconsole Usage
Here is how the multi/manage/multi_post post exploitation module looks in the msfconsole:
msf6 > use post/multi/manage/multi_post
msf6 post(multi/manage/multi_post) > show info
Name: Multi Manage Post Module Macro Execution
Module: post/multi/manage/multi_post
Platform: Linux, OSX, Solaris, Unix, Windows
Arch:
Rank: Normal
Provided by:
carlos_perez <[email protected]>
Compatible session types:
Meterpreter
Shell
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
MACRO yes File with Post Modules and Options to run in the session
SESSION yes The session to run this module on.
Description:
This module will execute a list of modules given in a macro file in
the format of <module> <opt=val,opt=val> against the select session
checking for compatibility of the module against the sessions and
validation of the options provided.
Module Options
This is a complete list of options available in the multi/manage/multi_post post exploitation module:
msf6 post(multi/manage/multi_post) > show options
Module options (post/multi/manage/multi_post):
Name Current Setting Required Description
---- --------------- -------- -----------
MACRO yes File with Post Modules and Options to run in the session
SESSION yes The session to run this module on.
Advanced Options
Here is a complete list of advanced options supported by the multi/manage/multi_post post exploitation module:
msf6 post(multi/manage/multi_post) > show advanced
Module advanced options (post/multi/manage/multi_post):
Name Current Setting Required Description
---- --------------- -------- -----------
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Post Actions
This is a list of all post exploitation actions which the multi/manage/multi_post module can do:
msf6 post(multi/manage/multi_post) > show actions
Post actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the multi/manage/multi_post post exploitation module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 post(multi/manage/multi_post) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
Running module against <COMPUTER>
Here is a relevant code snippet related to the "Running module against <COMPUTER>" error message:
28: end
29:
30: # Run Method for when run command is issued
31: def run
32: # syinfo is only on meterpreter sessions
33: print_status("Running module against #{sysinfo['Computer']}") if not sysinfo.nil?
34: macro = datastore['MACRO']
35: entries = []
36: if not ::File.exist?(macro)
37: print_error "Resource File does not exist!"
38: return
Resource File does not exist!
Here is a relevant code snippet related to the "Resource File does not exist!" error message:
32: # syinfo is only on meterpreter sessions
33: print_status("Running module against #{sysinfo['Computer']}") if not sysinfo.nil?
34: macro = datastore['MACRO']
35: entries = []
36: if not ::File.exist?(macro)
37: print_error "Resource File does not exist!"
38: return
39: else
40: ::File.open(datastore['MACRO'], "rb").each_line do |line|
41: # Empty line
42: next if line.strip.length < 1
Post module <POST_MOD> could not be initialized!
Here is a relevant code snippet related to the "Post module <POST_MOD> could not be initialized!" error message:
60: end
61: m = framework.post.create(post_mod)
62:
63: # Check if a post module was actually initiated
64: if m.nil?
65: print_error("Post module #{post_mod} could not be initialized!")
66: next
67: end
68: # Set the current session
69: s = datastore['SESSION']
70:
Session <S> is not compatible with <POST_MOD>
Here is a relevant code snippet related to the "Session <S> is not compatible with <POST_MOD>" error message:
82: m.run_simple(
83: 'LocalInput' => self.user_input,
84: 'LocalOutput' => self.user_output
85: )
86: else
87: print_error("Session #{s} is not compatible with #{post_mod}")
88: end
89:
90: end
91: else
92: print_error("Resource file was empty!")
Resource file was empty!
Here is a relevant code snippet related to the "Resource file was empty!" error message:
85: )
86: else
87: print_error("Session #{s} is not compatible with #{post_mod}")
88: end
89:
90: end
91: else
92: print_error("Resource file was empty!")
93: end
94: end
95: end
Go back to menu.
Related Pull Requests
- #14542 Merged Pull Request: Linguistic fixes of 'does not exists'
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6795 Merged Pull Request: File.exists? must die
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #2525 Merged Pull Request: Change module boilerplate
- #2417 Merged Pull Request: Prefer Ruby style for single word collections
- #2304 Merged Pull Request: Fix load order in posts, hopefully forever
- #1241 Merged Pull Request: Removed all $Id$ and $Revision$ occurences
- #958 Merged Pull Request: Msftidy 2
- #951 Merged Pull Request: Infohash cleanups
Go back to menu.
See Also
Check also the following modules related to this module:
- post/multi/manage/autoroute
- post/multi/manage/dbvis_add_db_admin
- post/multi/manage/dbvis_query
- post/multi/manage/fileshare
- post/multi/manage/hsts_eraser
- post/multi/manage/open
- post/multi/manage/play_youtube
- post/multi/manage/record_mic
- post/multi/manage/screensaver
- post/multi/manage/screenshare
- post/multi/manage/set_wallpaper
- post/multi/manage/shell_to_meterpreter
- post/multi/manage/sudo
- post/multi/manage/system_session
- post/multi/manage/upload_exec
- post/multi/manage/zip
Authors
- <carlos_perez[at]darkoperator.com>
Version
This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.