metasploit-framework/data/markdown_doc/post_demo_template.erb

40 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-02-18 18:19:25 +00:00
There are two ways to execute this post module.
2016-02-18 06:17:32 +00:00
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 <%= mod.fullname %>
```
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 <%= mod.fullname %>
msf <%= mod.type %>(<%= mod.shortname %>) > show options
... show and set options ...
msf <%= mod.type %>(<%= mod.shortname %>) > set SESSION session-id
msf <%= mod.type %>(<%= mod.shortname %>) > exploit
```
2016-02-18 18:19:25 +00:00
If you wish to run the post against all sessions from framework, here is how:
2016-02-18 06:17:32 +00:00
1 - Create the following resource script:
```
&#x3c;ruby&#x3e;
framework.sessions.each_pair do |sid, session|
run_single("use <%= mod.fullname %>")
run_single("set SESSION #{sid}")
run_single("run")
end
&#x3c;/ruby&#x3e;
```
2 - At the msf prompt, execute the above resource script:
```
msf > resource path-to-resource-script
```