10

Is there a similar Linux su command in Windows command line? If not, what about:

  • in Powershell?;
  • a workaround with a *.vbs script?;
  • a workaround with some of the sysinternals tools like "psexec.exe"?

Note: I am using a netcat remote shell connection, so I am not able to insert password when requested by command "runas".

Note2: "sudo" and "su" commands are different commands. "sudo" executes commands as another user. "su" changes the effective user.

Note3: Despite finding an answer to my specific issue, The answer to this question, as mentioned by @Ramhound is "not possible"

jarnowicz
  • 175
f4d0
  • 233

2 Answers2

4

In Windows you have the runas command. Try this:

  1. Navigate to c:\windows\system32.

  2. Enter the following command: runas /user:computer_name\account_name explorer.exe

0

This one worked for me

user@server C:\Windows\System32> runas /user:Administrator "dir C:\Users\Administrator"

So something like runas /user:MyUser "command"

DimiDak
  • 320