2022-10-08 17:25:30 +01:00
|
|
|
# psexec
|
|
|
|
|
|
|
|
> Execute a command-line process on a remote machine.
|
|
|
|
> This is an advanced command and it might potentially be dangerous.
|
2023-10-26 19:29:28 +01:00
|
|
|
> More information: <https://learn.microsoft.com/sysinternals/downloads/psexec>.
|
2022-10-08 17:25:30 +01:00
|
|
|
|
|
|
|
- Execute a command using `cmd` in a remote shell:
|
|
|
|
|
|
|
|
`psexec \\{{remote_host}} cmd`
|
|
|
|
|
|
|
|
- Execute a command on a remote host (pre-authenticated):
|
|
|
|
|
|
|
|
`psexec \\{{remote_host}} -u {{user_name}} -p {{password}}`
|
|
|
|
|
|
|
|
- Execute a command remotely and output the result to a file:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`psexec \\{{remote_host}} cmd /c {{command}} -an ^>{{path\to\file.txt}}`
|
2022-10-08 17:25:30 +01:00
|
|
|
|
|
|
|
- Execute a program to interact with users:
|
|
|
|
|
|
|
|
`psexec \\{{remote_host}} -d -i {{program_name}}`
|
|
|
|
|
|
|
|
- Display the IP configuration of the remote host:
|
|
|
|
|
|
|
|
`psexec \\{{remote_host}} ipconfig /all`
|