Within this module, I wanted to cover the ability to
use PowerShell within Meterpreter.
So right now I have a Meterpreter session set up, and this has
been established with my target machine.
What we're going to do is we're going to leverage some of the
PowerSploit tools via the Meterpreter session using the
PowerShell module of Meterpreter.
So the first thing that we need to do is issue a really simple
command, which is load powershell. This goes and loads the
PowerShell extension into Meterpreter.
Now if we take a look at the list of PowerShell commands,
we have the powershell_execute,
which will allow us to execute PowerShell commands.
We've got the ability to import PowerShell modules,
remove a PowerShell session, and drop down into a
PowerShell shell on the target machine.
So I'm going to go ahead and make use of the PowerView
module from PowerSploit. To load this, I need to issue a command,
powershell_import, followed by the location of the PowerView.ps1 file.
Once I hit Enter, the file will successfully be imported. Now
from here, I can drop down into the actual shell and issue these
commands, or I can run the command via Meterpreter by making use
of powershell_execute.
So here's an example of running powershell_execute on
the Get‑NetDomain module of PowerView.
So this is another great way that you can make use of PowerShell within
Meterpreter. Although this course is not focused on Meterpreter,
I wanted to share this with you so that you can see that
there are various ways that you can make use of PowerShell,
along with other pen testing tools.