Execute shellcode from powershell

Welcome Forums General PowerShell Q&A Execute shellcode from powershell

Viewing 1 reply thread
  • Author
    Posts
    • #230611
      Participant
      Topics: 1
      Replies: 0
      Points: 12
      Rank: Member

      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.

    • #233587
      Senior Moderator
      Topics: 9
      Replies: 1244
      Points: 4,480
      Helping Hand
      Rank: Community Hero

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

Viewing 1 reply thread
  • You must be logged in to reply to this topic.