Nexpose - Environment is Incorrect
Some users of Nexpose have experienced the error
Environment is Incorrect after executing commands such as the following:
1[*] Started reverse handler2[*] Starting the payload handler...3[*] Sending stage (971264 bytes)4[*] Meterpreter session 1 opened56meterpreter > getuid7Server username: User-PC\User8meterpreter > getsystem9[-] 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.