O'Reilly logo

Metasploit Penetration Testing Cookbook - Third Edition by Monika Agarwal, Abhinav Singh, Daniel Teixeira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. In this recipe, we will start by loading the PowerShell extension with the load powershell command and have a look at which commands were added to our Meterpreter session using the help command:
meterpreter > load powershellLoading extension powershell...Success.meterpreter > help powershell Powershell Commands=================== Command Description------- -----------powershell_execute Execute a Powershell command stringpowershell_import Import a PS1 script or .NET Assembly DLLpowershell_shell Create an interactive Powershell prompt  meterpreter >
  1. The first command we will check is the powershell_execute command, which allows us to execute PowerShell commands:
meterpreter > powershell_execute $PSVersionTable[+] Command ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required