Getsystem Command

Nexpose - Environment is Incorrect

Some users of Nexpose have experienced the error Environment is Incorrect after executing commands such as the following:

[*] Started reverse handler
[*] Starting the payload handler...
[*] Sending stage (971264 bytes)
[*] Meterpreter session 1 opened
meterpreter > getuid
Server username: User-PC\User
meterpreter > getsystem
[-] priv_elevate_getsystem: Operation failed: The environment is incorrect.

The getsystem command supports three different methods for elevating your current privileges to SYSTEM.

When you run getsystem without any parameters, Meterpreter reads this command as "please try to get SYSTEM privileges using all of the available methods." Meterpreter will try each of those in turn, and as soon as one succeeds, it will stop trying. If it runs out of methods, it will return the error message associated with the latest attempt.

If you want to have Meterpreter use a particular method only, you can force it to do so with the -t option, such as getsystem -t 2, which says "only use the second method."

Each method of elevation in getsystem relies on the process having certain properties or permissions. On Windows 7/8/8.1, getsystem will not work with any of these methods because the operating system has been patched to avoid these flaws.