metasploit-framework/data/markdown_doc/post_demo_template.erb

44 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
2016-03-06 02:33:40 +00:00
**From the Meterpreter prompt**
The first is by using the "run" command at the Meterpreter prompt. It allows you to run the post
2016-02-18 06:17:32 +00:00
module against that specific session:
```
meterpreter > run <%= mod.fullname %>
```
2016-03-06 02:33:40 +00:00
**From the msf prompt**
2016-02-18 06:17:32 +00:00
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:
```
2016-03-08 16:10:10 +00:00
<ruby>
2016-02-18 06:17:32 +00:00
framework.sessions.each_pair do |sid, session|
run_single("use <%= mod.fullname %>")
run_single("set SESSION #{sid}")
run_single("run")
end
2016-03-08 16:10:10 +00:00
</ruby>
2016-02-18 06:17:32 +00:00
```
2 - At the msf prompt, execute the above resource script:
```
msf > resource path-to-resource-script
```