Execute shellcode from powershell

Hi,

 

I’m looking for a way to run shell code from powershell without touching disk.

 

For example, in c, you can download or store a char * with shellcode, later, after adjusting page permission you can do something like this:

 

((void()())shellcode)()

 

 

What is the correct way to do this from powershell.

I think, that powershell is manages code, maybe I must use c# code embed in ps file.

 

Thanks for reading,

Regards.

You can use PowerShell.exe -c {code} . In this way you don’t need to save the code as a script{