December 2017
Intermediate to advanced
860 pages
16h 1m
English
Let's work out a simple example meterpreter script, which will check whether we are an admin user and then find the explorer process and migrates into it automatically.
Before looking into the code, let's see the important function used here:
| Functions | Library File | Usage |
| is_admin | /lib/msf/core/post/windows/priv.rb | Checks if the session has admin privileges or not. |
| session.sys.process.get_processes() | /lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb | Lists all the running processes on the target. |
| session.core.migrate() | /lib/rex/post/meterpreter/client_core.rb | Migrates the access from an existing process to the PID specified in the parameter. |
Let's look at the following code:
admin_check ...
Read now
Unlock full access