Meterpreter getsystem
Easy win??? Not really.
getsystem
Meterpreter has a built-in command getsystem
. This thing is not reliable, but it is good to know that it exists.
Don't use getsystem
in real-world scenarios since it might crash the victim machine.
Techniques
The getsystem command has three techniques. The first two rely on named pipe impersonation, and the last one relies on token duplication:
As the help information states, this technique drops a file to disk. This is an opportunity for an anti-virus product to catch you. If you’re worried about anti-virus or leaving forensic evidence, I’d avoid getsystem –t 0 (which tries every technique) and I’d avoid getsystem –t 2.
This technique’s implementation limits itself to x86 environments only. On the bright side, it does not require spawning a new process and it takes place entirely in memory.
Let’s say techniques 1-3 fail. You can always fall back to getting system by hand. All of these techniques rely on your ability, as a privileged user, to create or inject into a service. If these techniques fail, generate an executable for your payload and use sc or at to run it as SYSTEM. There you go, you’ve got system.
Reference
Last updated
Was this helpful?