Running Powershell in Metasploit's Meterpreter?
I'm Running This Command in Meterpreter: Execute -H -C -I -F Powershell. Exe This Is the Output: Process 2716 Created. Channel 3 Created. Windows Powershell...
I'm running this command in Meterpreter:
execute -H -c -i -f powershell.exe
This is the output:
Process 2716 created.
Channel 3 created.
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
I waited for about 5 min (in the event it was loading modules or something), but I didn't get a prompt.
1 Answer
My understanding is that Meterpreter execute generally works by dumping the output of a command to the console. Although -i should allow interactivity, it would probably make more sense to use shell instead.
From the shell that spawns (cmd.exe), you should be able to run PowerShell if necessary. Otherwise, you should have a standard cmd.exe shell already.
If running shell doesn't work, you might have some other issues with your Meterpreter session.
Hope that helps!