antonioCoco / ConPtyShell

ConPtyShell - Fully Interactive Reverse Shell for Windows
MIT License
952 stars 158 forks source link

Thread.Abort is not supported error thrown on newer versions of powershell #11

Open Yannik opened 1 year ago

Yannik commented 1 year ago

With powershell 7, the following error gets thrown when executing Invoke-ConPtyShell:

Add-Type:
Line |
 113 |      Add-Type -TypeDefinition $Source -Language CSharp;
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | (1465,9): error CS0618: 'Thread.Abort()' is obsolete: 'Thread.Abort is not supported and throws PlatformNotSupportedException.'
        thThreadReadPipeWriteSocket.Abort();
        ^

Add-Type:
Line |
 113 |      Add-Type -TypeDefinition $Source -Language CSharp;
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | (1466,9): error CS0618: 'Thread.Abort()' is obsolete: 'Thread.Abort is not supported and throws PlatformNotSupportedException.'
        thReadSocketWritePipe.Abort();
        ^

Add-Type:
Line |
 113 |      Add-Type -TypeDefinition $Source -Language CSharp;
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot add type. Compilation errors occurred.
InvalidOperation:
Line |
 114 |      $output = [ConPtyShellMainClass]::ConPtyShellMain($parametersConP …
     |                ~~~~~~~~~~~~~~~~~~~~~~
     | Unable to find type [ConPtyShellMainClass].
antonioCoco commented 1 year ago

thanks for reporting, will address this in the next release.

Yannik commented 1 year ago

@antonioCoco thank you, that's great!