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
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

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest