Execute shellcode from powershell



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:





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,


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