How to do it...

To escalate our privilege, Meterpreter provides us with the getsystem command. This command automatically starts looking out for various possible techniques by which the user rights can be escalated to a higher level. Let's analyze different techniques used by the getsystem command:

meterpreter > getsystem -hUsage: getsystem [options]Attempt to elevate your privilege to that of local system.OPTIONS:   -h        Help Banner.   -t <opt>  The technique to use. (Default to '0').              0 : All techniques available              1 : Named Pipe Impersonation (In Memory/Admin)              2 : Named Pipe Impersonation (Dropper/Admin)              3 : Token Duplication (In Memory/Admin)

Get Metasploit Penetration Testing Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.